From eddd818a90b4e2c1c82f86a9ff65996310473b4c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 9 Dec 2022 06:40:13 +0000 Subject: [PATCH] CodeGen from PR 21809 in Azure/azure-rest-api-specs Merge 095cefa20dcad4ab4dadad29a68a8e7da7a470c3 into afc91d411dc6f5b8f6c6e6d5abbc46da096729e0 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 105 + .../SAMPLE.md | 4354 +++++++ .../pom.xml | 55 + .../SiteRecoveryManager.java | 739 ++ .../fluent/MigrationRecoveryPointsClient.java | 107 + .../fluent/OperationsClient.java | 43 + .../fluent/RecoveryPointsClient.java | 115 + .../ReplicationAlertSettingsClient.java | 124 + .../fluent/ReplicationAppliancesClient.java | 49 + ...ionEligibilityResultsOperationsClient.java | 82 + .../fluent/ReplicationEventsClient.java | 81 + .../fluent/ReplicationFabricsClient.java | 593 + .../fluent/ReplicationJobsClient.java | 370 + .../ReplicationLogicalNetworksClient.java | 87 + .../ReplicationMigrationItemsClient.java | 1084 ++ .../ReplicationNetworkMappingsClient.java | 437 + .../fluent/ReplicationNetworksClient.java | 117 + .../fluent/ReplicationPoliciesClient.java | 295 + .../ReplicationProtectableItemsClient.java | 110 + .../ReplicationProtectedItemsClient.java | 2115 ++++ ...tionProtectionContainerMappingsClient.java | 547 + ...ReplicationProtectionContainersClient.java | 494 + .../ReplicationProtectionIntentsClient.java | 127 + .../ReplicationRecoveryPlansClient.java | 865 ++ ...cationRecoveryServicesProvidersClient.java | 442 + ...onStorageClassificationMappingsClient.java | 340 + ...plicationStorageClassificationsClient.java | 124 + .../fluent/ReplicationVaultHealthsClient.java | 103 + .../ReplicationVaultSettingsClient.java | 165 + .../fluent/ReplicationvCentersClient.java | 383 + .../fluent/SiteRecoveryManagementClient.java | 242 + ...ortedOperatingSystemsOperationsClient.java | 45 + .../fluent/TargetComputeSizesClient.java | 62 + .../fluent/models/AlertInner.java | 81 + .../fluent/models/EventInner.java | 81 + .../fluent/models/FabricInner.java | 81 + .../fluent/models/JobInner.java | 81 + .../fluent/models/LogicalNetworkInner.java | 81 + .../fluent/models/MigrationItemInner.java | 81 + .../models/MigrationRecoveryPointInner.java | 81 + .../fluent/models/NetworkInner.java | 81 + .../fluent/models/NetworkMappingInner.java | 86 + .../models/OperationsDiscoveryInner.java | 168 + .../fluent/models/PolicyInner.java | 81 + .../fluent/models/ProtectableItemInner.java | 81 + .../models/ProtectionContainerInner.java | 81 + .../ProtectionContainerMappingInner.java | 81 + .../fluent/models/RecoveryPlanInner.java | 81 + .../fluent/models/RecoveryPointInner.java | 81 + .../models/RecoveryServicesProviderInner.java | 81 + .../models/ReplicationApplianceInner.java | 54 + ...tionEligibilityResultsCollectionInner.java | 54 + .../ReplicationEligibilityResultsInner.java | 88 + .../models/ReplicationProtectedItemInner.java | 81 + .../ReplicationProtectionIntentInner.java | 81 + .../models/StorageClassificationInner.java | 81 + .../StorageClassificationMappingInner.java | 81 + .../SupportedOperatingSystemsInner.java | 81 + .../fluent/models/TargetComputeSizeInner.java | 132 + .../fluent/models/VCenterInner.java | 81 + .../models/VaultHealthDetailsInner.java | 81 + .../fluent/models/VaultSettingInner.java | 81 + .../fluent/models/package-info.java | 6 + .../fluent/package-info.java | 6 + .../implementation/AlertImpl.java | 128 + .../implementation/EventImpl.java | 50 + .../implementation/FabricImpl.java | 180 + .../implementation/JobImpl.java | 50 + .../implementation/LogicalNetworkImpl.java | 50 + .../implementation/MigrationItemImpl.java | 355 + .../MigrationRecoveryPointImpl.java | 50 + .../MigrationRecoveryPointsClientImpl.java | 715 ++ .../MigrationRecoveryPointsImpl.java | 121 + .../implementation/NetworkImpl.java | 50 + .../implementation/NetworkMappingImpl.java | 192 + .../implementation/OperationsClientImpl.java | 334 + .../OperationsDiscoveryImpl.java | 46 + .../implementation/OperationsImpl.java | 47 + .../implementation/PolicyImpl.java | 165 + .../implementation/ProtectableItemImpl.java | 50 + .../ProtectionContainerImpl.java | 185 + .../ProtectionContainerMappingImpl.java | 226 + .../implementation/RecoveryPlanImpl.java | 252 + .../implementation/RecoveryPointImpl.java | 50 + .../RecoveryPointsClientImpl.java | 750 ++ .../implementation/RecoveryPointsImpl.java | 126 + .../RecoveryServicesProviderImpl.java | 157 + .../ReplicationAlertSettingsClientImpl.java | 752 ++ .../ReplicationAlertSettingsImpl.java | 134 + .../ReplicationApplianceImpl.java | 34 + .../ReplicationAppliancesClientImpl.java | 386 + .../ReplicationAppliancesImpl.java | 48 + ...ationEligibilityResultsCollectionImpl.java | 48 + .../ReplicationEligibilityResultsImpl.java | 46 + ...ligibilityResultsOperationsClientImpl.java | 408 + ...ationEligibilityResultsOperationsImpl.java | 88 + .../ReplicationEventsClientImpl.java | 561 + .../implementation/ReplicationEventsImpl.java | 72 + .../ReplicationFabricsClientImpl.java | 2719 +++++ .../ReplicationFabricsImpl.java | 238 + .../ReplicationJobsClientImpl.java | 1792 +++ .../implementation/ReplicationJobsImpl.java | 153 + .../ReplicationLogicalNetworksClientImpl.java | 571 + .../ReplicationLogicalNetworksImpl.java | 80 + .../ReplicationMigrationItemsClientImpl.java | 5300 ++++++++ .../ReplicationMigrationItemsImpl.java | 682 ++ .../ReplicationNetworkMappingsClientImpl.java | 2156 ++++ .../ReplicationNetworkMappingsImpl.java | 317 + .../ReplicationNetworksClientImpl.java | 850 ++ .../ReplicationNetworksImpl.java | 86 + .../ReplicationPoliciesClientImpl.java | 1459 +++ .../ReplicationPoliciesImpl.java | 196 + ...ReplicationProtectableItemsClientImpl.java | 748 ++ .../ReplicationProtectableItemsImpl.java | 112 + .../ReplicationProtectedItemImpl.java | 615 + .../ReplicationProtectedItemsClientImpl.java | 10118 ++++++++++++++++ .../ReplicationProtectedItemsImpl.java | 1042 ++ ...ProtectionContainerMappingsClientImpl.java | 2700 +++++ ...cationProtectionContainerMappingsImpl.java | 276 + ...icationProtectionContainersClientImpl.java | 2469 ++++ .../ReplicationProtectionContainersImpl.java | 277 + .../ReplicationProtectionIntentImpl.java | 130 + ...eplicationProtectionIntentsClientImpl.java | 802 ++ .../ReplicationProtectionIntentsImpl.java | 140 + .../ReplicationRecoveryPlansClientImpl.java | 3848 ++++++ .../ReplicationRecoveryPlansImpl.java | 379 + ...onRecoveryServicesProvidersClientImpl.java | 2232 ++++ ...licationRecoveryServicesProvidersImpl.java | 212 + ...orageClassificationMappingsClientImpl.java | 1922 +++ ...tionStorageClassificationMappingsImpl.java | 396 + ...ationStorageClassificationsClientImpl.java | 880 ++ ...ReplicationStorageClassificationsImpl.java | 95 + .../ReplicationVaultHealthsClientImpl.java | 482 + .../ReplicationVaultHealthsImpl.java | 79 + .../ReplicationVaultSettingsClientImpl.java | 881 ++ .../ReplicationVaultSettingsImpl.java | 134 + .../ReplicationvCentersClientImpl.java | 1944 +++ .../ReplicationvCentersImpl.java | 247 + .../SiteRecoveryManagementClientBuilder.java | 144 + .../SiteRecoveryManagementClientImpl.java | 668 + .../StorageClassificationImpl.java | 50 + .../StorageClassificationMappingImpl.java | 161 + .../SupportedOperatingSystemsImpl.java | 50 + ...dOperatingSystemsOperationsClientImpl.java | 227 + ...pportedOperatingSystemsOperationsImpl.java | 61 + .../implementation/TargetComputeSizeImpl.java | 46 + .../TargetComputeSizesClientImpl.java | 457 + .../TargetComputeSizesImpl.java | 70 + .../implementation/Utils.java | 204 + .../implementation/VCenterImpl.java | 172 + .../VaultHealthDetailsImpl.java | 50 + .../implementation/VaultSettingImpl.java | 127 + .../implementation/package-info.java | 6 + .../models/A2AAddDisksInput.java | 89 + .../models/A2AApplyRecoveryPointInput.java | 29 + .../models/A2AContainerCreationInput.java | 29 + .../models/A2AContainerMappingInput.java | 111 + .../A2ACreateProtectionIntentInput.java | 681 ++ ...usterMigrationApplyRecoveryPointInput.java | 29 + ...lusterMigrationContainerCreationInput.java | 30 + ...ClusterMigrationEnableProtectionInput.java | 82 + ...ssClusterMigrationPolicyCreationInput.java | 29 + ...ossClusterMigrationReplicationDetails.java | 195 + .../models/A2AEnableProtectionInput.java | 520 + .../models/A2AEventDetails.java | 186 + .../models/A2AExtendedLocationDetails.java | 82 + .../models/A2APolicyCreationInput.java | 145 + .../models/A2APolicyDetails.java | 160 + .../models/A2AProtectedDiskDetails.java | 630 + .../A2AProtectedManagedDiskDetails.java | 766 ++ .../A2AProtectionContainerMappingDetails.java | 163 + .../A2AProtectionIntentDiskInputDetails.java | 119 + ...otectionIntentManagedDiskInputDetails.java | 234 + .../models/A2ARecoveryAvailabilityType.java | 41 + .../models/A2ARecoveryPointDetails.java | 83 + .../models/A2ARemoveDisksInput.java | 83 + .../models/A2AReplicationDetails.java | 1379 +++ .../models/A2AReplicationIntentDetails.java | 648 + .../models/A2AReprotectInput.java | 190 + .../models/A2ARpRecoveryPointType.java | 45 + .../models/A2ASwitchProtectionInput.java | 378 + .../models/A2ATestFailoverInput.java | 87 + .../models/A2AUnplannedFailoverInput.java | 87 + .../models/A2AUnprotectedDiskDetails.java | 76 + .../A2AUpdateContainerMappingInput.java | 111 + ...2AUpdateReplicationProtectedItemInput.java | 276 + .../models/A2AVmDiskInputDetails.java | 123 + .../models/A2AVmManagedDiskInputDetails.java | 237 + .../models/A2AVmManagedDiskUpdateDetails.java | 183 + .../models/A2AZoneDetails.java | 76 + .../models/AddDisksInput.java | 53 + .../models/AddDisksInputProperties.java | 66 + .../models/AddDisksProviderSpecificInput.java | 33 + .../AddRecoveryServicesProviderInput.java | 61 + ...coveryServicesProviderInputProperties.java | 213 + .../models/AddVCenterRequest.java | 53 + .../models/AddVCenterRequestProperties.java | 154 + .../models/AgentAutoUpdateStatus.java | 38 + .../models/AgentDetails.java | 103 + .../models/AgentDiskDetails.java | 99 + .../models/AgentUpgradeBlockedReason.java | 77 + .../models/AgentVersionStatus.java | 47 + .../models/Alert.java | 134 + .../models/AlertCollection.java | 81 + .../models/AlertProperties.java | 103 + .../AlternateLocationRecoveryOption.java | 38 + .../models/ApplianceCollection.java | 81 + .../models/ApplianceSpecificDetails.java | 33 + .../models/ApplyRecoveryPointInput.java | 61 + .../ApplyRecoveryPointInputProperties.java | 89 + ...plyRecoveryPointProviderSpecificInput.java | 41 + .../models/AsrJobDetails.java | 37 + .../models/AsrTask.java | 355 + .../models/AutoProtectionOfDataDisk.java | 38 + .../AutomationAccountAuthenticationType.java | 40 + .../models/AutomationRunbookTaskDetails.java | 264 + .../models/AzureFabricCreationInput.java | 56 + .../models/AzureFabricSpecificDetails.java | 141 + ...AzureToAzureCreateNetworkMappingInput.java | 65 + .../AzureToAzureNetworkMappingSettings.java | 82 + ...AzureToAzureUpdateNetworkMappingInput.java | 56 + .../AzureToAzureVmSyncedConfigDetails.java | 83 + .../models/AzureVmDiskDetails.java | 284 + .../models/ComputeSizeErrorDetails.java | 76 + .../models/ConfigurationSettings.java | 37 + .../models/ConfigureAlertRequest.java | 53 + .../ConfigureAlertRequestProperties.java | 103 + .../models/ConsistencyCheckTaskDetails.java | 60 + .../models/CreateNetworkMappingInput.java | 61 + .../CreateNetworkMappingInputProperties.java | 115 + .../models/CreatePolicyInput.java | 53 + .../models/CreatePolicyInputProperties.java | 53 + .../CreateProtectionContainerInput.java | 53 + ...ateProtectionContainerInputProperties.java | 55 + ...CreateProtectionContainerMappingInput.java | 54 + ...ectionContainerMappingInputProperties.java | 107 + .../models/CreateProtectionIntentInput.java | 53 + .../CreateProtectionIntentProperties.java | 56 + ...otectionIntentProviderSpecificDetails.java | 33 + .../models/CreateRecoveryPlanInput.java | 61 + .../CreateRecoveryPlanInputProperties.java | 183 + .../models/CriticalJobHistoryDetails.java | 85 + .../models/CurrentJobDetails.java | 70 + .../models/CurrentScenarioDetails.java | 103 + .../models/DataStore.java | 154 + .../models/DataSyncStatus.java | 38 + .../models/DisableProtectionInput.java | 61 + .../DisableProtectionInputProperties.java | 83 + ...isableProtectionProviderSpecificInput.java | 33 + .../models/DisableProtectionReason.java | 38 + .../DiscoverProtectableItemRequest.java | 53 + ...coverProtectableItemRequestProperties.java | 102 + .../models/DiskAccountType.java | 41 + .../models/DiskDetails.java | 128 + .../models/DiskEncryptionInfo.java | 82 + .../models/DiskEncryptionKeyInfo.java | 76 + .../models/DiskReplicationProgressHealth.java | 47 + .../models/DiskVolumeDetails.java | 76 + .../models/Display.java | 170 + .../models/DraDetails.java | 166 + .../models/EnableMigrationInput.java | 60 + .../EnableMigrationInputProperties.java | 94 + .../EnableMigrationProviderSpecificInput.java | 33 + .../models/EnableProtectionInput.java | 53 + .../EnableProtectionInputProperties.java | 111 + ...EnableProtectionProviderSpecificInput.java | 40 + .../models/EncryptionDetails.java | 103 + .../models/EthernetAddressType.java | 38 + .../models/Event.java | 52 + .../models/EventCollection.java | 81 + .../models/EventProperties.java | 323 + .../models/EventProviderSpecificDetails.java | 43 + .../models/EventSpecificDetails.java | 33 + .../models/ExistingProtectionProfile.java | 65 + .../ExistingRecoveryAvailabilitySet.java | 58 + ...istingRecoveryProximityPlacementGroup.java | 59 + .../models/ExistingRecoveryResourceGroup.java | 56 + .../ExistingRecoveryVirtualNetwork.java | 93 + .../models/ExistingStorageAccount.java | 65 + .../models/ExportJobDetails.java | 90 + .../ExportJobOutputSerializationType.java | 41 + .../models/ExtendedLocation.java | 89 + .../models/ExtendedLocationType.java | 35 + .../models/Fabric.java | 256 + .../models/FabricCollection.java | 81 + .../models/FabricCreationInput.java | 53 + .../models/FabricCreationInputProperties.java | 53 + .../models/FabricProperties.java | 245 + .../FabricReplicationGroupTaskDetails.java | 89 + ...bricSpecificCreateNetworkMappingInput.java | 37 + .../models/FabricSpecificCreationInput.java | 37 + .../models/FabricSpecificDetails.java | 40 + ...bricSpecificUpdateNetworkMappingInput.java | 37 + .../models/FailoverDeploymentModel.java | 41 + .../models/FailoverJobDetails.java | 69 + .../models/FailoverProcessServerRequest.java | 53 + ...ailoverProcessServerRequestProperties.java | 155 + ...iloverReplicationProtectedItemDetails.java | 259 + .../models/GroupTaskDetails.java | 67 + .../models/HealthError.java | 428 + .../models/HealthErrorCategory.java | 69 + .../HealthErrorCustomerResolvability.java | 38 + .../models/HealthErrorSummary.java | 215 + .../models/HyperVHostDetails.java | 69 + .../models/HyperVReplica2012EventDetails.java | 134 + .../HyperVReplica2012R2EventDetails.java | 134 + ...rVReplicaAzureApplyRecoveryPointInput.java | 82 + .../HyperVReplicaAzureDiskInputDetails.java | 128 + ...perVReplicaAzureEnableProtectionInput.java | 783 ++ .../HyperVReplicaAzureEventDetails.java | 108 + ...perVReplicaAzureFailbackProviderInput.java | 109 + .../HyperVReplicaAzureManagedDiskDetails.java | 128 + ...licaAzurePlannedFailoverProviderInput.java | 113 + .../HyperVReplicaAzurePolicyDetails.java | 196 + .../models/HyperVReplicaAzurePolicyInput.java | 172 + .../HyperVReplicaAzureReplicationDetails.java | 913 ++ .../HyperVReplicaAzureReprotectInput.java | 186 + ...HyperVReplicaAzureRpRecoveryPointType.java | 43 + .../HyperVReplicaAzureTestFailoverInput.java | 111 + ...erVReplicaAzureUnplannedFailoverInput.java | 111 + ...reUpdateReplicationProtectedItemInput.java | 336 + .../models/HyperVReplicaBaseEventDetails.java | 134 + .../HyperVReplicaBasePolicyDetails.java | 296 + .../HyperVReplicaBaseReplicationDetails.java | 224 + .../HyperVReplicaBluePolicyDetails.java | 322 + .../models/HyperVReplicaBluePolicyInput.java | 127 + .../HyperVReplicaBlueReplicationDetails.java | 224 + .../models/HyperVReplicaPolicyDetails.java | 296 + .../models/HyperVReplicaPolicyInput.java | 300 + .../HyperVReplicaReplicationDetails.java | 224 + .../models/HyperVSiteDetails.java | 60 + .../models/HyperVVirtualMachineDetails.java | 260 + .../models/IdentityProviderDetails.java | 166 + .../models/IdentityProviderInput.java | 196 + .../models/InMageAgentDetails.java | 129 + .../InMageAzureV2ApplyRecoveryPointInput.java | 29 + .../models/InMageAzureV2DiskInputDetails.java | 128 + .../InMageAzureV2EnableProtectionInput.java | 724 ++ .../models/InMageAzureV2EventDetails.java | 214 + .../InMageAzureV2ManagedDiskDetails.java | 154 + .../models/InMageAzureV2PolicyDetails.java | 160 + .../models/InMageAzureV2PolicyInput.java | 171 + .../InMageAzureV2ProtectedDiskDetails.java | 625 + .../InMageAzureV2RecoveryPointDetails.java | 56 + .../InMageAzureV2ReplicationDetails.java | 1813 +++ .../models/InMageAzureV2ReprotectInput.java | 213 + ...eV2SwitchProviderBlockingErrorDetails.java | 118 + .../InMageAzureV2SwitchProviderDetails.java | 84 + .../InMageAzureV2SwitchProviderInput.java | 129 + .../InMageAzureV2TestFailoverInput.java | 59 + .../InMageAzureV2UnplannedFailoverInput.java | 59 + ...V2UpdateReplicationProtectedItemInput.java | 307 + .../models/InMageBasePolicyDetails.java | 134 + ...isableProtectionProviderSpecificInput.java | 58 + .../models/InMageDiskDetails.java | 184 + .../models/InMageDiskExclusionInput.java | 84 + .../InMageDiskSignatureExclusionOptions.java | 52 + .../models/InMageEnableProtectionInput.java | 327 + ...ricSwitchProviderBlockingErrorDetails.java | 118 + .../models/InMagePolicyDetails.java | 134 + .../models/InMagePolicyInput.java | 145 + .../models/InMageProtectedDiskDetails.java | 598 + ...geRcmAgentUpgradeBlockingErrorDetails.java | 118 + .../models/InMageRcmApplianceDetails.java | 214 + .../InMageRcmApplianceSpecificDetails.java | 49 + .../InMageRcmApplyRecoveryPointInput.java | 65 + ...InMageRcmDiscoveredProtectedVmDetails.java | 206 + .../models/InMageRcmDiskInput.java | 147 + .../models/InMageRcmDisksDefaultInput.java | 117 + .../InMageRcmEnableProtectionInput.java | 527 + .../models/InMageRcmEventDetails.java | 150 + .../models/InMageRcmFabricCreationInput.java | 131 + .../InMageRcmFabricSpecificDetails.java | 310 + ...ricSwitchProviderBlockingErrorDetails.java | 118 + ...mFailbackDiscoveredProtectedVmDetails.java | 206 + .../models/InMageRcmFailbackEventDetails.java | 105 + ...InMageRcmFailbackMobilityAgentDetails.java | 161 + .../models/InMageRcmFailbackNicDetails.java | 84 + ...mFailbackPlannedFailoverProviderInput.java | 67 + .../InMageRcmFailbackPolicyCreationInput.java | 84 + .../InMageRcmFailbackPolicyDetails.java | 83 + ...InMageRcmFailbackProtectedDiskDetails.java | 218 + .../InMageRcmFailbackRecoveryPointType.java | 38 + .../InMageRcmFailbackReplicationDetails.java | 533 + .../InMageRcmFailbackReprotectInput.java | 123 + .../models/InMageRcmFailbackSyncDetails.java | 147 + ...InMageRcmLastAgentUpgradeErrorDetails.java | 118 + .../models/InMageRcmMobilityAgentDetails.java | 176 + .../models/InMageRcmNicDetails.java | 307 + .../models/InMageRcmNicInput.java | 219 + .../models/InMageRcmPolicyCreationInput.java | 137 + .../models/InMageRcmPolicyDetails.java | 136 + .../models/InMageRcmProtectedDiskDetails.java | 288 + ...eRcmProtectionContainerMappingDetails.java | 46 + .../models/InMageRcmRecoveryPointDetails.java | 45 + .../models/InMageRcmReplicationDetails.java | 1033 ++ .../models/InMageRcmReprotectInput.java | 155 + .../models/InMageRcmSyncDetails.java | 146 + .../models/InMageRcmTestFailoverInput.java | 85 + .../InMageRcmUnplannedFailoverInput.java | 94 + ...ianceForReplicationProtectedItemInput.java | 57 + .../InMageRcmUpdateContainerMappingInput.java | 66 + ...cmUpdateReplicationProtectedItemInput.java | 322 + .../models/InMageReplicationDetails.java | 1107 ++ .../models/InMageReprotectInput.java | 268 + .../models/InMageTestFailoverInput.java | 90 + .../models/InMageUnplannedFailoverInput.java | 90 + .../models/InMageV2RpRecoveryPointType.java | 45 + .../models/InMageVolumeExclusionOptions.java | 86 + .../models/InconsistentVmDetails.java | 129 + .../models/InitialReplicationDetails.java | 77 + .../models/InlineWorkflowTaskDetails.java | 64 + .../models/InnerHealthError.java | 394 + .../models/InputEndpoint.java | 128 + .../models/IpConfigDetails.java | 415 + .../models/IpConfigInputDetails.java | 311 + .../models/Job.java | 52 + .../models/JobCollection.java | 81 + .../models/JobDetails.java | 72 + .../models/JobEntity.java | 180 + .../models/JobErrorDetails.java | 161 + .../models/JobProperties.java | 407 + .../models/JobQueryParameter.java | 232 + .../models/JobStatusEventDetails.java | 134 + .../models/JobTaskDetails.java | 68 + .../models/KeyEncryptionKeyInfo.java | 76 + .../models/LicenseType.java | 41 + .../models/LogicalNetwork.java | 52 + .../models/LogicalNetworkCollection.java | 81 + .../models/LogicalNetworkProperties.java | 134 + .../models/ManualActionTaskDetails.java | 108 + .../models/MarsAgentDetails.java | 164 + .../models/MasterTargetServer.java | 512 + .../models/MigrateInput.java | 60 + .../models/MigrateInputProperties.java | 61 + .../models/MigrateProviderSpecificInput.java | 33 + .../models/MigrationItem.java | 346 + .../models/MigrationItemCollection.java | 81 + .../models/MigrationItemOperation.java | 53 + .../models/MigrationItemProperties.java | 351 + .../MigrationProviderSpecificSettings.java | 33 + .../models/MigrationRecoveryPoint.java | 53 + .../MigrationRecoveryPointCollection.java | 81 + .../MigrationRecoveryPointProperties.java | 55 + .../models/MigrationRecoveryPointType.java | 41 + .../models/MigrationRecoveryPoints.java | 100 + .../models/MigrationState.java | 84 + .../models/MobilityAgentUpgradeState.java | 44 + .../models/MobilityServiceUpdate.java | 102 + .../models/MultiVmGroupCreateOption.java | 38 + .../models/MultiVmSyncPointOption.java | 39 + .../models/Network.java | 52 + .../models/NetworkCollection.java | 81 + .../models/NetworkMapping.java | 184 + .../models/NetworkMappingCollection.java | 85 + .../NetworkMappingFabricSpecificSettings.java | 37 + .../models/NetworkMappingProperties.java | 262 + .../models/NetworkProperties.java | 132 + .../models/NewProtectionProfile.java | 176 + .../models/NewRecoveryVirtualNetwork.java | 86 + .../models/OSDetails.java | 180 + .../models/OSDiskDetails.java | 102 + .../models/OSVersionWrapper.java | 76 + .../models/Operations.java | 38 + .../models/OperationsDiscovery.java | 58 + .../models/OperationsDiscoveryCollection.java | 81 + .../models/PauseReplicationInput.java | 61 + .../PauseReplicationInputProperties.java | 59 + .../models/PlannedFailoverInput.java | 53 + .../PlannedFailoverInputProperties.java | 80 + ...FailoverProviderSpecificFailoverInput.java | 37 + .../models/PlannedFailoverStatus.java | 44 + .../models/Policy.java | 178 + .../models/PolicyCollection.java | 81 + .../models/PolicyProperties.java | 79 + .../models/PolicyProviderSpecificDetails.java | 45 + .../models/PolicyProviderSpecificInput.java | 43 + .../models/PossibleOperationsDirections.java | 38 + .../models/PresenceStatus.java | 43 + .../models/ProcessServer.java | 887 ++ .../models/ProcessServerDetails.java | 464 + .../models/ProtectableItem.java | 52 + .../models/ProtectableItemCollection.java | 81 + .../models/ProtectableItemProperties.java | 212 + .../models/ProtectionContainer.java | 213 + .../models/ProtectionContainerCollection.java | 81 + ...tectionContainerFabricSpecificDetails.java | 39 + .../models/ProtectionContainerMapping.java | 207 + .../ProtectionContainerMappingCollection.java | 81 + .../ProtectionContainerMappingProperties.java | 320 + ...ntainerMappingProviderSpecificDetails.java | 37 + .../models/ProtectionContainerProperties.java | 210 + .../models/ProtectionHealth.java | 44 + .../ProtectionProfileCustomDetails.java | 36 + .../models/ProviderError.java | 154 + .../ProviderSpecificRecoveryPointDetails.java | 37 + .../models/PushInstallerDetails.java | 164 + .../models/RcmComponentStatus.java | 44 + .../models/RcmProxyDetails.java | 179 + .../RecoveryAvailabilitySetCustomDetails.java | 33 + .../models/RecoveryPlan.java | 361 + .../models/RecoveryPlanA2ADetails.java | 140 + .../models/RecoveryPlanA2AFailoverInput.java | 121 + .../models/RecoveryPlanA2AInput.java | 140 + .../models/RecoveryPlanAction.java | 157 + .../models/RecoveryPlanActionDetails.java | 39 + .../models/RecoveryPlanActionLocation.java | 38 + ...eryPlanAutomationRunbookActionDetails.java | 118 + .../models/RecoveryPlanCollection.java | 81 + .../models/RecoveryPlanGroup.java | 146 + .../models/RecoveryPlanGroupTaskDetails.java | 126 + .../models/RecoveryPlanGroupType.java | 41 + ...ryPlanHyperVReplicaAzureFailbackInput.java | 100 + ...ryPlanHyperVReplicaAzureFailoverInput.java | 110 + ...ecoveryPlanInMageAzureV2FailoverInput.java | 93 + .../RecoveryPlanInMageFailoverInput.java | 65 + ...eryPlanInMageRcmFailbackFailoverInput.java | 95 + .../RecoveryPlanInMageRcmFailoverInput.java | 93 + .../RecoveryPlanManualActionDetails.java | 56 + .../RecoveryPlanPlannedFailoverInput.java | 61 + ...eryPlanPlannedFailoverInputProperties.java | 92 + .../models/RecoveryPlanPointType.java | 44 + .../models/RecoveryPlanProperties.java | 452 + .../models/RecoveryPlanProtectedItem.java | 76 + .../RecoveryPlanProviderSpecificDetails.java | 33 + ...veryPlanProviderSpecificFailoverInput.java | 41 + .../RecoveryPlanProviderSpecificInput.java | 33 + .../RecoveryPlanScriptActionDetails.java | 123 + .../RecoveryPlanShutdownGroupTaskDetails.java | 58 + .../RecoveryPlanTestFailoverCleanupInput.java | 62 + ...lanTestFailoverCleanupInputProperties.java | 50 + .../models/RecoveryPlanTestFailoverInput.java | 61 + ...coveryPlanTestFailoverInputProperties.java | 150 + .../RecoveryPlanUnplannedFailoverInput.java | 61 + ...yPlanUnplannedFailoverInputProperties.java | 126 + .../models/RecoveryPoint.java | 52 + .../models/RecoveryPointCollection.java | 81 + .../models/RecoveryPointProperties.java | 107 + .../models/RecoveryPointSyncType.java | 38 + .../models/RecoveryPointType.java | 44 + .../models/RecoveryPoints.java | 108 + ...yProximityPlacementGroupCustomDetails.java | 33 + .../RecoveryResourceGroupCustomDetails.java | 33 + .../models/RecoveryServicesProvider.java | 190 + .../RecoveryServicesProviderCollection.java | 81 + .../RecoveryServicesProviderProperties.java | 564 + .../RecoveryVirtualNetworkCustomDetails.java | 36 + .../models/RemoveDisksInput.java | 53 + .../models/RemoveDisksInputProperties.java | 59 + .../RemoveDisksProviderSpecificInput.java | 33 + ...RemoveProtectionContainerMappingInput.java | 54 + ...ectionContainerMappingInputProperties.java | 54 + .../models/RenewCertificateInput.java | 53 + .../RenewCertificateInputProperties.java | 50 + .../models/ReplicationAgentDetails.java | 164 + .../models/ReplicationAlertSettings.java | 110 + .../models/ReplicationAppliance.java | 25 + .../ReplicationApplianceProperties.java | 54 + .../models/ReplicationAppliances.java | 44 + .../models/ReplicationEligibilityResults.java | 46 + ...plicationEligibilityResultsCollection.java | 27 + ...eplicationEligibilityResultsErrorInfo.java | 143 + ...plicationEligibilityResultsOperations.java | 71 + ...plicationEligibilityResultsProperties.java | 69 + .../models/ReplicationEvents.java | 73 + .../models/ReplicationFabrics.java | 309 + .../models/ReplicationGroupDetails.java | 29 + .../models/ReplicationJobs.java | 204 + .../models/ReplicationLogicalNetworks.java | 79 + .../models/ReplicationMigrationItems.java | 538 + .../models/ReplicationNetworkMappings.java | 226 + .../models/ReplicationNetworks.java | 107 + .../models/ReplicationPolicies.java | 161 + .../models/ReplicationProtectableItems.java | 103 + .../models/ReplicationProtectedItem.java | 609 + .../ReplicationProtectedItemCollection.java | 81 + .../ReplicationProtectedItemOperation.java | 74 + .../ReplicationProtectedItemProperties.java | 827 ++ .../models/ReplicationProtectedItems.java | 1006 ++ ...eplicationProtectionContainerMappings.java | 253 + .../ReplicationProtectionContainers.java | 276 + .../models/ReplicationProtectionIntent.java | 135 + ...ReplicationProtectionIntentCollection.java | 81 + ...ReplicationProtectionIntentProperties.java | 140 + ...tectionIntentProviderSpecificSettings.java | 33 + .../models/ReplicationProtectionIntents.java | 113 + ...cationProviderContainerUnmappingInput.java | 50 + ...roviderSpecificContainerCreationInput.java | 37 + ...ProviderSpecificContainerMappingInput.java | 36 + .../ReplicationProviderSpecificSettings.java | 44 + ...erSpecificUpdateContainerMappingInput.java | 36 + .../models/ReplicationRecoveryPlans.java | 419 + .../ReplicationRecoveryServicesProviders.java | 244 + ...licationStorageClassificationMappings.java | 230 + .../ReplicationStorageClassifications.java | 113 + .../models/ReplicationVaultHealths.java | 65 + .../models/ReplicationVaultSettings.java | 108 + .../models/ReplicationvCenters.java | 198 + .../models/ReprotectAgentDetails.java | 224 + .../models/ResolveHealthError.java | 50 + .../models/ResolveHealthInput.java | 53 + .../models/ResolveHealthInputProperties.java | 54 + .../models/ResourceHealthSummary.java | 109 + .../models/ResumeJobParams.java | 53 + .../models/ResumeJobParamsProperties.java | 50 + .../models/ResumeReplicationInput.java | 61 + .../ResumeReplicationInputProperties.java | 62 + ...esumeReplicationProviderSpecificInput.java | 33 + .../models/ResyncInput.java | 60 + .../models/ResyncInputProperties.java | 61 + .../models/ResyncProviderSpecificInput.java | 33 + .../models/ResyncState.java | 41 + .../models/RetentionVolume.java | 128 + .../models/ReverseReplicationInput.java | 53 + .../ReverseReplicationInputProperties.java | 80 + ...verseReplicationProviderSpecificInput.java | 40 + .../models/RpInMageRecoveryPointType.java | 41 + .../models/RunAsAccount.java | 76 + .../models/ScriptActionTaskDetails.java | 134 + .../models/ServiceError.java | 154 + .../models/SetMultiVmSyncStatus.java | 38 + .../models/Severity.java | 44 + .../models/SourceSiteOperations.java | 38 + .../models/SqlServerLicenseType.java | 44 + .../models/StorageAccountCustomDetails.java | 33 + .../models/StorageClassification.java | 53 + .../StorageClassificationCollection.java | 81 + .../models/StorageClassificationMapping.java | 138 + ...torageClassificationMappingCollection.java | 81 + .../StorageClassificationMappingInput.java | 53 + ...torageClassificationMappingProperties.java | 51 + .../StorageClassificationProperties.java | 50 + .../models/StorageMappingInputProperties.java | 50 + .../models/Subnet.java | 103 + .../models/SupportedOSDetails.java | 106 + .../models/SupportedOSProperties.java | 54 + .../models/SupportedOSProperty.java | 80 + .../models/SupportedOperatingSystems.java | 53 + .../SupportedOperatingSystemsOperations.java | 38 + .../models/SwitchProtectionInput.java | 53 + .../SwitchProtectionInputProperties.java | 80 + .../models/SwitchProtectionJobDetails.java | 64 + ...SwitchProtectionProviderSpecificInput.java | 33 + .../models/SwitchProviderInput.java | 53 + .../models/SwitchProviderInputProperties.java | 80 + .../models/SwitchProviderSpecificInput.java | 33 + .../models/TargetComputeSize.java | 46 + .../models/TargetComputeSizeCollection.java | 81 + .../models/TargetComputeSizeProperties.java | 277 + .../models/TargetComputeSizes.java | 57 + .../models/TaskTypeDetails.java | 40 + .../models/TestFailoverCleanupInput.java | 61 + .../TestFailoverCleanupInputProperties.java | 50 + .../models/TestFailoverInput.java | 60 + .../models/TestFailoverInputProperties.java | 132 + .../models/TestFailoverJobDetails.java | 199 + .../TestFailoverProviderSpecificInput.java | 39 + .../models/TestMigrateCleanupInput.java | 61 + .../TestMigrateCleanupInputProperties.java | 50 + .../models/TestMigrateInput.java | 60 + .../models/TestMigrateInputProperties.java | 62 + .../TestMigrateProviderSpecificInput.java | 33 + .../models/TestMigrationState.java | 56 + .../models/UnplannedFailoverInput.java | 61 + .../UnplannedFailoverInputProperties.java | 106 + ...nplannedFailoverProviderSpecificInput.java | 39 + ...ianceForReplicationProtectedItemInput.java | 63 + ...plicationProtectedItemInputProperties.java | 97 + ...ionProtectedItemProviderSpecificInput.java | 35 + .../models/UpdateDiskInput.java | 84 + .../models/UpdateMigrationItemInput.java | 53 + .../UpdateMigrationItemInputProperties.java | 63 + ...ateMigrationItemProviderSpecificInput.java | 33 + .../models/UpdateMobilityServiceRequest.java | 53 + ...pdateMobilityServiceRequestProperties.java | 50 + .../models/UpdateNetworkMappingInput.java | 53 + .../UpdateNetworkMappingInputProperties.java | 106 + .../models/UpdatePolicyInput.java | 53 + .../models/UpdatePolicyInputProperties.java | 54 + ...UpdateProtectionContainerMappingInput.java | 54 + ...ectionContainerMappingInputProperties.java | 54 + .../models/UpdateRecoveryPlanInput.java | 53 + .../UpdateRecoveryPlanInputProperties.java | 54 + .../UpdateReplicationProtectedItemInput.java | 54 + ...plicationProtectedItemInputProperties.java | 300 + ...ReplicationProtectedItemProviderInput.java | 40 + .../models/UpdateVCenterRequest.java | 53 + .../UpdateVCenterRequestProperties.java | 154 + .../models/VCenter.java | 179 + .../models/VCenterCollection.java | 81 + .../models/VCenterProperties.java | 315 + .../models/VMNicDetails.java | 532 + .../models/VMNicInputDetails.java | 400 + .../VMwareCbtContainerCreationInput.java | 29 + .../VMwareCbtContainerMappingInput.java | 202 + .../models/VMwareCbtDiskInput.java | 205 + .../models/VMwareCbtEnableMigrationInput.java | 677 ++ .../models/VMwareCbtEventDetails.java | 45 + .../models/VMwareCbtMigrateInput.java | 65 + .../models/VMwareCbtMigrationDetails.java | 814 ++ .../models/VMwareCbtNicDetails.java | 344 + .../models/VMwareCbtNicInput.java | 245 + .../models/VMwareCbtPolicyCreationInput.java | 111 + .../models/VMwareCbtProtectedDiskDetails.java | 256 + ...eCbtProtectionContainerMappingDetails.java | 139 + .../VMwareCbtResumeReplicationInput.java | 56 + .../models/VMwareCbtResyncInput.java | 65 + .../models/VMwareCbtTestMigrateInput.java | 127 + .../models/VMwareCbtUpdateDiskInput.java | 110 + .../VMwareCbtUpdateMigrationItemInput.java | 486 + .../models/VMwareDetails.java | 906 ++ .../models/VMwareV2FabricCreationInput.java | 117 + .../models/VMwareV2FabricSpecificDetails.java | 139 + .../models/VMwareVirtualMachineDetails.java | 302 + .../models/VaultHealthDetails.java | 53 + .../models/VaultHealthProperties.java | 141 + .../models/VaultSetting.java | 137 + .../models/VaultSettingCollection.java | 81 + .../models/VaultSettingCreationInput.java | 61 + .../VaultSettingCreationInputProperties.java | 76 + .../models/VaultSettingProperties.java | 76 + .../models/VersionDetails.java | 103 + .../models/VirtualMachineTaskDetails.java | 89 + .../models/VmEncryptionType.java | 41 + .../models/VmNicUpdatesTaskDetails.java | 108 + .../models/VmReplicationProgressHealth.java | 44 + .../models/VmmDetails.java | 29 + .../VmmToAzureCreateNetworkMappingInput.java | 29 + .../VmmToAzureNetworkMappingSettings.java | 29 + .../VmmToAzureUpdateNetworkMappingInput.java | 29 + .../VmmToVmmCreateNetworkMappingInput.java | 29 + .../VmmToVmmNetworkMappingSettings.java | 29 + .../VmmToVmmUpdateNetworkMappingInput.java | 29 + .../models/VmmVirtualMachineDetails.java | 86 + .../models/VmwareCbtPolicyDetails.java | 110 + .../models/package-info.java | 6 + .../package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../MigrationRecoveryPointsGetSamples.java | 32 + ...ecoveryPointsListByReplicationMigrati.java | 31 + .../OperationsListByResourceGroupSamples.java | 23 + .../generated/RecoveryPointsGetSamples.java | 32 + ...intsListByReplicationProtectedItemsSa.java | 31 + ...ReplicationAlertSettingsCreateSamples.java | 33 + .../ReplicationAlertSettingsGetSamples.java | 25 + .../ReplicationAlertSettingsListSamples.java | 23 + .../ReplicationAppliancesListSamples.java | 23 + ...EligibilityResultsOperationGetSamples.java | 23 + ...nEligibilityResultsOperationListSampl.java | 23 + .../ReplicationEventsGetSamples.java | 25 + .../ReplicationEventsListSamples.java | 23 + ...icationFabricsCheckConsistencySamples.java | 23 + .../ReplicationFabricsCreateSamples.java | 29 + .../ReplicationFabricsDeleteSamples.java | 23 + .../ReplicationFabricsGetSamples.java | 23 + .../ReplicationFabricsListSamples.java | 23 + ...ReplicationFabricsMigrateToAadSamples.java | 23 + .../ReplicationFabricsPurgeSamples.java | 23 + ...ationFabricsReassociateGatewaySamples.java | 40 + ...icationFabricsRenewCertificateSamples.java | 33 + .../ReplicationJobsCancelSamples.java | 25 + .../ReplicationJobsExportSamples.java | 34 + .../generated/ReplicationJobsGetSamples.java | 25 + .../generated/ReplicationJobsListSamples.java | 23 + .../ReplicationJobsRestartSamples.java | 25 + .../ReplicationJobsResumeSamples.java | 32 + .../ReplicationLogicalNetworksGetSamples.java | 26 + ...nLogicalNetworksListByReplicationFabr.java | 25 + ...eplicationMigrationItemsCreateSamples.java | 56 + ...eplicationMigrationItemsDeleteSamples.java | 32 + .../ReplicationMigrationItemsGetSamples.java | 31 + ...nMigrationItemsListByReplicationProte.java | 33 + .../ReplicationMigrationItemsListSamples.java | 23 + ...plicationMigrationItemsMigrateSamples.java | 37 + ...MigrationItemsPauseReplicationSamples.java | 35 + ...nMigrationItemsResumeReplicationSampl.java | 39 + ...eplicationMigrationItemsResyncSamples.java | 38 + ...nMigrationItemsTestMigrateCleanupSamp.java | 35 + ...ationMigrationItemsTestMigrateSamples.java | 43 + ...eplicationMigrationItemsUpdateSamples.java | 42 + ...plicationNetworkMappingsCreateSamples.java | 38 + ...plicationNetworkMappingsDeleteSamples.java | 31 + .../ReplicationNetworkMappingsGetSamples.java | 31 + ...nNetworkMappingsListByReplicationNetw.java | 30 + ...ReplicationNetworkMappingsListSamples.java | 23 + ...plicationNetworkMappingsUpdateSamples.java | 45 + .../ReplicationNetworksGetSamples.java | 30 + ...nNetworksListByReplicationFabricsSamp.java | 29 + .../ReplicationNetworksListSamples.java | 23 + .../ReplicationPoliciesCreateSamples.java | 30 + .../ReplicationPoliciesDeleteSamples.java | 23 + .../ReplicationPoliciesGetSamples.java | 23 + .../ReplicationPoliciesListSamples.java | 23 + .../ReplicationPoliciesUpdateSamples.java | 35 + ...ReplicationProtectableItemsGetSamples.java | 31 + ...nProtectableItemsListByReplicationPro.java | 33 + ...licationProtectedItemsAddDisksSamples.java | 51 + ...nProtectedItemsApplyRecoveryPointSamp.java | 40 + ...eplicationProtectedItemsCreateSamples.java | 36 + ...eplicationProtectedItemsDeleteSamples.java | 38 + ...onProtectedItemsFailoverCancelSamples.java | 31 + ...onProtectedItemsFailoverCommitSamples.java | 31 + .../ReplicationProtectedItemsGetSamples.java | 31 + ...nProtectedItemsListByReplicationProte.java | 26 + .../ReplicationProtectedItemsListSamples.java | 23 + ...nProtectedItemsPlannedFailoverSamples.java | 39 + ...ReplicationProtectedItemsPurgeSamples.java | 31 + ...ationProtectedItemsRemoveDisksSamples.java | 42 + ...nProtectedItemsRepairReplicationSampl.java | 31 + ...icationProtectedItemsReprotectSamples.java | 39 + ...nProtectedItemsResolveHealthErrorsSam.java | 39 + ...onProtectedItemsSwitchProviderSamples.java | 45 + ...nProtectedItemsTestFailoverCleanupSam.java | 35 + ...tionProtectedItemsTestFailoverSamples.java | 42 + ...nProtectedItemsUnplannedFailoverSampl.java | 40 + ...nProtectedItemsUpdateApplianceSamples.java | 40 + ...nProtectedItemsUpdateMobilityServiceS.java | 35 + ...eplicationProtectedItemsUpdateSamples.java | 66 + ...nProtectionContainerMappingsCreateSam.java | 35 + ...nProtectionContainerMappingsDeleteSam.java | 38 + ...ProtectionContainerMappingsGetSamples.java | 31 + ...nProtectionContainerMappingsListByRep.java | 26 + ...nProtectionContainerMappingsListSampl.java | 23 + ...nProtectionContainerMappingsPurgeSamp.java | 31 + ...nProtectionContainerMappingsUpdateSam.java | 47 + ...tionProtectionContainersCreateSamples.java | 32 + ...tionProtectionContainersDeleteSamples.java | 25 + ...nProtectionContainersDiscoverProtecta.java | 38 + ...icationProtectionContainersGetSamples.java | 26 + ...nProtectionContainersListByReplicatio.java | 25 + ...cationProtectionContainersListSamples.java | 23 + ...nProtectionContainersSwitchProtection.java | 37 + ...icationProtectionIntentsCreateSamples.java | 41 + ...eplicationProtectionIntentsGetSamples.java | 23 + ...plicationProtectionIntentsListSamples.java | 23 + ...ReplicationRecoveryPlansCreateSamples.java | 52 + ...ReplicationRecoveryPlansDeleteSamples.java | 23 + ...ionRecoveryPlansFailoverCancelSamples.java | 23 + ...ionRecoveryPlansFailoverCommitSamples.java | 23 + .../ReplicationRecoveryPlansGetSamples.java | 23 + .../ReplicationRecoveryPlansListSamples.java | 23 + ...onRecoveryPlansPlannedFailoverSamples.java | 40 + ...licationRecoveryPlansReprotectSamples.java | 23 + ...nRecoveryPlansTestFailoverCleanupSamp.java | 34 + ...ationRecoveryPlansTestFailoverSamples.java | 43 + ...RecoveryPlansUnplannedFailoverSamples.java | 42 + ...ReplicationRecoveryPlansUpdateSamples.java | 73 + ...nRecoveryServicesProvidersCreateSampl.java | 45 + ...nRecoveryServicesProvidersDeleteSampl.java | 28 + ...onRecoveryServicesProvidersGetSamples.java | 26 + ...nRecoveryServicesProvidersListByRepli.java | 25 + ...nRecoveryServicesProvidersListSamples.java | 23 + ...RecoveryServicesProvidersPurgeSamples.java | 25 + ...nRecoveryServicesProvidersRefreshProv.java | 26 + ...nStorageClassificationMappingsCreateS.java | 35 + ...nStorageClassificationMappingsDeleteS.java | 31 + ...nStorageClassificationMappingsGetSamp.java | 31 + ...nStorageClassificationMappingsListByR.java | 30 + ...nStorageClassificationMappingsListSam.java | 23 + ...ationStorageClassificationsGetSamples.java | 30 + ...nStorageClassificationsListByReplicat.java | 29 + ...tionStorageClassificationsListSamples.java | 23 + .../ReplicationVaultHealthGetSamples.java | 23 + .../ReplicationVaultHealthRefreshSamples.java | 23 + .../ReplicationVaultSettingCreateSamples.java | 32 + .../ReplicationVaultSettingGetSamples.java | 23 + .../ReplicationVaultSettingListSamples.java | 23 + .../ReplicationvCentersCreateSamples.java | 33 + .../ReplicationvCentersDeleteSamples.java | 23 + .../ReplicationvCentersGetSamples.java | 25 + ...nvCentersListByReplicationFabricsSamp.java | 25 + .../ReplicationvCentersListSamples.java | 23 + .../ReplicationvCentersUpdateSamples.java | 30 + ...edOperatingSystemsOperationGetSamples.java | 23 + ...uteSizesListByReplicationProtectedIte.java | 31 + sdk/recoveryservicessiterecovery/ci.yml | 47 + sdk/recoveryservicessiterecovery/pom.xml | 15 + 880 files changed, 161975 insertions(+) create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/CHANGELOG.md create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/README.md create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/SAMPLE.md create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/SiteRecoveryManager.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/MigrationRecoveryPointsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/OperationsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/RecoveryPointsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationAlertSettingsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationAppliancesClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEligibilityResultsOperationsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEventsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationFabricsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationJobsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationLogicalNetworksClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationMigrationItemsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworkMappingsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworksClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationPoliciesClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectableItemsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectedItemsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainerMappingsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainersClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionIntentsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryPlansClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryServicesProvidersClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationMappingsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultHealthsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultSettingsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationvCentersClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SiteRecoveryManagementClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SupportedOperatingSystemsOperationsClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/TargetComputeSizesClient.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/AlertInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/EventInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/FabricInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/JobInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/LogicalNetworkInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/MigrationItemInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/MigrationRecoveryPointInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/NetworkInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/NetworkMappingInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/OperationsDiscoveryInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/PolicyInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectableItemInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectionContainerInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectionContainerMappingInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryPlanInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryPointInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryServicesProviderInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationApplianceInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsCollectionInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationProtectedItemInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationProtectionIntentInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/StorageClassificationInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/StorageClassificationMappingInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/SupportedOperatingSystemsInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/TargetComputeSizeInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VCenterInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VaultHealthDetailsInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VaultSettingInner.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/package-info.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/package-info.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/AlertImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/EventImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/FabricImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/JobImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/LogicalNetworkImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationItemImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/NetworkImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/NetworkMappingImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsDiscoveryImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/PolicyImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectableItemImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectionContainerImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectionContainerMappingImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPlanImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryServicesProviderImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationApplianceImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAppliancesClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAppliancesImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsCollectionImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationFabricsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationFabricsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientBuilder.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/StorageClassificationImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/StorageClassificationMappingImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizeImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesClientImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/Utils.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VCenterImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VaultHealthDetailsImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VaultSettingImpl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/package-info.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AAddDisksInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AApplyRecoveryPointInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AContainerCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACreateProtectionIntentInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationApplyRecoveryPointInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationContainerCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationEnableProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationPolicyCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEnableProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AExtendedLocationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedManagedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionContainerMappingDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentDiskInputDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentManagedDiskInputDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARecoveryAvailabilityType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARecoveryPointDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARemoveDisksInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationIntentDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReprotectInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARpRecoveryPointType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ASwitchProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ATestFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnplannedFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnprotectedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateReplicationProtectedItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmDiskInputDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskInputDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskUpdateDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AZoneDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddVCenterRequest.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddVCenterRequestProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentAutoUpdateStatus.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentUpgradeBlockedReason.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentVersionStatus.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Alert.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlertCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlertProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlternateLocationRecoveryOption.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplianceCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplianceSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AsrJobDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AsrTask.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutoProtectionOfDataDisk.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutomationAccountAuthenticationType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutomationRunbookTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureFabricCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureFabricSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureCreateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureNetworkMappingSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureUpdateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureVmSyncedConfigDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureVmDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ComputeSizeErrorDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigurationSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigureAlertRequest.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigureAlertRequestProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConsistencyCheckTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreatePolicyInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreatePolicyInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerMappingInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProviderSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CriticalJobHistoryDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentJobDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentScenarioDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DataStore.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DataSyncStatus.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionReason.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiscoverProtectableItemRequest.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiscoverProtectableItemRequestProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskAccountType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskEncryptionInfo.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskEncryptionKeyInfo.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskReplicationProgressHealth.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskVolumeDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Display.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DraDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EncryptionDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EthernetAddressType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Event.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProviderSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingProtectionProfile.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryAvailabilitySet.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryProximityPlacementGroup.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryResourceGroup.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryVirtualNetwork.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingStorageAccount.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExportJobDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExportJobOutputSerializationType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExtendedLocation.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExtendedLocationType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Fabric.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCreationInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricReplicationGroupTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificCreateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificUpdateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverDeploymentModel.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverJobDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverProcessServerRequest.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverProcessServerRequestProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverReplicationProtectedItemDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/GroupTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthError.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCategory.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCustomerResolvability.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorSummary.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVHostDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplica2012EventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplica2012R2EventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureApplyRecoveryPointInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureDiskInputDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEnableProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureFailbackProviderInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureManagedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePlannedFailoverProviderInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureReprotectInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureRpRecoveryPointType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureTestFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUnplannedFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBaseEventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBasePolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBaseReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBlueReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVSiteDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVVirtualMachineDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAgentDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ApplyRecoveryPointInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2DiskInputDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EnableProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ManagedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ProtectedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2RecoveryPointDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReprotectInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderBlockingErrorDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2TestFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UnplannedFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UpdateReplicationProtectedItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageBasePolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDisableProtectionProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskExclusionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskSignatureExclusionOptions.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageEnableProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageFabricSwitchProviderBlockingErrorDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageProtectedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmAgentUpgradeBlockingErrorDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplianceDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplianceSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplyRecoveryPointInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDiscoveredProtectedVmDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDiskInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDisksDefaultInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEnableProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricSwitchProviderBlockingErrorDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackDiscoveredProtectedVmDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackEventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackMobilityAgentDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackNicDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPlannedFailoverProviderInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPolicyCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackProtectedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackRecoveryPointType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackReprotectInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackSyncDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmLastAgentUpgradeErrorDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmMobilityAgentDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmProtectedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmProtectionContainerMappingDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmRecoveryPointDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmReprotectInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmSyncDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmTestFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUnplannedFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateReplicationProtectedItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReprotectInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageTestFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageUnplannedFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageV2RpRecoveryPointType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageVolumeExclusionOptions.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InconsistentVmDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InitialReplicationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InlineWorkflowTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InnerHealthError.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InputEndpoint.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfigDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfigInputDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Job.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobEntity.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobErrorDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobQueryParameter.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobStatusEventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/KeyEncryptionKeyInfo.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LicenseType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetwork.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetworkCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetworkProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ManualActionTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MarsAgentDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MasterTargetServer.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItem.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemOperation.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationProviderSpecificSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPoint.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPoints.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationState.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MobilityAgentUpgradeState.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MobilityServiceUpdate.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmGroupCreateOption.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmSyncPointOption.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Network.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMapping.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingFabricSpecificSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewProtectionProfile.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewRecoveryVirtualNetwork.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSVersionWrapper.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Operations.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OperationsDiscovery.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OperationsDiscoveryCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PauseReplicationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PauseReplicationInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverProviderSpecificFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverStatus.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Policy.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProviderSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PossibleOperationsDirections.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PresenceStatus.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServer.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServerDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItem.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItemCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItemProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainer.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerFabricSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMapping.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingProviderSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionHealth.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionProfileCustomDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderError.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderSpecificRecoveryPointDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PushInstallerDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmComponentStatus.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmProxyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryAvailabilitySetCustomDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlan.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2ADetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAction.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanActionDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanActionLocation.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAutomationRunbookActionDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroup.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailbackInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageAzureV2FailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageRcmFailbackFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageRcmFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanManualActionDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPointType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProtectedItem.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanScriptActionDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanShutdownGroupTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPoint.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointSyncType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPoints.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryProximityPlacementGroupCustomDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryResourceGroupCustomDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProvider.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProviderCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProviderProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryVirtualNetworkCustomDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveProtectionContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveProtectionContainerMappingInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RenewCertificateInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RenewCertificateInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAgentDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAlertSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAppliance.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationApplianceProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAppliances.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResults.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsErrorInfo.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsOperations.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEvents.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationFabrics.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationGroupDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationJobs.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationLogicalNetworks.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationMigrationItems.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworkMappings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworks.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationPolicies.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectableItems.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItem.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemOperation.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItems.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainerMappings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainers.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntent.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentProviderSpecificSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntents.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderContainerUnmappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificContainerCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryPlans.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryServicesProviders.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassificationMappings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassifications.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultHealths.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationvCenters.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReprotectAgentDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthError.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResourceHealthSummary.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeJobParams.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeJobParamsProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncState.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RetentionVolume.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RpInMageRecoveryPointType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RunAsAccount.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ScriptActionTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ServiceError.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SetMultiVmSyncStatus.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Severity.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SourceSiteOperations.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SqlServerLicenseType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageAccountCustomDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassification.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMapping.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageMappingInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Subnet.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSProperty.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOperatingSystems.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOperatingSystemsOperations.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionJobDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSize.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizeCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizeProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizes.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TaskTypeDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverCleanupInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverCleanupInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverJobDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateCleanupInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateCleanupInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrationState.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateDiskInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemProviderSpecificInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMobilityServiceRequest.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMobilityServiceRequestProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateNetworkMappingInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdatePolicyInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdatePolicyInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateProtectionContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateProtectionContainerMappingInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateRecoveryPlanInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateRecoveryPlanInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemProviderInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateVCenterRequest.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateVCenterRequestProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenter.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenterCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenterProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicInputDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtContainerCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtContainerMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtDiskInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtEnableMigrationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtEventDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrateInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrationDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtPolicyCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectedDiskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectionContainerMappingDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtResumeReplicationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtResyncInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtTestMigrateInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtUpdateDiskInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtUpdateMigrationItemInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricSpecificDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareVirtualMachineDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultHealthDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultHealthProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSetting.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCollection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInputProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingProperties.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VersionDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VirtualMachineTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmEncryptionType.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmNicUpdatesTaskDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmReplicationProgressHealth.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureCreateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureNetworkMappingSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureUpdateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmCreateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmNetworkMappingSettings.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmUpdateNetworkMappingInput.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmVirtualMachineDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmwareCbtPolicyDetails.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/package-info.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/package-info.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/module-info.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/OperationsListByResourceGroupSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAppliancesListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEventsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEventsListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsCheckConsistencySamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsDeleteSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsMigrateToAadSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsPurgeSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsReassociateGatewaySamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsRenewCertificateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsCancelSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsExportSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsRestartSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsResumeSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsDeleteSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsMigrateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResyncSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsUpdateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsDeleteSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsUpdateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesDeleteSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesUpdateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsAddDisksSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsDeleteSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPurgeSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRemoveDisksSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsReprotectSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDeleteSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansDeleteSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansFailoverCancelSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansFailoverCommitSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansReprotectSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUpdateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsCreateS.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsDeleteS.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsGetSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsListByR.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsListSam.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsListByReplicat.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultHealthGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultHealthRefreshSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersCreateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersDeleteSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersUpdateSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/SupportedOperatingSystemsOperationGetSamples.java create mode 100644 sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java create mode 100644 sdk/recoveryservicessiterecovery/ci.yml create mode 100644 sdk/recoveryservicessiterecovery/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 01bccc137fb7..bc5ca576aa31 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -388,6 +388,7 @@ com.azure.resourcemanager:azure-resourcemanager-elasticsan;1.0.0-beta.1;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-hybridcontainerservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securitydevops;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-appcomplianceautomation;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-recoveryservicessiterecovery;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-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index a261806d8ce1..e5df3f345580 100644 --- a/pom.xml +++ b/pom.xml @@ -136,6 +136,7 @@ sdk/quota sdk/recoveryservices sdk/recoveryservicesbackup + sdk/recoveryservicessiterecovery sdk/redisenterprise sdk/relay sdk/remoterendering diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/CHANGELOG.md b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/CHANGELOG.md new file mode 100644 index 000000000000..5f0cabf4712d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-12-09) + +- Azure Resource Manager SiteRecovery client library for Java. This package contains Microsoft Azure SDK for SiteRecovery Management SDK. Package tag package-2022-10. 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/README.md b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/README.md new file mode 100644 index 000000000000..6271aa16fe5d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/README.md @@ -0,0 +1,105 @@ +# Azure Resource Manager SiteRecovery client library for Java + +Azure Resource Manager SiteRecovery client library for Java. + +This package contains Microsoft Azure SDK for SiteRecovery Management SDK. Package tag package-2022-10. 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-recoveryservicessiterecovery;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-recoveryservicessiterecovery + 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, Azure Active Directory 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(); +SiteRecoveryManager manager = SiteRecoveryManager + .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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/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://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[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/ diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/SAMPLE.md b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/SAMPLE.md new file mode 100644 index 000000000000..cf2bb8862621 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/SAMPLE.md @@ -0,0 +1,4354 @@ +# Code snippets and samples + + +## MigrationRecoveryPoints + +- [Get](#migrationrecoverypoints_get) +- [ListByReplicationMigrationItems](#migrationrecoverypoints_listbyreplicationmigrationitems) + +## Operations + +- [ListByResourceGroup](#operations_listbyresourcegroup) + +## RecoveryPoints + +- [Get](#recoverypoints_get) +- [ListByReplicationProtectedItems](#recoverypoints_listbyreplicationprotecteditems) + +## ReplicationAlertSettings + +- [Create](#replicationalertsettings_create) +- [Get](#replicationalertsettings_get) +- [List](#replicationalertsettings_list) + +## ReplicationAppliances + +- [List](#replicationappliances_list) + +## ReplicationEligibilityResultsOperation + +- [Get](#replicationeligibilityresultsoperation_get) +- [List](#replicationeligibilityresultsoperation_list) + +## ReplicationEvents + +- [Get](#replicationevents_get) +- [List](#replicationevents_list) + +## ReplicationFabrics + +- [CheckConsistency](#replicationfabrics_checkconsistency) +- [Create](#replicationfabrics_create) +- [Delete](#replicationfabrics_delete) +- [Get](#replicationfabrics_get) +- [List](#replicationfabrics_list) +- [MigrateToAad](#replicationfabrics_migratetoaad) +- [Purge](#replicationfabrics_purge) +- [ReassociateGateway](#replicationfabrics_reassociategateway) +- [RenewCertificate](#replicationfabrics_renewcertificate) + +## ReplicationJobs + +- [Cancel](#replicationjobs_cancel) +- [Export](#replicationjobs_export) +- [Get](#replicationjobs_get) +- [List](#replicationjobs_list) +- [Restart](#replicationjobs_restart) +- [Resume](#replicationjobs_resume) + +## ReplicationLogicalNetworks + +- [Get](#replicationlogicalnetworks_get) +- [ListByReplicationFabrics](#replicationlogicalnetworks_listbyreplicationfabrics) + +## ReplicationMigrationItems + +- [Create](#replicationmigrationitems_create) +- [Delete](#replicationmigrationitems_delete) +- [Get](#replicationmigrationitems_get) +- [List](#replicationmigrationitems_list) +- [ListByReplicationProtectionContainers](#replicationmigrationitems_listbyreplicationprotectioncontainers) +- [Migrate](#replicationmigrationitems_migrate) +- [PauseReplication](#replicationmigrationitems_pausereplication) +- [ResumeReplication](#replicationmigrationitems_resumereplication) +- [Resync](#replicationmigrationitems_resync) +- [TestMigrate](#replicationmigrationitems_testmigrate) +- [TestMigrateCleanup](#replicationmigrationitems_testmigratecleanup) +- [Update](#replicationmigrationitems_update) + +## ReplicationNetworkMappings + +- [Create](#replicationnetworkmappings_create) +- [Delete](#replicationnetworkmappings_delete) +- [Get](#replicationnetworkmappings_get) +- [List](#replicationnetworkmappings_list) +- [ListByReplicationNetworks](#replicationnetworkmappings_listbyreplicationnetworks) +- [Update](#replicationnetworkmappings_update) + +## ReplicationNetworks + +- [Get](#replicationnetworks_get) +- [List](#replicationnetworks_list) +- [ListByReplicationFabrics](#replicationnetworks_listbyreplicationfabrics) + +## ReplicationPolicies + +- [Create](#replicationpolicies_create) +- [Delete](#replicationpolicies_delete) +- [Get](#replicationpolicies_get) +- [List](#replicationpolicies_list) +- [Update](#replicationpolicies_update) + +## ReplicationProtectableItems + +- [Get](#replicationprotectableitems_get) +- [ListByReplicationProtectionContainers](#replicationprotectableitems_listbyreplicationprotectioncontainers) + +## ReplicationProtectedItems + +- [AddDisks](#replicationprotecteditems_adddisks) +- [ApplyRecoveryPoint](#replicationprotecteditems_applyrecoverypoint) +- [Create](#replicationprotecteditems_create) +- [Delete](#replicationprotecteditems_delete) +- [FailoverCancel](#replicationprotecteditems_failovercancel) +- [FailoverCommit](#replicationprotecteditems_failovercommit) +- [Get](#replicationprotecteditems_get) +- [List](#replicationprotecteditems_list) +- [ListByReplicationProtectionContainers](#replicationprotecteditems_listbyreplicationprotectioncontainers) +- [PlannedFailover](#replicationprotecteditems_plannedfailover) +- [Purge](#replicationprotecteditems_purge) +- [RemoveDisks](#replicationprotecteditems_removedisks) +- [RepairReplication](#replicationprotecteditems_repairreplication) +- [Reprotect](#replicationprotecteditems_reprotect) +- [ResolveHealthErrors](#replicationprotecteditems_resolvehealtherrors) +- [SwitchProvider](#replicationprotecteditems_switchprovider) +- [TestFailover](#replicationprotecteditems_testfailover) +- [TestFailoverCleanup](#replicationprotecteditems_testfailovercleanup) +- [UnplannedFailover](#replicationprotecteditems_unplannedfailover) +- [Update](#replicationprotecteditems_update) +- [UpdateAppliance](#replicationprotecteditems_updateappliance) +- [UpdateMobilityService](#replicationprotecteditems_updatemobilityservice) + +## ReplicationProtectionContainerMappings + +- [Create](#replicationprotectioncontainermappings_create) +- [Delete](#replicationprotectioncontainermappings_delete) +- [Get](#replicationprotectioncontainermappings_get) +- [List](#replicationprotectioncontainermappings_list) +- [ListByReplicationProtectionContainers](#replicationprotectioncontainermappings_listbyreplicationprotectioncontainers) +- [Purge](#replicationprotectioncontainermappings_purge) +- [Update](#replicationprotectioncontainermappings_update) + +## ReplicationProtectionContainers + +- [Create](#replicationprotectioncontainers_create) +- [Delete](#replicationprotectioncontainers_delete) +- [DiscoverProtectableItem](#replicationprotectioncontainers_discoverprotectableitem) +- [Get](#replicationprotectioncontainers_get) +- [List](#replicationprotectioncontainers_list) +- [ListByReplicationFabrics](#replicationprotectioncontainers_listbyreplicationfabrics) +- [SwitchProtection](#replicationprotectioncontainers_switchprotection) + +## ReplicationProtectionIntents + +- [Create](#replicationprotectionintents_create) +- [Get](#replicationprotectionintents_get) +- [List](#replicationprotectionintents_list) + +## ReplicationRecoveryPlans + +- [Create](#replicationrecoveryplans_create) +- [Delete](#replicationrecoveryplans_delete) +- [FailoverCancel](#replicationrecoveryplans_failovercancel) +- [FailoverCommit](#replicationrecoveryplans_failovercommit) +- [Get](#replicationrecoveryplans_get) +- [List](#replicationrecoveryplans_list) +- [PlannedFailover](#replicationrecoveryplans_plannedfailover) +- [Reprotect](#replicationrecoveryplans_reprotect) +- [TestFailover](#replicationrecoveryplans_testfailover) +- [TestFailoverCleanup](#replicationrecoveryplans_testfailovercleanup) +- [UnplannedFailover](#replicationrecoveryplans_unplannedfailover) +- [Update](#replicationrecoveryplans_update) + +## ReplicationRecoveryServicesProviders + +- [Create](#replicationrecoveryservicesproviders_create) +- [Delete](#replicationrecoveryservicesproviders_delete) +- [Get](#replicationrecoveryservicesproviders_get) +- [List](#replicationrecoveryservicesproviders_list) +- [ListByReplicationFabrics](#replicationrecoveryservicesproviders_listbyreplicationfabrics) +- [Purge](#replicationrecoveryservicesproviders_purge) +- [RefreshProvider](#replicationrecoveryservicesproviders_refreshprovider) + +## ReplicationStorageClassificationMappings + +- [Create](#replicationstorageclassificationmappings_create) +- [Delete](#replicationstorageclassificationmappings_delete) +- [Get](#replicationstorageclassificationmappings_get) +- [List](#replicationstorageclassificationmappings_list) +- [ListByReplicationStorageClassifications](#replicationstorageclassificationmappings_listbyreplicationstorageclassifications) + +## ReplicationStorageClassifications + +- [Get](#replicationstorageclassifications_get) +- [List](#replicationstorageclassifications_list) +- [ListByReplicationFabrics](#replicationstorageclassifications_listbyreplicationfabrics) + +## ReplicationVaultHealth + +- [Get](#replicationvaulthealth_get) +- [Refresh](#replicationvaulthealth_refresh) + +## ReplicationVaultSetting + +- [Create](#replicationvaultsetting_create) +- [Get](#replicationvaultsetting_get) +- [List](#replicationvaultsetting_list) + +## ReplicationvCenters + +- [Create](#replicationvcenters_create) +- [Delete](#replicationvcenters_delete) +- [Get](#replicationvcenters_get) +- [List](#replicationvcenters_list) +- [ListByReplicationFabrics](#replicationvcenters_listbyreplicationfabrics) +- [Update](#replicationvcenters_update) + +## SupportedOperatingSystemsOperation + +- [Get](#supportedoperatingsystemsoperation_get) + +## TargetComputeSizes + +- [ListByReplicationProtectedItems](#targetcomputesizes_listbyreplicationprotecteditems) +### MigrationRecoveryPoints_Get + +```java +import com.azure.core.util.Context; + +/** Samples for MigrationRecoveryPoints Get. */ +public final class MigrationRecoveryPointsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_Get.json + */ + /** + * Sample code: Gets a recovery point for a migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsARecoveryPointForAMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .migrationRecoveryPoints() + .getWithResponse( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + "b22134ea-620c-474b-9fa5-3c1cb47708e3", + Context.NONE); + } +} +``` + +### MigrationRecoveryPoints_ListByReplicationMigrationItems + +```java +import com.azure.core.util.Context; + +/** Samples for MigrationRecoveryPoints ListByReplicationMigrationItems. */ +public final class MigrationRecoveryPointsListByReplicationMigrati { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json + */ + /** + * Sample code: Gets the recovery points for a migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheRecoveryPointsForAMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .migrationRecoveryPoints() + .listByReplicationMigrationItems( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + Context.NONE); + } +} +``` + +### Operations_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Operations ListByResourceGroup. */ +public final class OperationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/Operations_List.json + */ + /** + * Sample code: Returns the list of available operations. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void returnsTheListOfAvailableOperations( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.operations().listByResourceGroup("resourceGroupPS1", Context.NONE); + } +} +``` + +### RecoveryPoints_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RecoveryPoints Get. */ +public final class RecoveryPointsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_Get.json + */ + /** + * Sample code: Gets a recovery point. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsARecoveryPoint( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .recoveryPoints() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + "b22134ea-620c-474b-9fa5-3c1cb47708e3", + Context.NONE); + } +} +``` + +### RecoveryPoints_ListByReplicationProtectedItems + +```java +import com.azure.core.util.Context; + +/** Samples for RecoveryPoints ListByReplicationProtectedItems. */ +public final class RecoveryPointsListByReplicationProtectedItemsSa { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json + */ + /** + * Sample code: Gets the list of recovery points for a replication protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRecoveryPointsForAReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .recoveryPoints() + .listByReplicationProtectedItems( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} +``` + +### ReplicationAlertSettings_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties; +import java.util.Arrays; + +/** Samples for ReplicationAlertSettings Create. */ +public final class ReplicationAlertSettingsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Create.json + */ + /** + * Sample code: Configures email notifications for this vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void configuresEmailNotificationsForThisVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationAlertSettings() + .define("defaultAlertSetting") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new ConfigureAlertRequestProperties() + .withSendToOwners("false") + .withCustomEmailAddresses(Arrays.asList("ronehr@microsoft.com")) + .withLocale("")) + .create(); + } +} +``` + +### ReplicationAlertSettings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationAlertSettings Get. */ +public final class ReplicationAlertSettingsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Get.json + */ + /** + * Sample code: Gets an email notification(alert) configuration. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAnEmailNotificationAlertConfiguration( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationAlertSettings() + .getWithResponse("vault1", "resourceGroupPS1", "defaultAlertSetting", Context.NONE); + } +} +``` + +### ReplicationAlertSettings_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationAlertSettings List. */ +public final class ReplicationAlertSettingsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_List.json + */ + /** + * Sample code: Gets the list of configured email notification(alert) configurations. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfConfiguredEmailNotificationAlertConfigurations( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationAlertSettings().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationAppliances_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationAppliances List. */ +public final class ReplicationAppliancesListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAppliances_List.json + */ + /** + * Sample code: Gets the list of appliances. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfAppliances( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationAppliances().list("vault1", "resourceGroupPS1", null, Context.NONE); + } +} +``` + +### ReplicationEligibilityResultsOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationEligibilityResultsOperation Get. */ +public final class ReplicationEligibilityResultsOperationGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_Get.json + */ + /** + * Sample code: Gets the validation errors in case the VM is unsuitable for protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationEligibilityResultsOperations().getWithResponse("testRg1", "testVm1", Context.NONE); + } +} +``` + +### ReplicationEligibilityResultsOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationEligibilityResultsOperation List. */ +public final class ReplicationEligibilityResultsOperationListSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_List.json + */ + /** + * Sample code: Gets the validation errors in case the VM is unsuitable for protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationEligibilityResultsOperations().listWithResponse("testRg1", "testVm2", Context.NONE); + } +} +``` + +### ReplicationEvents_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationEvents Get. */ +public final class ReplicationEventsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_Get.json + */ + /** + * Sample code: Get the details of an Azure Site recovery event. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getTheDetailsOfAnAzureSiteRecoveryEvent( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationEvents() + .getWithResponse("vault1", "resourceGroupPS1", "654b71d0-b2ce-4e6e-a861-98528d4bd375", Context.NONE); + } +} +``` + +### ReplicationEvents_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationEvents List. */ +public final class ReplicationEventsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_List.json + */ + /** + * Sample code: Gets the list of Azure Site Recovery events. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfAzureSiteRecoveryEvents( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationEvents().list("vault1", "resourceGroupPS1", null, Context.NONE); + } +} +``` + +### ReplicationFabrics_CheckConsistency + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics CheckConsistency. */ +public final class ReplicationFabricsCheckConsistencySamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_CheckConsistency.json + */ + /** + * Sample code: Checks the consistency of the ASR fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void checksTheConsistencyOfTheASRFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().checkConsistency("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} +``` + +### ReplicationFabrics_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificCreationInput; + +/** Samples for ReplicationFabrics Create. */ +public final class ReplicationFabricsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Create.json + */ + /** + * Sample code: Creates an Azure Site Recovery fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createsAnAzureSiteRecoveryFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationFabrics() + .define("cloud1") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties(new FabricCreationInputProperties().withCustomDetails(new FabricSpecificCreationInput())) + .create(); + } +} +``` + +### ReplicationFabrics_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics Delete. */ +public final class ReplicationFabricsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Delete.json + */ + /** + * Sample code: Deletes the site. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deletesTheSite( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().delete("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} +``` + +### ReplicationFabrics_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics Get. */ +public final class ReplicationFabricsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Get.json + */ + /** + * Sample code: Gets the details of an ASR fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAnASRFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().getWithResponse("vault1", "resourceGroupPS1", "cloud1", null, Context.NONE); + } +} +``` + +### ReplicationFabrics_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics List. */ +public final class ReplicationFabricsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_List.json + */ + /** + * Sample code: Gets the list of ASR fabrics. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfASRFabrics( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationFabrics_MigrateToAad + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics MigrateToAad. */ +public final class ReplicationFabricsMigrateToAadSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_MigrateToAad.json + */ + /** + * Sample code: Migrates the site to AAD. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void migratesTheSiteToAAD( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().migrateToAad("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} +``` + +### ReplicationFabrics_Purge + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics Purge. */ +public final class ReplicationFabricsPurgeSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Purge.json + */ + /** + * Sample code: Purges the site. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgesTheSite( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().purge("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} +``` + +### ReplicationFabrics_ReassociateGateway + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequestProperties; +import java.util.Arrays; + +/** Samples for ReplicationFabrics ReassociateGateway. */ +public final class ReplicationFabricsReassociateGatewaySamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_ReassociateGateway.json + */ + /** + * Sample code: Perform failover of the process server. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void performFailoverOfTheProcessServer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationFabrics() + .reassociateGateway( + "MadhaviVault", + "MadhaviVRG", + "GRACE-V2A-1", + new FailoverProcessServerRequest() + .withProperties( + new FailoverProcessServerRequestProperties() + .withContainerName("cloud_1f3c15af-2256-4568-9e06-e1ef4f728f75") + .withSourceProcessServerId("AFA0EC54-1894-4E44-9CAB02DB8854B117") + .withTargetProcessServerId("5D3ED340-85AE-C646-B338641E015DA405") + .withVmsToMigrate(Arrays.asList("Vm1", "Vm2")) + .withUpdateType("ServerLevel")), + Context.NONE); + } +} +``` + +### ReplicationFabrics_RenewCertificate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInputProperties; + +/** Samples for ReplicationFabrics RenewCertificate. */ +public final class ReplicationFabricsRenewCertificateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_RenewCertificate.json + */ + /** + * Sample code: Renews certificate for the fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void renewsCertificateForTheFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationFabrics() + .renewCertificate( + "vault1", + "resourceGroupPS1", + "cloud1", + new RenewCertificateInput() + .withProperties(new RenewCertificateInputProperties().withRenewCertificateType("Cloud")), + Context.NONE); + } +} +``` + +### ReplicationJobs_Cancel + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationJobs Cancel. */ +public final class ReplicationJobsCancelSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Cancel.json + */ + /** + * Sample code: Cancels the specified job. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void cancelsTheSpecifiedJob( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .cancel("vault1", "resourceGroupPS1", "2653c648-fc72-4316-86f3-fdf8eaa0066b", Context.NONE); + } +} +``` + +### ReplicationJobs_Export + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobQueryParameter; + +/** Samples for ReplicationJobs Export. */ +public final class ReplicationJobsExportSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Export.json + */ + /** + * Sample code: Exports the details of the Azure Site Recovery jobs of the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void exportsTheDetailsOfTheAzureSiteRecoveryJobsOfTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .export( + "vault1", + "resourceGroupPS1", + new JobQueryParameter() + .withStartTime("2017-04-27T14:26:51.9161395Z") + .withEndTime("2017-05-04T14:26:51.9161395Z") + .withAffectedObjectTypes("") + .withJobStatus(""), + Context.NONE); + } +} +``` + +### ReplicationJobs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationJobs Get. */ +public final class ReplicationJobsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Get.json + */ + /** + * Sample code: Gets the job details. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheJobDetails( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .getWithResponse("vault1", "resourceGroupPS1", "58776d0b-3141-48b2-a377-9ad863eb160d", Context.NONE); + } +} +``` + +### ReplicationJobs_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationJobs List. */ +public final class ReplicationJobsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_List.json + */ + /** + * Sample code: Gets the list of jobs. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfJobs( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationJobs().list("vault1", "resourceGroupPS1", null, Context.NONE); + } +} +``` + +### ReplicationJobs_Restart + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationJobs Restart. */ +public final class ReplicationJobsRestartSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Restart.json + */ + /** + * Sample code: Restarts the specified job. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void restartsTheSpecifiedJob( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .restart("vault1", "resourceGroupPS1", "0664564c-353e-401a-ab0c-722257c10e25", Context.NONE); + } +} +``` + +### ReplicationJobs_Resume + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParams; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParamsProperties; + +/** Samples for ReplicationJobs Resume. */ +public final class ReplicationJobsResumeSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Resume.json + */ + /** + * Sample code: Resumes the specified job. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resumesTheSpecifiedJob( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .resume( + "vault1", + "resourceGroupPS1", + "58776d0b-3141-48b2-a377-9ad863eb160d", + new ResumeJobParams().withProperties(new ResumeJobParamsProperties().withComments(" ")), + Context.NONE); + } +} +``` + +### ReplicationLogicalNetworks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationLogicalNetworks Get. */ +public final class ReplicationLogicalNetworksGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_Get.json + */ + /** + * Sample code: Gets a logical network with specified server id and logical network name. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationLogicalNetworks() + .getWithResponse( + "vault1", "resourceGroupPS1", "cloud1", "87ab394f-165f-4aa9-bd84-b018500b4509", Context.NONE); + } +} +``` + +### ReplicationLogicalNetworks_ListByReplicationFabrics + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationLogicalNetworks ListByReplicationFabrics. */ +public final class ReplicationLogicalNetworksListByReplicationFabr { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of logical networks under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfLogicalNetworksUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationLogicalNetworks() + .listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} +``` + +### ReplicationMigrationItems_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtDiskInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtEnableMigrationInput; +import java.util.Arrays; + +/** Samples for ReplicationMigrationItems Create. */ +public final class ReplicationMigrationItemsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Create.json + */ + /** + * Sample code: Enables migration. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void enablesMigration( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .define("virtualmachine1") + .withExistingReplicationProtectionContainer( + "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1") + .withProperties( + new EnableMigrationInputProperties() + .withPolicyId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1") + .withProviderSpecificDetails( + new VMwareCbtEnableMigrationInput() + .withVmwareMachineId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/machines/virtualmachine1") + .withDisksToInclude( + Arrays + .asList( + new VMwareCbtDiskInput() + .withDiskId("disk1") + .withIsOSDisk("true") + .withLogStorageAccountId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Storage/storageAccounts/logStorageAccount1") + .withLogStorageAccountSasSecretName("fakeTokenPlaceholder"))) + .withDataMoverRunAsAccountId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/dataMoverRunAsAccount1") + .withSnapshotRunAsAccountId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/snapshotRunAsAccount1") + .withTargetResourceGroupId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1") + .withTargetNetworkId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1"))) + .create(); + } +} +``` + +### ReplicationMigrationItems_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationMigrationItems Delete. */ +public final class ReplicationMigrationItemsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Delete.json + */ + /** + * Sample code: Delete the migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deleteTheMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .delete( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + null, + Context.NONE); + } +} +``` + +### ReplicationMigrationItems_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationMigrationItems Get. */ +public final class ReplicationMigrationItemsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Get.json + */ + /** + * Sample code: Gets the details of a migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .getWithResponse( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + Context.NONE); + } +} +``` + +### ReplicationMigrationItems_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationMigrationItems List. */ +public final class ReplicationMigrationItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_List.json + */ + /** + * Sample code: Gets the list of migration items in the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfMigrationItemsInTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationMigrationItems().list("migrationvault", "resourcegroup1", null, null, null, Context.NONE); + } +} +``` + +### ReplicationMigrationItems_ListByReplicationProtectionContainers + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationMigrationItems ListByReplicationProtectionContainers. */ +public final class ReplicationMigrationItemsListByReplicationProte { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of migration items in the protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfMigrationItemsInTheProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .listByReplicationProtectionContainers( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + null, + null, + null, + Context.NONE); + } +} +``` + +### ReplicationMigrationItems_Migrate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtMigrateInput; + +/** Samples for ReplicationMigrationItems Migrate. */ +public final class ReplicationMigrationItemsMigrateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Migrate.json + */ + /** + * Sample code: Migrate item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void migrateItem(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .migrate( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new MigrateInput() + .withProperties( + new MigrateInputProperties() + .withProviderSpecificDetails(new VMwareCbtMigrateInput().withPerformShutdown("true"))), + Context.NONE); + } +} +``` + +### ReplicationMigrationItems_PauseReplication + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInputProperties; + +/** Samples for ReplicationMigrationItems PauseReplication. */ +public final class ReplicationMigrationItemsPauseReplicationSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_PauseReplication.json + */ + /** + * Sample code: Pause replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void pauseReplication( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .pauseReplication( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new PauseReplicationInput() + .withProperties(new PauseReplicationInputProperties().withInstanceType("VMwareCbt")), + Context.NONE); + } +} +``` + +### ReplicationMigrationItems_ResumeReplication + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResumeReplicationInput; + +/** Samples for ReplicationMigrationItems ResumeReplication. */ +public final class ReplicationMigrationItemsResumeReplicationSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ResumeReplication.json + */ + /** + * Sample code: Resume replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resumeReplication( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .resumeReplication( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new ResumeReplicationInput() + .withProperties( + new ResumeReplicationInputProperties() + .withProviderSpecificDetails( + new VMwareCbtResumeReplicationInput().withDeleteMigrationResources("false"))), + Context.NONE); + } +} +``` + +### ReplicationMigrationItems_Resync + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResyncInput; + +/** Samples for ReplicationMigrationItems Resync. */ +public final class ReplicationMigrationItemsResyncSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Resync.json + */ + /** + * Sample code: Resynchronizes replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resynchronizesReplication( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .resync( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new ResyncInput() + .withProperties( + new ResyncInputProperties() + .withProviderSpecificDetails(new VMwareCbtResyncInput().withSkipCbtReset("true"))), + Context.NONE); + } +} +``` + +### ReplicationMigrationItems_TestMigrate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtTestMigrateInput; + +/** Samples for ReplicationMigrationItems TestMigrate. */ +public final class ReplicationMigrationItemsTestMigrateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrate.json + */ + /** + * Sample code: Test migrate item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void testMigrateItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .testMigrate( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new TestMigrateInput() + .withProperties( + new TestMigrateInputProperties() + .withProviderSpecificDetails( + new VMwareCbtTestMigrateInput() + .withRecoveryPointId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/9e737191-317e-43d0-8c83-e32ac3b34686") + .withNetworkId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1"))), + Context.NONE); + } +} +``` + +### ReplicationMigrationItems_TestMigrateCleanup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInputProperties; + +/** Samples for ReplicationMigrationItems TestMigrateCleanup. */ +public final class ReplicationMigrationItemsTestMigrateCleanupSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json + */ + /** + * Sample code: Test migrate cleanup. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void testMigrateCleanup( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .testMigrateCleanup( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new TestMigrateCleanupInput() + .withProperties(new TestMigrateCleanupInputProperties().withComments("Test Failover Cleanup")), + Context.NONE); + } +} +``` + +### ReplicationMigrationItems_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtUpdateMigrationItemInput; + +/** Samples for ReplicationMigrationItems Update. */ +public final class ReplicationMigrationItemsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Update.json + */ + /** + * Sample code: Updates migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + MigrationItem resource = + manager + .replicationMigrationItems() + .getWithResponse( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateMigrationItemInputProperties() + .withProviderSpecificDetails(new VMwareCbtUpdateMigrationItemInput())) + .apply(); + } +} +``` + +### ReplicationNetworkMappings_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureCreateNetworkMappingInput; + +/** Samples for ReplicationNetworkMappings Create. */ +public final class ReplicationNetworkMappingsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Create.json + */ + /** + * Sample code: Creates network mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createsNetworkMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworkMappings() + .define("corpe2amap") + .withExistingReplicationNetwork( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06") + .withProperties( + new CreateNetworkMappingInputProperties() + .withRecoveryFabricName("Microsoft Azure") + .withRecoveryNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai") + .withFabricSpecificDetails(new VmmToAzureCreateNetworkMappingInput())) + .create(); + } +} +``` + +### ReplicationNetworkMappings_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworkMappings Delete. */ +public final class ReplicationNetworkMappingsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Delete.json + */ + /** + * Sample code: Delete network mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deleteNetworkMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworkMappings() + .delete( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06", + "corpe2amap", + Context.NONE); + } +} +``` + +### ReplicationNetworkMappings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworkMappings Get. */ +public final class ReplicationNetworkMappingsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Get.json + */ + /** + * Sample code: Gets network mapping by name. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsNetworkMappingByName( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworkMappings() + .getWithResponse( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06", + "corpe2amap", + Context.NONE); + } +} +``` + +### ReplicationNetworkMappings_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworkMappings List. */ +public final class ReplicationNetworkMappingsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_List.json + */ + /** + * Sample code: Gets all the network mappings under a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAllTheNetworkMappingsUnderAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationNetworkMappings().list("srce2avaultbvtaC27", "srcBvte2a14C27", Context.NONE); + } +} +``` + +### ReplicationNetworkMappings_ListByReplicationNetworks + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworkMappings ListByReplicationNetworks. */ +public final class ReplicationNetworkMappingsListByReplicationNetw { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json + */ + /** + * Sample code: Gets all the network mappings under a network. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAllTheNetworkMappingsUnderANetwork( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworkMappings() + .listByReplicationNetworks( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06", + Context.NONE); + } +} +``` + +### ReplicationNetworkMappings_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureUpdateNetworkMappingInput; + +/** Samples for ReplicationNetworkMappings Update. */ +public final class ReplicationNetworkMappingsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Update.json + */ + /** + * Sample code: Updates network mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesNetworkMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + NetworkMapping resource = + manager + .replicationNetworkMappings() + .getWithResponse( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06", + "corpe2amap", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateNetworkMappingInputProperties() + .withRecoveryFabricName("Microsoft Azure") + .withRecoveryNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai2") + .withFabricSpecificDetails(new VmmToAzureUpdateNetworkMappingInput())) + .apply(); + } +} +``` + +### ReplicationNetworks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworks Get. */ +public final class ReplicationNetworksGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_Get.json + */ + /** + * Sample code: Gets a network with specified server id and network name. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsANetworkWithSpecifiedServerIdAndNetworkName( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworks() + .getWithResponse( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "93ce99d7-1219-4914-aa61-73fe5023988e", + Context.NONE); + } +} +``` + +### ReplicationNetworks_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworks List. */ +public final class ReplicationNetworksListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_List.json + */ + /** + * Sample code: Gets the list of networks. View-only API. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfNetworksViewOnlyAPI( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationNetworks().list("srce2avaultbvtaC27", "srcBvte2a14C27", Context.NONE); + } +} +``` + +### ReplicationNetworks_ListByReplicationFabrics + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworks ListByReplicationFabrics. */ +public final class ReplicationNetworksListByReplicationFabricsSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of networks under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfNetworksUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworks() + .listByReplicationFabrics( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + Context.NONE); + } +} +``` + +### ReplicationPolicies_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePolicyInput; + +/** Samples for ReplicationPolicies Create. */ +public final class ReplicationPoliciesCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Create.json + */ + /** + * Sample code: Creates the policy. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createsThePolicy( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationPolicies() + .define("protectionprofile1") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new CreatePolicyInputProperties().withProviderSpecificInput(new HyperVReplicaAzurePolicyInput())) + .create(); + } +} +``` + +### ReplicationPolicies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationPolicies Delete. */ +public final class ReplicationPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Delete.json + */ + /** + * Sample code: Delete the policy. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deleteThePolicy( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationPolicies().delete("vault1", "resourceGroupPS1", "protectionprofile1", Context.NONE); + } +} +``` + +### ReplicationPolicies_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationPolicies Get. */ +public final class ReplicationPoliciesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Get.json + */ + /** + * Sample code: Gets the requested policy. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheRequestedPolicy( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationPolicies().getWithResponse("vault1", "resourceGroupPS1", "protectionprofile1", Context.NONE); + } +} +``` + +### ReplicationPolicies_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationPolicies List. */ +public final class ReplicationPoliciesListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_List.json + */ + /** + * Sample code: Gets the list of replication policies. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfReplicationPolicies( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationPolicies().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationPolicies_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePolicyInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Policy; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInputProperties; + +/** Samples for ReplicationPolicies Update. */ +public final class ReplicationPoliciesUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Update.json + */ + /** + * Sample code: Updates the policy. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesThePolicy( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + Policy resource = + manager + .replicationPolicies() + .getWithResponse("vault1", "resourceGroupPS1", "protectionprofile1", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdatePolicyInputProperties().withReplicationProviderSettings(new HyperVReplicaAzurePolicyInput())) + .apply(); + } +} +``` + +### ReplicationProtectableItems_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectableItems Get. */ +public final class ReplicationProtectableItemsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_Get.json + */ + /** + * Sample code: Gets the details of a protectable item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAProtectableItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectableItems() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "c0c14913-3d7a-48ea-9531-cc99e0e686e6", + Context.NONE); + } +} +``` + +### ReplicationProtectableItems_ListByReplicationProtectionContainers + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectableItems ListByReplicationProtectionContainers. */ +public final class ReplicationProtectableItemsListByReplicationPro { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of protectable items. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfProtectableItems( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectableItems() + .listByReplicationProtectionContainers( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + null, + null, + null, + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_AddDisks + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AAddDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AVmDiskInputDetails; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationProtectedItems AddDisks. */ +public final class ReplicationProtectedItemsAddDisksSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_AddDisks.json + */ + /** + * Sample code: Add disk(s) for protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addDiskSForProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .addDisks( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new AddDisksInput() + .withProperties( + new AddDisksInputProperties() + .withProviderSpecificDetails( + new A2AAddDisksInput() + .withVmDisks( + Arrays + .asList( + new A2AVmDiskInputDetails() + .withDiskUri( + "https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd") + .withRecoveryAzureStorageAccountId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/recoveryResource/providers/Microsoft.Storage/storageAccounts/recoverystorage") + .withPrimaryStagingAzureStorageAccountId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/primaryResource/providers/Microsoft.Storage/storageAccounts/vmcachestorage"))))), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_ApplyRecoveryPoint + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureApplyRecoveryPointInput; + +/** Samples for ReplicationProtectedItems ApplyRecoveryPoint. */ +public final class ReplicationProtectedItemsApplyRecoveryPointSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json + */ + /** + * Sample code: Change or apply recovery point. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void changeOrApplyRecoveryPoint( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .applyRecoveryPoint( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new ApplyRecoveryPointInput() + .withProperties( + new ApplyRecoveryPointInputProperties() + .withRecoveryPointId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/e4d05fe9-5dfd-47be-b50b-aad306b2802d") + .withProviderSpecificDetails(new HyperVReplicaAzureApplyRecoveryPointInput())), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureEnableProtectionInput; + +/** Samples for ReplicationProtectedItems Create. */ +public final class ReplicationProtectedItemsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Create.json + */ + /** + * Sample code: Enables protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void enablesProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .define("f8491e4f-817a-40dd-a90c-af773978c75b") + .withExistingReplicationProtectionContainer( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179") + .withProperties( + new EnableProtectionInputProperties() + .withPolicyId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1") + .withProtectableItemId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b") + .withProviderSpecificDetails(new HyperVReplicaAzureEnableProtectionInput())) + .create(); + } +} +``` + +### ReplicationProtectedItems_Delete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionProviderSpecificInput; + +/** Samples for ReplicationProtectedItems Delete. */ +public final class ReplicationProtectedItemsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Delete.json + */ + /** + * Sample code: Disables protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void disablesProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .delete( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "c0c14913-3d7a-48ea-9531-cc99e0e686e6", + new DisableProtectionInput() + .withProperties( + new DisableProtectionInputProperties() + .withReplicationProviderInput(new DisableProtectionProviderSpecificInput())), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_FailoverCancel + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems FailoverCancel. */ +public final class ReplicationProtectedItemsFailoverCancelSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCancel.json + */ + /** + * Sample code: Execute cancel failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeCancelFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .failoverCancel( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_FailoverCommit + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems FailoverCommit. */ +public final class ReplicationProtectedItemsFailoverCommitSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCommit.json + */ + /** + * Sample code: Execute commit failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeCommitFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .failoverCommit( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems Get. */ +public final class ReplicationProtectedItemsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Get.json + */ + /** + * Sample code: Gets the details of a Replication protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems List. */ +public final class ReplicationProtectedItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_List.json + */ + /** + * Sample code: Gets the list of replication protected items. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfReplicationProtectedItems( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().list("vault1", "resourceGroupPS1", null, null, Context.NONE); + } +} +``` + +### ReplicationProtectedItems_ListByReplicationProtectionContainers + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems ListByReplicationProtectionContainers. */ +public final class ReplicationProtectedItemsListByReplicationProte { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of Replication protected items. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfReplicationProtectedItems( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .listByReplicationProtectionContainers( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", Context.NONE); + } +} +``` + +### ReplicationProtectedItems_PlannedFailover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePlannedFailoverProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInputProperties; + +/** Samples for ReplicationProtectedItems PlannedFailover. */ +public final class ReplicationProtectedItemsPlannedFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_PlannedFailover.json + */ + /** + * Sample code: Execute planned failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executePlannedFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .plannedFailover( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new PlannedFailoverInput() + .withProperties( + new PlannedFailoverInputProperties() + .withFailoverDirection("PrimaryToRecovery") + .withProviderSpecificDetails(new HyperVReplicaAzurePlannedFailoverProviderInput())), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_Purge + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems Purge. */ +public final class ReplicationProtectedItemsPurgeSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Purge.json + */ + /** + * Sample code: Purges protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgesProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .purge( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "c0c14913-3d7a-48ea-9531-cc99e0e686e6", + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_RemoveDisks + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARemoveDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationProtectedItems RemoveDisks. */ +public final class ReplicationProtectedItemsRemoveDisksSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RemoveDisks.json + */ + /** + * Sample code: Removes disk(s). + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void removesDiskS( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .removeDisks( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new RemoveDisksInput() + .withProperties( + new RemoveDisksInputProperties() + .withProviderSpecificDetails( + new A2ARemoveDisksInput() + .withVmDisksUris( + Arrays.asList("https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd")))), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_RepairReplication + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems RepairReplication. */ +public final class ReplicationProtectedItemsRepairReplicationSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RepairReplication.json + */ + /** + * Sample code: Resynchronize or repair replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resynchronizeOrRepairReplication( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .repairReplication( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_Reprotect + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureReprotectInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInputProperties; + +/** Samples for ReplicationProtectedItems Reprotect. */ +public final class ReplicationProtectedItemsReprotectSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Reprotect.json + */ + /** + * Sample code: Execute Reverse Replication\Reprotect. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeReverseReplicationReprotect( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .reprotect( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new ReverseReplicationInput() + .withProperties( + new ReverseReplicationInputProperties() + .withFailoverDirection("PrimaryToRecovery") + .withProviderSpecificDetails(new HyperVReplicaAzureReprotectInput())), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_ResolveHealthErrors + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthError; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationProtectedItems ResolveHealthErrors. */ +public final class ReplicationProtectedItemsResolveHealthErrorsSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json + */ + /** + * Sample code: Resolve health errors. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resolveHealthErrors( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .resolveHealthErrors( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new ResolveHealthInput() + .withProperties( + new ResolveHealthInputProperties() + .withHealthErrors(Arrays.asList(new ResolveHealthError().withHealthErrorId("3:8020")))), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_SwitchProvider + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInputProperties; + +/** Samples for ReplicationProtectedItems SwitchProvider. */ +public final class ReplicationProtectedItemsSwitchProviderSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_SwitchProvider.json + */ + /** + * Sample code: Execute switch provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeSwitchProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .switchProvider( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new SwitchProviderInput() + .withProperties( + new SwitchProviderInputProperties() + .withTargetInstanceType("InMageRcm") + .withProviderSpecificDetails( + new InMageAzureV2SwitchProviderInput() + .withTargetVaultId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault2") + .withTargetFabricId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2") + .withTargetApplianceId("5efaa202-e958-435e-8171-706bf735fcc4"))), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_TestFailover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureTestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInputProperties; + +/** Samples for ReplicationProtectedItems TestFailover. */ +public final class ReplicationProtectedItemsTestFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailover.json + */ + /** + * Sample code: Execute test failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeTestFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .testFailover( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new TestFailoverInput() + .withProperties( + new TestFailoverInputProperties() + .withFailoverDirection("PrimaryToRecovery") + .withNetworkType("VmNetworkAsInput") + .withNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai") + .withProviderSpecificDetails(new HyperVReplicaAzureTestFailoverInput())), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_TestFailoverCleanup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInputProperties; + +/** Samples for ReplicationProtectedItems TestFailoverCleanup. */ +public final class ReplicationProtectedItemsTestFailoverCleanupSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json + */ + /** + * Sample code: Execute test failover cleanup. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeTestFailoverCleanup( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .testFailoverCleanup( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new TestFailoverCleanupInput() + .withProperties(new TestFailoverCleanupInputProperties().withComments("Test Failover Cleanup")), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_UnplannedFailover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInputProperties; + +/** Samples for ReplicationProtectedItems UnplannedFailover. */ +public final class ReplicationProtectedItemsUnplannedFailoverSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UnplannedFailover.json + */ + /** + * Sample code: Execute unplanned failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeUnplannedFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .unplannedFailover( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new UnplannedFailoverInput() + .withProperties( + new UnplannedFailoverInputProperties() + .withFailoverDirection("PrimaryToRecovery") + .withSourceSiteOperations("NotRequired") + .withProviderSpecificDetails(new HyperVReplicaAzureUnplannedFailoverInput())), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUpdateReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.IpConfigInputDetails; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LicenseType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMNicInputDetails; +import java.util.Arrays; + +/** Samples for ReplicationProtectedItems Update. */ +public final class ReplicationProtectedItemsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Update.json + */ + /** + * Sample code: Updates the replication protected Item settings. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesTheReplicationProtectedItemSettings( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + ReplicationProtectedItem resource = + manager + .replicationProtectedItems() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateReplicationProtectedItemInputProperties() + .withRecoveryAzureVMName("vm1") + .withRecoveryAzureVMSize("Basic_A0") + .withSelectedRecoveryAzureNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai") + .withVmNics( + Arrays + .asList( + new VMNicInputDetails() + .withNicId( + "TWljcm9zb2Z0OkY4NDkxRTRGLTgxN0EtNDBERC1BOTBDLUFGNzczOTc4Qzc1Qlw3NjAwMzMxRS03NDk4LTQ0QTQtQjdDNy0xQjY1NkJDREQ1MkQ=") + .withIpConfigs( + Arrays + .asList( + new IpConfigInputDetails() + .withIpConfigName("ipconfig1") + .withIsPrimary(true) + .withRecoverySubnetName("subnet1") + .withRecoveryStaticIpAddress("10.0.2.46"))) + .withSelectionType("SelectedByUser"))) + .withLicenseType(LicenseType.WINDOWS_SERVER) + .withProviderSpecificDetails(new HyperVReplicaAzureUpdateReplicationProtectedItemInput())) + .apply(); + } +} +``` + +### ReplicationProtectedItems_UpdateAppliance + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties; + +/** Samples for ReplicationProtectedItems UpdateAppliance. */ +public final class ReplicationProtectedItemsUpdateApplianceSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateAppliance.json + */ + /** + * Sample code: Updates appliance for replication protected Item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesApplianceForReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .updateAppliance( + "Ayan-0106-SA-Vault", + "Ayan-0106-SA-RG", + "Ayan-0106-SA-Vaultreplicationfabric", + "Ayan-0106-SA-Vaultreplicationcontainer", + "idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f", + new UpdateApplianceForReplicationProtectedItemInput() + .withProperties( + new UpdateApplianceForReplicationProtectedItemInputProperties() + .withTargetApplianceId("") + .withProviderSpecificDetails( + new InMageRcmUpdateApplianceForReplicationProtectedItemInput().withRunAsAccountId(""))), + Context.NONE); + } +} +``` + +### ReplicationProtectedItems_UpdateMobilityService + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequestProperties; + +/** Samples for ReplicationProtectedItems UpdateMobilityService. */ +public final class ReplicationProtectedItemsUpdateMobilityServiceS { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateMobilityService.json + */ + /** + * Sample code: Update the mobility service on a protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updateTheMobilityServiceOnAProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .updateMobilityService( + "WCUSVault", + "wcusValidations", + "WIN-JKKJ31QI8U2", + "cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0", + "79dd20ab-2b40-11e7-9791-0050568f387e", + new UpdateMobilityServiceRequest() + .withProperties(new UpdateMobilityServiceRequestProperties().withRunAsAccountId("2")), + Context.NONE); + } +} +``` + +### ReplicationProtectionContainerMappings_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput; + +/** Samples for ReplicationProtectionContainerMappings Create. */ +public final class ReplicationProtectionContainerMappingsCreateSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Create.json + */ + /** + * Sample code: Create protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .define("cloud1protectionprofile1") + .withExistingReplicationProtectionContainer( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179") + .withProperties( + new CreateProtectionContainerMappingInputProperties() + .withTargetProtectionContainerId("Microsoft Azure") + .withPolicyId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1") + .withProviderSpecificInput(new ReplicationProviderSpecificContainerMappingInput())) + .create(); + } +} +``` + +### ReplicationProtectionContainerMappings_Delete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput; + +/** Samples for ReplicationProtectionContainerMappings Delete. */ +public final class ReplicationProtectionContainerMappingsDeleteSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Delete.json + */ + /** + * Sample code: Remove protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void removeProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .delete( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "cloud1protectionprofile1", + new RemoveProtectionContainerMappingInput() + .withProperties( + new RemoveProtectionContainerMappingInputProperties() + .withProviderSpecificInput(new ReplicationProviderContainerUnmappingInput())), + Context.NONE); + } +} +``` + +### ReplicationProtectionContainerMappings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainerMappings Get. */ +public final class ReplicationProtectionContainerMappingsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Get.json + */ + /** + * Sample code: Gets a protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "cloud1protectionprofile1", + Context.NONE); + } +} +``` + +### ReplicationProtectionContainerMappings_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainerMappings List. */ +public final class ReplicationProtectionContainerMappingsListSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_List.json + */ + /** + * Sample code: Gets the list of all protection container mappings in a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfAllProtectionContainerMappingsInAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainerMappings().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainerMappings ListByReplicationProtectionContainers. */ +public final class ReplicationProtectionContainerMappingsListByRep { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of protection container mappings for a protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfProtectionContainerMappingsForAProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .listByReplicationProtectionContainers( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", Context.NONE); + } +} +``` + +### ReplicationProtectionContainerMappings_Purge + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainerMappings Purge. */ +public final class ReplicationProtectionContainerMappingsPurgeSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Purge.json + */ + /** + * Sample code: Purge protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgeProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .purge( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "cloud1protectionprofile1", + Context.NONE); + } +} +``` + +### ReplicationProtectionContainerMappings_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUpdateContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentAutoUpdateStatus; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties; + +/** Samples for ReplicationProtectionContainerMappings Update. */ +public final class ReplicationProtectionContainerMappingsUpdateSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Update.json + */ + /** + * Sample code: Update protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updateProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + ProtectionContainerMapping resource = + manager + .replicationProtectionContainerMappings() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "cloud1protectionprofile1", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateProtectionContainerMappingInputProperties() + .withProviderSpecificInput( + new A2AUpdateContainerMappingInput() + .withAgentAutoUpdateStatus(AgentAutoUpdateStatus.ENABLED) + .withAutomationAccountArmId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1"))) + .apply(); + } +} +``` + +### ReplicationProtectionContainers_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerCreationInput; +import java.util.Arrays; + +/** Samples for ReplicationProtectionContainers Create. */ +public final class ReplicationProtectionContainersCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Create.json + */ + /** + * Sample code: Create a protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createAProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .define("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179") + .withExistingReplicationFabric("vault1", "resourceGroupPS1", "cloud1") + .withProperties( + new CreateProtectionContainerInputProperties() + .withProviderSpecificInput(Arrays.asList(new ReplicationProviderSpecificContainerCreationInput()))) + .create(); + } +} +``` + +### ReplicationProtectionContainers_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainers Delete. */ +public final class ReplicationProtectionContainersDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Delete.json + */ + /** + * Sample code: Removes a protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void removesAProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .delete("vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", Context.NONE); + } +} +``` + +### ReplicationProtectionContainers_DiscoverProtectableItem + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequestProperties; + +/** Samples for ReplicationProtectionContainers DiscoverProtectableItem. */ +public final class ReplicationProtectionContainersDiscoverProtecta { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json + */ + /** + * Sample code: Adds a protectable item to the replication protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addsAProtectableItemToTheReplicationProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .discoverProtectableItem( + "MadhaviVault", + "MadhaviVRG", + "V2A-W2K12-660", + "cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c", + new DiscoverProtectableItemRequest() + .withProperties( + new DiscoverProtectableItemRequestProperties() + .withFriendlyName("Test") + .withIpAddress("10.150.2.3") + .withOsType("Windows")), + Context.NONE); + } +} +``` + +### ReplicationProtectionContainers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainers Get. */ +public final class ReplicationProtectionContainersGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Get.json + */ + /** + * Sample code: Gets the protection container details. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheProtectionContainerDetails( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .getWithResponse( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", Context.NONE); + } +} +``` + +### ReplicationProtectionContainers_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainers List. */ +public final class ReplicationProtectionContainersListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_List.json + */ + /** + * Sample code: Gets the list of all protection containers in a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfAllProtectionContainersInAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainers().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationProtectionContainers_ListByReplicationFabrics + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainers ListByReplicationFabrics. */ +public final class ReplicationProtectionContainersListByReplicatio { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of protection container for a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfProtectionContainerForAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} +``` + +### ReplicationProtectionContainers_SwitchProtection + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ASwitchProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInputProperties; + +/** Samples for ReplicationProtectionContainers SwitchProtection. */ +public final class ReplicationProtectionContainersSwitchProtection { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_SwitchProtection.json + */ + /** + * Sample code: Switches protection from one container to another or one replication provider to another. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .switchProtection( + "priyanponeboxvault", + "priyanprg", + "CentralUSCanSite", + "CentralUSCancloud", + new SwitchProtectionInput() + .withProperties( + new SwitchProtectionInputProperties() + .withProviderSpecificDetails(new A2ASwitchProtectionInput())), + Context.NONE); + } +} +``` + +### ReplicationProtectionIntents_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACreateProtectionIntentInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARecoveryAvailabilityType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProperties; + +/** Samples for ReplicationProtectionIntents Create. */ +public final class ReplicationProtectionIntentsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Create.json + */ + /** + * Sample code: Create protection intent Resource. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createProtectionIntentResource( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionIntents() + .define("vm1") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new CreateProtectionIntentProperties() + .withProviderSpecificDetails( + new A2ACreateProtectionIntentInput() + .withFabricObjectId( + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne/providers/Microsoft.Compute/virtualMachines/vmPpgAv5") + .withPrimaryLocation("eastUs2") + .withRecoveryLocation("westus2") + .withRecoverySubscriptionId("ed5bcdf6-d61e-47bd-8ea9-f2bd379a2640") + .withRecoveryAvailabilityType(A2ARecoveryAvailabilityType.SINGLE) + .withRecoveryResourceGroupId( + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne-asr"))) + .create(); + } +} +``` + +### ReplicationProtectionIntents_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionIntents Get. */ +public final class ReplicationProtectionIntentsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Get.json + */ + /** + * Sample code: Gets the details of a Replication protection intent item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAReplicationProtectionIntentItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionIntents().getWithResponse("vault1", "resourceGroupPS1", "vm1", Context.NONE); + } +} +``` + +### ReplicationProtectionIntents_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionIntents List. */ +public final class ReplicationProtectionIntentsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_List.json + */ + /** + * Sample code: Gets the list of replication protection intent objects. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfReplicationProtectionIntentObjects( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionIntents().list("2007vttp", "resourceGroupPS1", null, null, Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverDeploymentModel; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroup; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProtectedItem; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans Create. */ +public final class ReplicationRecoveryPlansCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Create.json + */ + /** + * Sample code: Creates a recovery plan with the given details. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createsARecoveryPlanWithTheGivenDetails( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .define("RPtest1") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new CreateRecoveryPlanInputProperties() + .withPrimaryFabricId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1") + .withRecoveryFabricId("Microsoft Azure") + .withFailoverDeploymentModel(FailoverDeploymentModel.RESOURCE_MANAGER) + .withGroups( + Arrays + .asList( + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.BOOT) + .withReplicationProtectedItems( + Arrays + .asList( + new RecoveryPlanProtectedItem() + .withId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b") + .withVirtualMachineId("f8491e4f-817a-40dd-a90c-af773978c75b"))) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList())))) + .create(); + } +} +``` + +### ReplicationRecoveryPlans_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans Delete. */ +public final class ReplicationRecoveryPlansDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Delete.json + */ + /** + * Sample code: Deletes the specified recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deletesTheSpecifiedRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().delete("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_FailoverCancel + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans FailoverCancel. */ +public final class ReplicationRecoveryPlansFailoverCancelSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCancel.json + */ + /** + * Sample code: Execute cancel failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeCancelFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().failoverCancel("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_FailoverCommit + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans FailoverCommit. */ +public final class ReplicationRecoveryPlansFailoverCommitSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCommit.json + */ + /** + * Sample code: Execute commit failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeCommitFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().failoverCommit("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans Get. */ +public final class ReplicationRecoveryPlansGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Get.json + */ + /** + * Sample code: Gets the requested recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheRequestedRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().getWithResponse("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans List. */ +public final class ReplicationRecoveryPlansListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_List.json + */ + /** + * Sample code: Gets the list of recovery plans. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRecoveryPlans( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_PlannedFailover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans PlannedFailover. */ +public final class ReplicationRecoveryPlansPlannedFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_PlannedFailover.json + */ + /** + * Sample code: Execute planned failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executePlannedFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .plannedFailover( + "vault1", + "resourceGroupPS1", + "RPtest1", + new RecoveryPlanPlannedFailoverInput() + .withProperties( + new RecoveryPlanPlannedFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) + .withProviderSpecificDetails( + Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), + Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_Reprotect + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans Reprotect. */ +public final class ReplicationRecoveryPlansReprotectSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Reprotect.json + */ + /** + * Sample code: Execute reprotect of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeReprotectOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().reprotect("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_TestFailover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans TestFailover. */ +public final class ReplicationRecoveryPlansTestFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailover.json + */ + /** + * Sample code: Execute test failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeTestFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .testFailover( + "vault1", + "resourceGroupPS1", + "RPtest1", + new RecoveryPlanTestFailoverInput() + .withProperties( + new RecoveryPlanTestFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) + .withNetworkType("VmNetworkAsInput") + .withNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai") + .withProviderSpecificDetails( + Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), + Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_TestFailoverCleanup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties; + +/** Samples for ReplicationRecoveryPlans TestFailoverCleanup. */ +public final class ReplicationRecoveryPlansTestFailoverCleanupSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json + */ + /** + * Sample code: Execute test failover cleanup of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeTestFailoverCleanupOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .testFailoverCleanup( + "vault1", + "resourceGroupPS1", + "RPtest1", + new RecoveryPlanTestFailoverCleanupInput() + .withProperties( + new RecoveryPlanTestFailoverCleanupInputProperties().withComments("Test Failover Cleanup")), + Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_UnplannedFailover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans UnplannedFailover. */ +public final class ReplicationRecoveryPlansUnplannedFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json + */ + /** + * Sample code: Execute unplanned failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeUnplannedFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .unplannedFailover( + "vault1", + "resourceGroupPS1", + "RPtest1", + new RecoveryPlanUnplannedFailoverInput() + .withProperties( + new RecoveryPlanUnplannedFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) + .withSourceSiteOperations(SourceSiteOperations.REQUIRED) + .withProviderSpecificDetails( + Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), + Context.NONE); + } +} +``` + +### ReplicationRecoveryPlans_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlan; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroup; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProtectedItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans Update. */ +public final class ReplicationRecoveryPlansUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Update.json + */ + /** + * Sample code: Updates the given recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesTheGivenRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + RecoveryPlan resource = + manager + .replicationRecoveryPlans() + .getWithResponse("vault1", "resourceGroupPS1", "RPtest1", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateRecoveryPlanInputProperties() + .withGroups( + Arrays + .asList( + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.SHUTDOWN) + .withReplicationProtectedItems(Arrays.asList()) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList()), + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.FAILOVER) + .withReplicationProtectedItems(Arrays.asList()) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList()), + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.BOOT) + .withReplicationProtectedItems( + Arrays + .asList( + new RecoveryPlanProtectedItem() + .withId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b") + .withVirtualMachineId("f8491e4f-817a-40dd-a90c-af773978c75b"))) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList()), + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.BOOT) + .withReplicationProtectedItems( + Arrays + .asList( + new RecoveryPlanProtectedItem() + .withId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6") + .withVirtualMachineId("c0c14913-3d7a-48ea-9531-cc99e0e686e6"))) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList())))) + .apply(); + } +} +``` + +### ReplicationRecoveryServicesProviders_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.IdentityProviderInput; + +/** Samples for ReplicationRecoveryServicesProviders Create. */ +public final class ReplicationRecoveryServicesProvidersCreateSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Create.json + */ + /** + * Sample code: Adds a recovery services provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addsARecoveryServicesProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .define("vmwareprovider1") + .withExistingReplicationFabric("migrationvault", "resourcegroup1", "vmwarefabric1") + .withProperties( + new AddRecoveryServicesProviderInputProperties() + .withMachineName("vmwareprovider1") + .withAuthenticationIdentityInput( + new IdentityProviderInput() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("f66fce08-c0c6-47a1-beeb-0ede5ea94f90") + .withObjectId("141360b8-5686-4240-a027-5e24e6affeba") + .withAudience("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874") + .withAadAuthority("https://login.microsoftonline.com")) + .withResourceAccessIdentityInput( + new IdentityProviderInput() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("f66fce08-c0c6-47a1-beeb-0ede5ea94f90") + .withObjectId("141360b8-5686-4240-a027-5e24e6affeba") + .withAudience("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874") + .withAadAuthority("https://login.microsoftonline.com"))) + .create(); + } +} +``` + +### ReplicationRecoveryServicesProviders_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders Delete. */ +public final class ReplicationRecoveryServicesProvidersDeleteSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Delete.json + */ + /** + * Sample code: Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is + * unsupported. To maintain backward compatibility for released clients the object "deleteRspInput" is used (if the + * object is empty we assume that it is old client and continue the old behavior). + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .delete("vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", Context.NONE); + } +} +``` + +### ReplicationRecoveryServicesProviders_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders Get. */ +public final class ReplicationRecoveryServicesProvidersGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Get.json + */ + /** + * Sample code: Gets the details of a recovery services provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfARecoveryServicesProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .getWithResponse( + "vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", Context.NONE); + } +} +``` + +### ReplicationRecoveryServicesProviders_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders List. */ +public final class ReplicationRecoveryServicesProvidersListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_List.json + */ + /** + * Sample code: Gets the list of registered recovery services providers in the vault. This is a view only api. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryServicesProviders().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationRecoveryServicesProviders_ListByReplicationFabrics + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders ListByReplicationFabrics. */ +public final class ReplicationRecoveryServicesProvidersListByRepli { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of registered recovery services providers for the fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} +``` + +### ReplicationRecoveryServicesProviders_Purge + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders Purge. */ +public final class ReplicationRecoveryServicesProvidersPurgeSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Purge.json + */ + /** + * Sample code: Purges recovery service provider from fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgesRecoveryServiceProviderFromFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .purge("vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", Context.NONE); + } +} +``` + +### ReplicationRecoveryServicesProviders_RefreshProvider + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders RefreshProvider. */ +public final class ReplicationRecoveryServicesProvidersRefreshProv { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json + */ + /** + * Sample code: Refresh details from the recovery services provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void refreshDetailsFromTheRecoveryServicesProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .refreshProvider( + "vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", Context.NONE); + } +} +``` + +### ReplicationStorageClassificationMappings_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageMappingInputProperties; + +/** Samples for ReplicationStorageClassificationMappings Create. */ +public final class ReplicationStorageClassificationMappingsCreateS { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Create.json + */ + /** + * Sample code: Create storage classification mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createStorageClassificationMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassificationMappings() + .define("testStorageMapping") + .withExistingReplicationStorageClassification( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09") + .withProperties( + new StorageMappingInputProperties() + .withTargetStorageClassificationId( + "/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09")) + .create(); + } +} +``` + +### ReplicationStorageClassificationMappings_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassificationMappings Delete. */ +public final class ReplicationStorageClassificationMappingsDeleteS { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Delete.json + */ + /** + * Sample code: Delete a storage classification mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deleteAStorageClassificationMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassificationMappings() + .delete( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09", + "testStorageMapping", + Context.NONE); + } +} +``` + +### ReplicationStorageClassificationMappings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassificationMappings Get. */ +public final class ReplicationStorageClassificationMappingsGetSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Get.json + */ + /** + * Sample code: Gets the details of a storage classification mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAStorageClassificationMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassificationMappings() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09", + "testStorageMapping", + Context.NONE); + } +} +``` + +### ReplicationStorageClassificationMappings_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassificationMappings List. */ +public final class ReplicationStorageClassificationMappingsListSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_List.json + */ + /** + * Sample code: Gets the list of storage classification mappings objects under a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationMappingsObjectsUnderAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationStorageClassificationMappings().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassificationMappings ListByReplicationStorageClassifications. */ +public final class ReplicationStorageClassificationMappingsListByR { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json + */ + /** + * Sample code: Gets the list of storage classification mappings objects under a storage. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationMappingsObjectsUnderAStorage( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassificationMappings() + .listByReplicationStorageClassifications( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09", + Context.NONE); + } +} +``` + +### ReplicationStorageClassifications_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassifications Get. */ +public final class ReplicationStorageClassificationsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_Get.json + */ + /** + * Sample code: Gets the details of a storage classification. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAStorageClassification( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassifications() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09", + Context.NONE); + } +} +``` + +### ReplicationStorageClassifications_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassifications List. */ +public final class ReplicationStorageClassificationsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_List.json + */ + /** + * Sample code: Gets the list of storage classification objects under a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationObjectsUnderAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationStorageClassifications().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationStorageClassifications_ListByReplicationFabrics + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassifications ListByReplicationFabrics. */ +public final class ReplicationStorageClassificationsListByReplicat { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of storage classification objects under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationObjectsUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassifications() + .listByReplicationFabrics( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + Context.NONE); + } +} +``` + +### ReplicationVaultHealth_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationVaultHealth Get. */ +public final class ReplicationVaultHealthGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Get.json + */ + /** + * Sample code: Gets the health summary for the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheHealthSummaryForTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationVaultHealths().getWithResponse("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationVaultHealth_Refresh + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationVaultHealth Refresh. */ +public final class ReplicationVaultHealthRefreshSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Refresh.json + */ + /** + * Sample code: Refreshes health summary of the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void refreshesHealthSummaryOfTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationVaultHealths().refresh("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationVaultSetting_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInputProperties; + +/** Samples for ReplicationVaultSetting Create. */ +public final class ReplicationVaultSettingCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Create.json + */ + /** + * Sample code: Updates vault setting. A vault setting object is a singleton per vault and it is always present by + * default. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationVaultSettings() + .define("default") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new VaultSettingCreationInputProperties() + .withMigrationSolutionId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.Migrate/MigrateProjects/resourceGroupPS1-MigrateProject/Solutions/Servers-Migration-ServerMigration")) + .create(); + } +} +``` + +### ReplicationVaultSetting_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationVaultSetting Get. */ +public final class ReplicationVaultSettingGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Get.json + */ + /** + * Sample code: Gets the vault setting. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheVaultSetting( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationVaultSettings().getWithResponse("vault1", "resourceGroupPS1", "default", Context.NONE); + } +} +``` + +### ReplicationVaultSetting_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationVaultSetting List. */ +public final class ReplicationVaultSettingListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_List.json + */ + /** + * Sample code: Gets the list of vault setting. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfVaultSetting( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationVaultSettings().list("vault1", "resourceGroupPS1", Context.NONE); + } +} +``` + +### ReplicationvCenters_Create + +```java +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequestProperties; + +/** Samples for ReplicationvCenters Create. */ +public final class ReplicationvCentersCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Create.json + */ + /** + * Sample code: Add vCenter. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addVCenter(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationvCenters() + .define("esx-78") + .withExistingReplicationFabric("MadhaviVault", "MadhaviVRG", "MadhaviFabric") + .withProperties( + new AddVCenterRequestProperties() + .withFriendlyName("esx-78") + .withIpAddress("inmtest78") + .withProcessServerId("5A720CAB-39CB-F445-BD1662B0B33164B5") + .withPort("443") + .withRunAsAccountId("2")) + .create(); + } +} +``` + +### ReplicationvCenters_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationvCenters Delete. */ +public final class ReplicationvCentersDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Delete.json + */ + /** + * Sample code: Remove vCenter operation. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void removeVCenterOperation( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationvCenters().delete("MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", Context.NONE); + } +} +``` + +### ReplicationvCenters_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationvCenters Get. */ +public final class ReplicationvCentersGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Get.json + */ + /** + * Sample code: Gets the details of a vCenter. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAVCenter( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationvCenters() + .getWithResponse("MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", Context.NONE); + } +} +``` + +### ReplicationvCenters_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationvCenters List. */ +public final class ReplicationvCentersListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_List.json + */ + /** + * Sample code: Gets the list of vCenter registered under the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfVCenterRegisteredUnderTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationvCenters().list("MadhaviVault", "MadhaviVRG", Context.NONE); + } +} +``` + +### ReplicationvCenters_ListByReplicationFabrics + +```java +import com.azure.core.util.Context; + +/** Samples for ReplicationvCenters ListByReplicationFabrics. */ +public final class ReplicationvCentersListByReplicationFabricsSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of vCenter registered under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfVCenterRegisteredUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationvCenters() + .listByReplicationFabrics("MadhaviVault", "MadhaviVRG", "MadhaviFabric", Context.NONE); + } +} +``` + +### ReplicationvCenters_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequestProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenter; + +/** Samples for ReplicationvCenters Update. */ +public final class ReplicationvCentersUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Update.json + */ + /** + * Sample code: Update vCenter operation. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updateVCenterOperation( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + VCenter resource = + manager + .replicationvCenters() + .getWithResponse("MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", Context.NONE) + .getValue(); + resource.update().withProperties(new UpdateVCenterRequestProperties().withIpAddress("10.150.109.25")).apply(); + } +} +``` + +### SupportedOperatingSystemsOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SupportedOperatingSystemsOperation Get. */ +public final class SupportedOperatingSystemsOperationGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/SupportedOperatingSystems_Get.json + */ + /** + * Sample code: Gets the data of supported operating systems by SRS. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDataOfSupportedOperatingSystemsBySRS( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.supportedOperatingSystemsOperations().getWithResponse("vault1", "resourceGroupPS1", null, Context.NONE); + } +} +``` + +### TargetComputeSizes_ListByReplicationProtectedItems + +```java +import com.azure.core.util.Context; + +/** Samples for TargetComputeSizes ListByReplicationProtectedItems. */ +public final class TargetComputeSizesListByReplicationProtectedIte { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json + */ + /** + * Sample code: Gets the list of target compute sizes for the replication protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfTargetComputeSizesForTheReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .targetComputeSizes() + .listByReplicationProtectedItems( + "avraiMgDiskVault", + "avraiMgDiskVaultRG", + "asr-a2a-default-centraluseuap", + "asr-a2a-default-centraluseuap-container", + "468c912d-b1ab-4ea2-97eb-4b5095155db2", + Context.NONE); + } +} +``` + diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml new file mode 100644 index 000000000000..69da13271cc5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-recoveryservicessiterecovery + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for SiteRecovery Management + This package contains Microsoft Azure SDK for SiteRecovery Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2022-10. + 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 + true + + + + com.azure + azure-core + 1.34.0 + + + com.azure + azure-core-management + 1.9.0 + + + diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/SiteRecoveryManager.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/SiteRecoveryManager.java new file mode 100644 index 000000000000..92343a200a2a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/SiteRecoveryManager.java @@ -0,0 +1,739 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery; + +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.recoveryservicessiterecovery.fluent.SiteRecoveryManagementClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.MigrationRecoveryPointsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.OperationsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.RecoveryPointsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationAlertSettingsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationAppliancesImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationEligibilityResultsOperationsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationEventsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationFabricsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationJobsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationLogicalNetworksImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationMigrationItemsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationNetworkMappingsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationNetworksImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationPoliciesImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectableItemsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectedItemsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectionContainerMappingsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectionContainersImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationProtectionIntentsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationRecoveryPlansImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationRecoveryServicesProvidersImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationStorageClassificationMappingsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationStorageClassificationsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationVaultHealthsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationVaultSettingsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.ReplicationvCentersImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.SiteRecoveryManagementClientBuilder; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.SupportedOperatingSystemsOperationsImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.implementation.TargetComputeSizesImpl; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPoints; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Operations; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPoints; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationAlertSettings; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationAppliances; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsOperations; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEvents; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationFabrics; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationJobs; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationLogicalNetworks; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationMigrationItems; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationNetworkMappings; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationNetworks; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationPolicies; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectableItems; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItems; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionContainerMappings; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionContainers; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntents; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationRecoveryPlans; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationRecoveryServicesProviders; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationStorageClassificationMappings; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationStorageClassifications; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationVaultHealths; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationVaultSettings; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationvCenters; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOperatingSystemsOperations; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizes; +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 SiteRecoveryManager. */ +public final class SiteRecoveryManager { + private Operations operations; + + private ReplicationAlertSettings replicationAlertSettings; + + private ReplicationAppliances replicationAppliances; + + private ReplicationEligibilityResultsOperations replicationEligibilityResultsOperations; + + private ReplicationEvents replicationEvents; + + private ReplicationFabrics replicationFabrics; + + private ReplicationLogicalNetworks replicationLogicalNetworks; + + private ReplicationNetworks replicationNetworks; + + private ReplicationNetworkMappings replicationNetworkMappings; + + private ReplicationProtectionContainers replicationProtectionContainers; + + private ReplicationMigrationItems replicationMigrationItems; + + private MigrationRecoveryPoints migrationRecoveryPoints; + + private ReplicationProtectableItems replicationProtectableItems; + + private ReplicationProtectedItems replicationProtectedItems; + + private RecoveryPoints recoveryPoints; + + private TargetComputeSizes targetComputeSizes; + + private ReplicationProtectionContainerMappings replicationProtectionContainerMappings; + + private ReplicationRecoveryServicesProviders replicationRecoveryServicesProviders; + + private ReplicationStorageClassifications replicationStorageClassifications; + + private ReplicationStorageClassificationMappings replicationStorageClassificationMappings; + + private ReplicationvCenters replicationvCenters; + + private ReplicationJobs replicationJobs; + + private ReplicationPolicies replicationPolicies; + + private ReplicationProtectionIntents replicationProtectionIntents; + + private ReplicationRecoveryPlans replicationRecoveryPlans; + + private SupportedOperatingSystemsOperations supportedOperatingSystemsOperations; + + private ReplicationVaultHealths replicationVaultHealths; + + private ReplicationVaultSettings replicationVaultSettings; + + private final SiteRecoveryManagementClient clientObject; + + private SiteRecoveryManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new SiteRecoveryManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of SiteRecovery service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the SiteRecovery service API instance. + */ + public static SiteRecoveryManager 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 SiteRecovery service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the SiteRecovery service API instance. + */ + public static SiteRecoveryManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new SiteRecoveryManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create SiteRecoveryManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new SiteRecoveryManager.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 SiteRecovery service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the SiteRecovery service API instance. + */ + public SiteRecoveryManager 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.recoveryservicessiterecovery") + .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 SiteRecoveryManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * 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 ReplicationAlertSettings. It manages Alert. + * + * @return Resource collection API of ReplicationAlertSettings. + */ + public ReplicationAlertSettings replicationAlertSettings() { + if (this.replicationAlertSettings == null) { + this.replicationAlertSettings = + new ReplicationAlertSettingsImpl(clientObject.getReplicationAlertSettings(), this); + } + return replicationAlertSettings; + } + + /** + * Gets the resource collection API of ReplicationAppliances. + * + * @return Resource collection API of ReplicationAppliances. + */ + public ReplicationAppliances replicationAppliances() { + if (this.replicationAppliances == null) { + this.replicationAppliances = new ReplicationAppliancesImpl(clientObject.getReplicationAppliances(), this); + } + return replicationAppliances; + } + + /** + * Gets the resource collection API of ReplicationEligibilityResultsOperations. + * + * @return Resource collection API of ReplicationEligibilityResultsOperations. + */ + public ReplicationEligibilityResultsOperations replicationEligibilityResultsOperations() { + if (this.replicationEligibilityResultsOperations == null) { + this.replicationEligibilityResultsOperations = + new ReplicationEligibilityResultsOperationsImpl( + clientObject.getReplicationEligibilityResultsOperations(), this); + } + return replicationEligibilityResultsOperations; + } + + /** + * Gets the resource collection API of ReplicationEvents. + * + * @return Resource collection API of ReplicationEvents. + */ + public ReplicationEvents replicationEvents() { + if (this.replicationEvents == null) { + this.replicationEvents = new ReplicationEventsImpl(clientObject.getReplicationEvents(), this); + } + return replicationEvents; + } + + /** + * Gets the resource collection API of ReplicationFabrics. It manages Fabric. + * + * @return Resource collection API of ReplicationFabrics. + */ + public ReplicationFabrics replicationFabrics() { + if (this.replicationFabrics == null) { + this.replicationFabrics = new ReplicationFabricsImpl(clientObject.getReplicationFabrics(), this); + } + return replicationFabrics; + } + + /** + * Gets the resource collection API of ReplicationLogicalNetworks. + * + * @return Resource collection API of ReplicationLogicalNetworks. + */ + public ReplicationLogicalNetworks replicationLogicalNetworks() { + if (this.replicationLogicalNetworks == null) { + this.replicationLogicalNetworks = + new ReplicationLogicalNetworksImpl(clientObject.getReplicationLogicalNetworks(), this); + } + return replicationLogicalNetworks; + } + + /** + * Gets the resource collection API of ReplicationNetworks. + * + * @return Resource collection API of ReplicationNetworks. + */ + public ReplicationNetworks replicationNetworks() { + if (this.replicationNetworks == null) { + this.replicationNetworks = new ReplicationNetworksImpl(clientObject.getReplicationNetworks(), this); + } + return replicationNetworks; + } + + /** + * Gets the resource collection API of ReplicationNetworkMappings. It manages NetworkMapping. + * + * @return Resource collection API of ReplicationNetworkMappings. + */ + public ReplicationNetworkMappings replicationNetworkMappings() { + if (this.replicationNetworkMappings == null) { + this.replicationNetworkMappings = + new ReplicationNetworkMappingsImpl(clientObject.getReplicationNetworkMappings(), this); + } + return replicationNetworkMappings; + } + + /** + * Gets the resource collection API of ReplicationProtectionContainers. It manages ProtectionContainer. + * + * @return Resource collection API of ReplicationProtectionContainers. + */ + public ReplicationProtectionContainers replicationProtectionContainers() { + if (this.replicationProtectionContainers == null) { + this.replicationProtectionContainers = + new ReplicationProtectionContainersImpl(clientObject.getReplicationProtectionContainers(), this); + } + return replicationProtectionContainers; + } + + /** + * Gets the resource collection API of ReplicationMigrationItems. It manages MigrationItem. + * + * @return Resource collection API of ReplicationMigrationItems. + */ + public ReplicationMigrationItems replicationMigrationItems() { + if (this.replicationMigrationItems == null) { + this.replicationMigrationItems = + new ReplicationMigrationItemsImpl(clientObject.getReplicationMigrationItems(), this); + } + return replicationMigrationItems; + } + + /** + * Gets the resource collection API of MigrationRecoveryPoints. + * + * @return Resource collection API of MigrationRecoveryPoints. + */ + public MigrationRecoveryPoints migrationRecoveryPoints() { + if (this.migrationRecoveryPoints == null) { + this.migrationRecoveryPoints = + new MigrationRecoveryPointsImpl(clientObject.getMigrationRecoveryPoints(), this); + } + return migrationRecoveryPoints; + } + + /** + * Gets the resource collection API of ReplicationProtectableItems. + * + * @return Resource collection API of ReplicationProtectableItems. + */ + public ReplicationProtectableItems replicationProtectableItems() { + if (this.replicationProtectableItems == null) { + this.replicationProtectableItems = + new ReplicationProtectableItemsImpl(clientObject.getReplicationProtectableItems(), this); + } + return replicationProtectableItems; + } + + /** + * Gets the resource collection API of ReplicationProtectedItems. It manages ReplicationProtectedItem. + * + * @return Resource collection API of ReplicationProtectedItems. + */ + public ReplicationProtectedItems replicationProtectedItems() { + if (this.replicationProtectedItems == null) { + this.replicationProtectedItems = + new ReplicationProtectedItemsImpl(clientObject.getReplicationProtectedItems(), this); + } + return replicationProtectedItems; + } + + /** + * 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 TargetComputeSizes. + * + * @return Resource collection API of TargetComputeSizes. + */ + public TargetComputeSizes targetComputeSizes() { + if (this.targetComputeSizes == null) { + this.targetComputeSizes = new TargetComputeSizesImpl(clientObject.getTargetComputeSizes(), this); + } + return targetComputeSizes; + } + + /** + * Gets the resource collection API of ReplicationProtectionContainerMappings. It manages + * ProtectionContainerMapping. + * + * @return Resource collection API of ReplicationProtectionContainerMappings. + */ + public ReplicationProtectionContainerMappings replicationProtectionContainerMappings() { + if (this.replicationProtectionContainerMappings == null) { + this.replicationProtectionContainerMappings = + new ReplicationProtectionContainerMappingsImpl( + clientObject.getReplicationProtectionContainerMappings(), this); + } + return replicationProtectionContainerMappings; + } + + /** + * Gets the resource collection API of ReplicationRecoveryServicesProviders. It manages RecoveryServicesProvider. + * + * @return Resource collection API of ReplicationRecoveryServicesProviders. + */ + public ReplicationRecoveryServicesProviders replicationRecoveryServicesProviders() { + if (this.replicationRecoveryServicesProviders == null) { + this.replicationRecoveryServicesProviders = + new ReplicationRecoveryServicesProvidersImpl( + clientObject.getReplicationRecoveryServicesProviders(), this); + } + return replicationRecoveryServicesProviders; + } + + /** + * Gets the resource collection API of ReplicationStorageClassifications. + * + * @return Resource collection API of ReplicationStorageClassifications. + */ + public ReplicationStorageClassifications replicationStorageClassifications() { + if (this.replicationStorageClassifications == null) { + this.replicationStorageClassifications = + new ReplicationStorageClassificationsImpl(clientObject.getReplicationStorageClassifications(), this); + } + return replicationStorageClassifications; + } + + /** + * Gets the resource collection API of ReplicationStorageClassificationMappings. It manages + * StorageClassificationMapping. + * + * @return Resource collection API of ReplicationStorageClassificationMappings. + */ + public ReplicationStorageClassificationMappings replicationStorageClassificationMappings() { + if (this.replicationStorageClassificationMappings == null) { + this.replicationStorageClassificationMappings = + new ReplicationStorageClassificationMappingsImpl( + clientObject.getReplicationStorageClassificationMappings(), this); + } + return replicationStorageClassificationMappings; + } + + /** + * Gets the resource collection API of ReplicationvCenters. It manages VCenter. + * + * @return Resource collection API of ReplicationvCenters. + */ + public ReplicationvCenters replicationvCenters() { + if (this.replicationvCenters == null) { + this.replicationvCenters = new ReplicationvCentersImpl(clientObject.getReplicationvCenters(), this); + } + return replicationvCenters; + } + + /** + * Gets the resource collection API of ReplicationJobs. + * + * @return Resource collection API of ReplicationJobs. + */ + public ReplicationJobs replicationJobs() { + if (this.replicationJobs == null) { + this.replicationJobs = new ReplicationJobsImpl(clientObject.getReplicationJobs(), this); + } + return replicationJobs; + } + + /** + * Gets the resource collection API of ReplicationPolicies. It manages Policy. + * + * @return Resource collection API of ReplicationPolicies. + */ + public ReplicationPolicies replicationPolicies() { + if (this.replicationPolicies == null) { + this.replicationPolicies = new ReplicationPoliciesImpl(clientObject.getReplicationPolicies(), this); + } + return replicationPolicies; + } + + /** + * Gets the resource collection API of ReplicationProtectionIntents. It manages ReplicationProtectionIntent. + * + * @return Resource collection API of ReplicationProtectionIntents. + */ + public ReplicationProtectionIntents replicationProtectionIntents() { + if (this.replicationProtectionIntents == null) { + this.replicationProtectionIntents = + new ReplicationProtectionIntentsImpl(clientObject.getReplicationProtectionIntents(), this); + } + return replicationProtectionIntents; + } + + /** + * Gets the resource collection API of ReplicationRecoveryPlans. It manages RecoveryPlan. + * + * @return Resource collection API of ReplicationRecoveryPlans. + */ + public ReplicationRecoveryPlans replicationRecoveryPlans() { + if (this.replicationRecoveryPlans == null) { + this.replicationRecoveryPlans = + new ReplicationRecoveryPlansImpl(clientObject.getReplicationRecoveryPlans(), this); + } + return replicationRecoveryPlans; + } + + /** + * Gets the resource collection API of SupportedOperatingSystemsOperations. + * + * @return Resource collection API of SupportedOperatingSystemsOperations. + */ + public SupportedOperatingSystemsOperations supportedOperatingSystemsOperations() { + if (this.supportedOperatingSystemsOperations == null) { + this.supportedOperatingSystemsOperations = + new SupportedOperatingSystemsOperationsImpl( + clientObject.getSupportedOperatingSystemsOperations(), this); + } + return supportedOperatingSystemsOperations; + } + + /** + * Gets the resource collection API of ReplicationVaultHealths. + * + * @return Resource collection API of ReplicationVaultHealths. + */ + public ReplicationVaultHealths replicationVaultHealths() { + if (this.replicationVaultHealths == null) { + this.replicationVaultHealths = + new ReplicationVaultHealthsImpl(clientObject.getReplicationVaultHealths(), this); + } + return replicationVaultHealths; + } + + /** + * Gets the resource collection API of ReplicationVaultSettings. It manages VaultSetting. + * + * @return Resource collection API of ReplicationVaultSettings. + */ + public ReplicationVaultSettings replicationVaultSettings() { + if (this.replicationVaultSettings == null) { + this.replicationVaultSettings = + new ReplicationVaultSettingsImpl(clientObject.getReplicationVaultSettings(), this); + } + return replicationVaultSettings; + } + + /** + * @return Wrapped service client SiteRecoveryManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public SiteRecoveryManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/MigrationRecoveryPointsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/MigrationRecoveryPointsClient.java new file mode 100644 index 000000000000..9bbbaa2db302 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/MigrationRecoveryPointsClient.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner; + +/** An instance of this class provides access to all the operations defined in MigrationRecoveryPointsClient. */ +public interface MigrationRecoveryPointsClient { + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationMigrationItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName); + + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationMigrationItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context); + + /** + * Gets a recovery point for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrationRecoveryPointName The migration 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 a recovery point for a migration item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName, + Context context); + + /** + * Gets a recovery point for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrationRecoveryPointName The migration 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 a recovery point for a migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationRecoveryPointInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/OperationsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/OperationsClient.java new file mode 100644 index 000000000000..666d2acd5222 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/OperationsClient.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of ClientDiscovery details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/RecoveryPointsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/RecoveryPointsClient.java new file mode 100644 index 000000000000..c8cc3dc2f1e5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/RecoveryPointsClient.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.RecoveryPointInner; + +/** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */ +public interface RecoveryPointsClient { + /** + * Gets the list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Gets the list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Gets a recovery point. + * + *

Get the details of specified recovery point. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 specified recovery point along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName, + Context context); + + /** + * Gets a recovery point. + * + *

Get the details of specified recovery point. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 specified recovery point. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPointInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationAlertSettingsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationAlertSettingsClient.java new file mode 100644 index 000000000000..3d6cdfa01585 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationAlertSettingsClient.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.AlertInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequest; + +/** An instance of this class provides access to all the operations defined in ReplicationAlertSettingsClient. */ +public interface ReplicationAlertSettingsClient { + /** + * Gets the list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 email notification(alert) configurations for the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 email notification(alert) configurations for the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets an email notification(alert) configuration. + * + *

Gets the details of the specified email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification configuration. + * @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 specified email notification(alert) configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String alertSettingName, Context context); + + /** + * Gets an email notification(alert) configuration. + * + *

Gets the details of the specified email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 specified email notification(alert) configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertInner get(String resourceName, String resourceGroupName, String alertSettingName); + + /** + * Configures email notifications for this vault. + * + *

Create or update an email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification(alert) configuration. + * @param request The input to configure the email notification(alert). + * @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 implements the Alert class along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceName, + String resourceGroupName, + String alertSettingName, + ConfigureAlertRequest request, + Context context); + + /** + * Configures email notifications for this vault. + * + *

Create or update an email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification(alert) configuration. + * @param request The input to configure the email notification(alert). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Alert class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertInner create( + String resourceName, String resourceGroupName, String alertSettingName, ConfigureAlertRequest request); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationAppliancesClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationAppliancesClient.java new file mode 100644 index 000000000000..4f9d3148f392 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationAppliancesClient.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.ReplicationApplianceInner; + +/** An instance of this class provides access to all the operations defined in ReplicationAppliancesClient. */ +public interface ReplicationAppliancesClient { + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Azure Site Recovery appliances for the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery appliances for the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceName, String resourceGroupName, String filter, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEligibilityResultsOperationsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEligibilityResultsOperationsClient.java new file mode 100644 index 000000000000..cfc959d38d65 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEligibilityResultsOperationsClient.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner; + +/** + * An instance of this class provides access to all the operations defined in + * ReplicationEligibilityResultsOperationsClient. + */ +public interface ReplicationEligibilityResultsOperationsClient { + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results collection response model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationEligibilityResultsCollectionInner list(String resourceGroupName, String virtualMachineName); + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results response model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationEligibilityResultsInner get(String resourceGroupName, String virtualMachineName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEventsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEventsClient.java new file mode 100644 index 000000000000..e266300b8b7e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEventsClient.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.EventInner; + +/** An instance of this class provides access to all the operations defined in ReplicationEventsClient. */ +public interface ReplicationEventsClient { + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Azure Site Recovery events for the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery events for the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context); + + /** + * Get the details of an Azure Site recovery event. + * + *

The operation to get the details of an Azure Site recovery event. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param eventName The name of the Azure Site Recovery event. + * @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 implements the Event class along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String eventName, Context context); + + /** + * Get the details of an Azure Site recovery event. + * + *

The operation to get the details of an Azure Site recovery event. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param eventName The name of the Azure Site Recovery event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Event class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventInner get(String resourceName, String resourceGroupName, String eventName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationFabricsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationFabricsClient.java new file mode 100644 index 000000000000..37fd7fea9f60 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationFabricsClient.java @@ -0,0 +1,593 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.FabricInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInput; + +/** An instance of this class provides access to all the operations defined in ReplicationFabricsClient. */ +public interface ReplicationFabricsClient { + /** + * Gets the list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the Azure Site Recovery fabrics in the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 a list of the Azure Site Recovery fabrics in the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the details of an ASR fabric. + * + *

Gets the details of an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Azure Site Recovery fabric along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String filter, Context context); + + /** + * Gets the details of an ASR fabric. + * + *

Gets the details of an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 an Azure Site Recovery fabric. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricInner get(String resourceName, String resourceGroupName, String fabricName); + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input); + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input, Context context); + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricInner create(String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input); + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricInner create( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input, Context context); + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginPurge(String resourceName, String resourceGroupName, String fabricName); + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @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> beginPurge( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 purge(String resourceName, String resourceGroupName, String fabricName); + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @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 purge(String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricInner> beginCheckConsistency( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 fabric definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricInner> beginCheckConsistency( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricInner checkConsistency(String resourceName, String resourceGroupName, String fabricName); + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 fabric definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricInner checkConsistency(String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginMigrateToAad( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @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> beginMigrateToAad( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 migrateToAad(String resourceName, String resourceGroupName, String fabricName); + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @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 migrateToAad(String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricInner> beginReassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest); + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 the {@link SyncPoller} for polling of fabric definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricInner> beginReassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context); + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricInner reassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest); + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 fabric definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricInner reassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context); + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceName, String resourceGroupName, String fabricName); + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @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 resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, String resourceGroupName, String fabricName); + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @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 resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricInner> beginRenewCertificate( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate); + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricInner> beginRenewCertificate( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context); + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricInner renewCertificate( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate); + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricInner renewCertificate( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationJobsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationJobsClient.java new file mode 100644 index 000000000000..1a69f42e5f4d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationJobsClient.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.JobInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobQueryParameter; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParams; + +/** An instance of this class provides access to all the operations defined in ReplicationJobsClient. */ +public interface ReplicationJobsClient { + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Azure Site Recovery Jobs for the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery Jobs for the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context); + + /** + * Gets the job details. + * + *

Get the details of an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @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 an Azure Site Recovery job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * Gets the job details. + * + *

Get the details of an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 an Azure Site Recovery job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner get(String resourceName, String resourceGroupName, String jobName); + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginCancel( + String resourceName, String resourceGroupName, String jobName); + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginCancel( + String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner cancel(String resourceName, String resourceGroupName, String jobName); + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner cancel(String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginRestart( + String resourceName, String resourceGroupName, String jobName); + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginRestart( + String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner restart(String resourceName, String resourceGroupName, String jobName); + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner restart(String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginResume( + String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams); + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginResume( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context); + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner resume(String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams); + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner resume( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context); + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginExport( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter); + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginExport( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context); + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner export(String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter); + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner export( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationLogicalNetworksClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationLogicalNetworksClient.java new file mode 100644 index 000000000000..d17eaaa1f091 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationLogicalNetworksClient.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner; + +/** An instance of this class provides access to all the operations defined in ReplicationLogicalNetworksClient. */ +public interface ReplicationLogicalNetworksClient { + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server 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 list of logical networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server 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 list of logical networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets a logical network with specified server id and logical network name. + * + *

Gets the details of a logical network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param logicalNetworkName Logical network 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 a logical network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName, Context context); + + /** + * Gets a logical network with specified server id and logical network name. + * + *

Gets the details of a logical network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param logicalNetworkName Logical network 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 a logical network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicalNetworkInner get( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationMigrationItemsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationMigrationItemsClient.java new file mode 100644 index 000000000000..e250b70b1f14 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationMigrationItemsClient.java @@ -0,0 +1,1084 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.MigrationItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInput; + +/** An instance of this class provides access to all the operations defined in ReplicationMigrationItemsClient. */ +public interface ReplicationMigrationItemsClient { + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR migration items in the protection container as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR migration items in the protection container as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String skipToken, + String takeToken, + String filter, + Context context); + + /** + * Gets the details of a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 a migration item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context); + + /** + * Gets the details of a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 a migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName); + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input); + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input, + Context context); + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input); + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input, + Context context); + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName); + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context); + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName); + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context); + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input); + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input, + Context context); + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input); + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input, + Context context); + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput); + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context); + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner migrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput); + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner migrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context); + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginPauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput); + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginPauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput, + Context context); + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner pauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput); + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner pauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput, + Context context); + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginResumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput); + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginResumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput, + Context context); + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner resumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput); + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner resumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput, + Context context); + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginResync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input); + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginResync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input, + Context context); + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner resync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input); + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner resync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input, + Context context); + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginTestMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput); + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginTestMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context); + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner testMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput); + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner testMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context); + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginTestMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput); + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationItemInner> beginTestMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context); + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner testMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput); + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @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 migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationItemInner testMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context); + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration items in the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of migration items in the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceName, + String resourceGroupName, + String skipToken, + String takeToken, + String filter, + Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworkMappingsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworkMappingsClient.java new file mode 100644 index 000000000000..a61db621ebbb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworkMappingsClient.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.NetworkMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInput; + +/** An instance of this class provides access to all the operations defined in ReplicationNetworkMappingsClient. */ +public interface ReplicationNetworkMappingsClient { + /** + * Gets all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName); + + /** + * Gets all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context); + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping 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 an ASR network mapping along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context); + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping 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 an ASR network mapping. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkMappingInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName); + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input); + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input, + Context context); + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input); + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input, + Context context); + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName); + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context); + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName); + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context); + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input); + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input, + Context context); + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkMappingInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input); + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkMappingInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input, + Context context); + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network mappings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 list of network mappings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworksClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworksClient.java new file mode 100644 index 000000000000..f67a8b5b74f9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworksClient.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.NetworkInner; + +/** An instance of this class provides access to all the operations defined in ReplicationNetworksClient. */ +public interface ReplicationNetworksClient { + /** + * Gets the list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets a network with specified server id and network name. + * + *

Gets the details of a network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param networkName Primary network 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 a network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context); + + /** + * Gets a network with specified server id and network name. + * + *

Gets the details of a network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param networkName Primary network 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 a network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInner get(String resourceName, String resourceGroupName, String fabricName, String networkName); + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 list of networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationPoliciesClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationPoliciesClient.java new file mode 100644 index 000000000000..9f542c81f03f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationPoliciesClient.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.PolicyInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInput; + +/** An instance of this class provides access to all the operations defined in ReplicationPoliciesClient. */ +public interface ReplicationPoliciesClient { + /** + * Gets the list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Profile Collection details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 protection Profile Collection details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the requested policy. + * + *

Gets the details of a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 a replication policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String policyName, Context context); + + /** + * Gets the requested policy. + * + *

Gets the details of a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 a replication policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyInner get(String resourceName, String resourceGroupName, String policyName); + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PolicyInner> beginCreate( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input); + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PolicyInner> beginCreate( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input, Context context); + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyInner create(String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input); + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyInner create( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input, Context context); + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName); + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName, Context context); + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName); + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName, Context context); + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PolicyInner> beginUpdate( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input); + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PolicyInner> beginUpdate( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input, Context context); + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyInner update(String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input); + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyInner update( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectableItemsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectableItemsClient.java new file mode 100644 index 000000000000..909f0b155562 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectableItemsClient.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.ProtectableItemInner; + +/** An instance of this class provides access to all the operations defined in ReplicationProtectableItemsClient. */ +public interface ReplicationProtectableItemsClient { + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protectable item collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param filter OData filter options. + * @param take take OData query parameter. + * @param skipToken skipToken OData query parameter. + * @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 protectable item collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + String take, + String skipToken, + Context context); + + /** + * Gets the details of a protectable item. + * + *

The operation to get the details of a protectable item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param protectableItemName Protectable 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 replication protected item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName, + Context context); + + /** + * Gets the details of a protectable item. + * + *

The operation to get the details of a protectable item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param protectableItemName Protectable 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectableItemInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectedItemsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectedItemsClient.java new file mode 100644 index 000000000000..3837d590050e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectedItemsClient.java @@ -0,0 +1,2115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInput; + +/** An instance of this class provides access to all the operations defined in ReplicationProtectedItemsClient. */ +public interface ReplicationProtectedItemsClient { + /** + * Gets the list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Gets the list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * Gets the details of a Replication protected item. + * + *

Gets the details of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 an ASR replication protected item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Gets the details of a Replication protected item. + * + *

Gets the details of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 an ASR replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input); + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input, + Context context); + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input); + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input, + Context context); + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput); + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput, + Context context); + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput); + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput, + Context context); + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginAddDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput); + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginAddDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context); + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner addDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput); + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner addDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context); + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginApplyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput); + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginApplyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context); + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner applyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput); + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner applyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context); + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginFailoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link SyncPoller} for polling of replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginFailoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner failoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner failoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginFailoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link SyncPoller} for polling of replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginFailoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner failoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner failoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput); + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context); + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput); + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context); + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput); + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context); + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput); + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context); + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginRemoveDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput); + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginRemoveDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context); + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner removeDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput); + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner removeDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context); + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginRepairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginRepairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner repairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner repairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginReprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput); + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginReprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput, + Context context); + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput); + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput, + Context context); + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginResolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput); + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginResolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context); + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner resolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput); + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner resolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context); + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginSwitchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput); + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginSwitchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput, + Context context); + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner switchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput); + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner switchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput, + Context context); + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput); + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput, + Context context); + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner testFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput); + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner testFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput, + Context context); + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput); + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context); + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner testFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput); + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner testFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context); + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput); + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context); + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput); + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context); + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginUpdateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput); + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginUpdateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + Context context); + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner updateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput); + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner updateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + Context context); + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginUpdateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest); + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationProtectedItemInner> beginUpdateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context); + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner updateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest); + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner updateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context); + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ASR replication protected items in the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR replication protected items in the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, String filter, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainerMappingsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainerMappingsClient.java new file mode 100644 index 000000000000..08964f61bb12 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainerMappingsClient.java @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput; + +/** + * An instance of this class provides access to all the operations defined in + * ReplicationProtectionContainerMappingsClient. + */ +public interface ReplicationProtectionContainerMappingsClient { + /** + * Gets the list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Gets the list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * Gets a protection container mapping. + * + *

Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping 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 a protection container mapping along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context); + + /** + * Gets a protection container mapping. + * + *

Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping 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 a protection container mapping. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerMappingInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName); + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput); + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput, + Context context); + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput); + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput, + Context context); + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName); + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context); + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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 purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName); + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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 purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context); + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput); + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput, + Context context); + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerMappingInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput); + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerMappingInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput, + Context context); + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput); + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context); + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput); + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context); + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainersClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainersClient.java new file mode 100644 index 000000000000..32034945f664 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainersClient.java @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput; + +/** An instance of this class provides access to all the operations defined in ReplicationProtectionContainersClient. */ +public interface ReplicationProtectionContainersClient { + /** + * Gets the list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets the protection container details. + * + *

Gets the details of a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 a protection container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * Gets the protection container details. + * + *

Gets the details of a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 a protection container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerInner get( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput); + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput, + Context context); + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput); + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @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 protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput, + Context context); + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerInner> beginDiscoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest); + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerInner> beginDiscoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context); + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerInner discoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest); + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @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 protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerInner discoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context); + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerInner> beginSwitchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput); + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectionContainerInner> beginSwitchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context); + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerInner switchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput); + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @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 protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerInner switchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context); + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Container collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 protection Container collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionIntentsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionIntentsClient.java new file mode 100644 index 000000000000..6490b159020b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionIntentsClient.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentInput; + +/** An instance of this class provides access to all the operations defined in ReplicationProtectionIntentsClient. */ +public interface ReplicationProtectionIntentsClient { + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ASR replication protection intent objects in the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @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 ASR replication protection intent objects in the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, String takeToken, Context context); + + /** + * Gets the details of a Replication protection intent item. + * + *

Gets the details of an ASR replication protection intent. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName Replication protection intent 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 an ASR replication protection intent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String intentObjectName, Context context); + + /** + * Gets the details of a Replication protection intent item. + * + *

Gets the details of an ASR replication protection intent. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName Replication protection intent 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 an ASR replication protection intent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectionIntentInner get(String resourceName, String resourceGroupName, String intentObjectName); + + /** + * Create protection intent Resource. + * + *

The operation to create an ASR replication protection intent item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName A name for the replication protection item. + * @param input Create Protection Intent Input. + * @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 protection intent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceName, + String resourceGroupName, + String intentObjectName, + CreateProtectionIntentInput input, + Context context); + + /** + * Create protection intent Resource. + * + *

The operation to create an ASR replication protection intent item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName A name for the replication protection item. + * @param input Create Protection Intent Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protection intent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectionIntentInner create( + String resourceName, String resourceGroupName, String intentObjectName, CreateProtectionIntentInput input); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryPlansClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryPlansClient.java new file mode 100644 index 000000000000..6ce7c463e265 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryPlansClient.java @@ -0,0 +1,865 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInput; + +/** An instance of this class provides access to all the operations defined in ReplicationRecoveryPlansClient. */ +public interface ReplicationRecoveryPlansClient { + /** + * Gets the list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan collection details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 recovery plan collection details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the requested recovery plan. + * + *

Gets the details of the recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Name of the recovery plan. + * @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 plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Gets the requested recovery plan. + * + *

Gets the details of the recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Name of the recovery plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner get(String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginCreate( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input); + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginCreate( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + CreateRecoveryPlanInput input, + Context context); + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner create( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input); + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner create( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + CreateRecoveryPlanInput input, + Context context); + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginUpdate( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input); + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginUpdate( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + UpdateRecoveryPlanInput input, + Context context); + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner update( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input); + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner update( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + UpdateRecoveryPlanInput input, + Context context); + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginFailoverCancel( + String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginFailoverCancel( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner failoverCancel(String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner failoverCancel( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginFailoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginFailoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner failoverCommit(String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner failoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginPlannedFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanPlannedFailoverInput input); + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context); + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner plannedFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanPlannedFailoverInput input); + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner plannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context); + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginReprotect( + String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginReprotect( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner reprotect(String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner reprotect( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginTestFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input); + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context); + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner testFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input); + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner testFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context); + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input); + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context); + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner testFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input); + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner testFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context); + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input); + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryPlanInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context); + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input); + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPlanInner unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryServicesProvidersClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryServicesProvidersClient.java new file mode 100644 index 000000000000..31ec0644965c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryServicesProvidersClient.java @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput; + +/** + * An instance of this class provides access to all the operations defined in + * ReplicationRecoveryServicesProvidersClient. + */ +public interface ReplicationRecoveryServicesProvidersClient { + /** + * Gets the list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets the details of a recovery services provider. + * + *

Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 registered recovery services provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Gets the details of a recovery services provider. + * + *

Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 registered recovery services provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryServicesProviderInner get( + String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput); + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput, + Context context); + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryServicesProviderInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput); + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @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 provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryServicesProviderInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput, + Context context); + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurge( + String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurge( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purge(String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purge(String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryServicesProviderInner refreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryServicesProviderInner refreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationMappingsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationMappingsClient.java new file mode 100644 index 000000000000..bb81f3b1adaa --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationMappingsClient.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingInput; + +/** + * An instance of this class provides access to all the operations defined in + * ReplicationStorageClassificationMappingsClient. + */ +public interface ReplicationStorageClassificationMappingsClient { + /** + * Gets the list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationStorageClassifications( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName); + + /** + * Gets the list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationStorageClassifications( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context); + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 specified storage classification mapping along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context); + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 specified storage classification mapping. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageClassificationMappingInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName); + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 storage mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageClassificationMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput); + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @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 storage mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageClassificationMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput, + Context context); + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageClassificationMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput); + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @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 storage mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageClassificationMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput, + Context context); + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName); + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context); + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName); + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context); + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationsClient.java new file mode 100644 index 000000000000..b2d4b0214b51 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationsClient.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.StorageClassificationInner; + +/** + * An instance of this class provides access to all the operations defined in ReplicationStorageClassificationsClient. + */ +public interface ReplicationStorageClassificationsClient { + /** + * Gets the list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @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 collection of storage details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets the details of a storage classification. + * + *

Gets the details of the specified storage classification. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 specified storage classification along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context); + + /** + * Gets the details of a storage classification. + * + *

Gets the details of the specified storage classification. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 specified storage classification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageClassificationInner get( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName); + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of storage details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultHealthsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultHealthsClient.java new file mode 100644 index 000000000000..bfc3848e3f85 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultHealthsClient.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.recoveryservicessiterecovery.fluent.models.VaultHealthDetailsInner; + +/** An instance of this class provides access to all the operations defined in ReplicationVaultHealthsClient. */ +public interface ReplicationVaultHealthsClient { + /** + * Gets the health summary for the vault. + * + *

Gets the health details of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 health details of the vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the health summary for the vault. + * + *

Gets the health details of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the health details of the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultHealthDetailsInner get(String resourceName, String resourceGroupName); + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 health details definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultHealthDetailsInner> beginRefresh( + String resourceName, String resourceGroupName); + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 health details definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultHealthDetailsInner> beginRefresh( + String resourceName, String resourceGroupName, Context context); + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 health details definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultHealthDetailsInner refresh(String resourceName, String resourceGroupName); + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 health details definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultHealthDetailsInner refresh(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultSettingsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultSettingsClient.java new file mode 100644 index 000000000000..cdfdcebffd29 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultSettingsClient.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.VaultSettingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInput; + +/** An instance of this class provides access to all the operations defined in ReplicationVaultSettingsClient. */ +public interface ReplicationVaultSettingsClient { + /** + * Gets the list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 vault setting as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 vault setting as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting 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 vault setting along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String vaultSettingName, Context context); + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting 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 vault setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultSettingInner get(String resourceName, String resourceGroupName, String vaultSettingName); + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 setting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultSettingInner> beginCreate( + String resourceName, String resourceGroupName, String vaultSettingName, VaultSettingCreationInput input); + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @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 setting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultSettingInner> beginCreate( + String resourceName, + String resourceGroupName, + String vaultSettingName, + VaultSettingCreationInput input, + Context context); + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultSettingInner create( + String resourceName, String resourceGroupName, String vaultSettingName, VaultSettingCreationInput input); + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @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 setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultSettingInner create( + String resourceName, + String resourceGroupName, + String vaultSettingName, + VaultSettingCreationInput input, + Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationvCentersClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationvCentersClient.java new file mode 100644 index 000000000000..07752fb9bb6b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationvCentersClient.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.VCenterInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequest; + +/** An instance of this class provides access to all the operations defined in ReplicationvCentersClient. */ +public interface ReplicationvCentersClient { + /** + * Gets the list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets the details of a vCenter. + * + *

Gets the details of a registered vCenter server(Add vCenter server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 a registered vCenter server(Add vCenter server) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context); + + /** + * Gets the details of a vCenter. + * + *

Gets the details of a registered vCenter server(Add vCenter server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 a registered vCenter server(Add vCenter server). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VCenterInner get(String resourceName, String resourceGroupName, String fabricName, String vcenterName); + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VCenterInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest); + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter 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 the {@link SyncPoller} for polling of vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VCenterInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest, + Context context); + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VCenterInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest); + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VCenterInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest, + Context context); + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName); + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context); + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName); + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context); + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VCenterInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest); + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter 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 the {@link SyncPoller} for polling of vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VCenterInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest, + Context context); + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VCenterInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest); + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VCenterInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest, + Context context); + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of vCenter details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of vCenter details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SiteRecoveryManagementClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SiteRecoveryManagementClient.java new file mode 100644 index 000000000000..110ce0c4f0ea --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SiteRecoveryManagementClient.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for SiteRecoveryManagementClient class. */ +public interface SiteRecoveryManagementClient { + /** + * Gets The subscription Id. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the ReplicationAlertSettingsClient object to access its operations. + * + * @return the ReplicationAlertSettingsClient object. + */ + ReplicationAlertSettingsClient getReplicationAlertSettings(); + + /** + * Gets the ReplicationAppliancesClient object to access its operations. + * + * @return the ReplicationAppliancesClient object. + */ + ReplicationAppliancesClient getReplicationAppliances(); + + /** + * Gets the ReplicationEligibilityResultsOperationsClient object to access its operations. + * + * @return the ReplicationEligibilityResultsOperationsClient object. + */ + ReplicationEligibilityResultsOperationsClient getReplicationEligibilityResultsOperations(); + + /** + * Gets the ReplicationEventsClient object to access its operations. + * + * @return the ReplicationEventsClient object. + */ + ReplicationEventsClient getReplicationEvents(); + + /** + * Gets the ReplicationFabricsClient object to access its operations. + * + * @return the ReplicationFabricsClient object. + */ + ReplicationFabricsClient getReplicationFabrics(); + + /** + * Gets the ReplicationLogicalNetworksClient object to access its operations. + * + * @return the ReplicationLogicalNetworksClient object. + */ + ReplicationLogicalNetworksClient getReplicationLogicalNetworks(); + + /** + * Gets the ReplicationNetworksClient object to access its operations. + * + * @return the ReplicationNetworksClient object. + */ + ReplicationNetworksClient getReplicationNetworks(); + + /** + * Gets the ReplicationNetworkMappingsClient object to access its operations. + * + * @return the ReplicationNetworkMappingsClient object. + */ + ReplicationNetworkMappingsClient getReplicationNetworkMappings(); + + /** + * Gets the ReplicationProtectionContainersClient object to access its operations. + * + * @return the ReplicationProtectionContainersClient object. + */ + ReplicationProtectionContainersClient getReplicationProtectionContainers(); + + /** + * Gets the ReplicationMigrationItemsClient object to access its operations. + * + * @return the ReplicationMigrationItemsClient object. + */ + ReplicationMigrationItemsClient getReplicationMigrationItems(); + + /** + * Gets the MigrationRecoveryPointsClient object to access its operations. + * + * @return the MigrationRecoveryPointsClient object. + */ + MigrationRecoveryPointsClient getMigrationRecoveryPoints(); + + /** + * Gets the ReplicationProtectableItemsClient object to access its operations. + * + * @return the ReplicationProtectableItemsClient object. + */ + ReplicationProtectableItemsClient getReplicationProtectableItems(); + + /** + * Gets the ReplicationProtectedItemsClient object to access its operations. + * + * @return the ReplicationProtectedItemsClient object. + */ + ReplicationProtectedItemsClient getReplicationProtectedItems(); + + /** + * Gets the RecoveryPointsClient object to access its operations. + * + * @return the RecoveryPointsClient object. + */ + RecoveryPointsClient getRecoveryPoints(); + + /** + * Gets the TargetComputeSizesClient object to access its operations. + * + * @return the TargetComputeSizesClient object. + */ + TargetComputeSizesClient getTargetComputeSizes(); + + /** + * Gets the ReplicationProtectionContainerMappingsClient object to access its operations. + * + * @return the ReplicationProtectionContainerMappingsClient object. + */ + ReplicationProtectionContainerMappingsClient getReplicationProtectionContainerMappings(); + + /** + * Gets the ReplicationRecoveryServicesProvidersClient object to access its operations. + * + * @return the ReplicationRecoveryServicesProvidersClient object. + */ + ReplicationRecoveryServicesProvidersClient getReplicationRecoveryServicesProviders(); + + /** + * Gets the ReplicationStorageClassificationsClient object to access its operations. + * + * @return the ReplicationStorageClassificationsClient object. + */ + ReplicationStorageClassificationsClient getReplicationStorageClassifications(); + + /** + * Gets the ReplicationStorageClassificationMappingsClient object to access its operations. + * + * @return the ReplicationStorageClassificationMappingsClient object. + */ + ReplicationStorageClassificationMappingsClient getReplicationStorageClassificationMappings(); + + /** + * Gets the ReplicationvCentersClient object to access its operations. + * + * @return the ReplicationvCentersClient object. + */ + ReplicationvCentersClient getReplicationvCenters(); + + /** + * Gets the ReplicationJobsClient object to access its operations. + * + * @return the ReplicationJobsClient object. + */ + ReplicationJobsClient getReplicationJobs(); + + /** + * Gets the ReplicationPoliciesClient object to access its operations. + * + * @return the ReplicationPoliciesClient object. + */ + ReplicationPoliciesClient getReplicationPolicies(); + + /** + * Gets the ReplicationProtectionIntentsClient object to access its operations. + * + * @return the ReplicationProtectionIntentsClient object. + */ + ReplicationProtectionIntentsClient getReplicationProtectionIntents(); + + /** + * Gets the ReplicationRecoveryPlansClient object to access its operations. + * + * @return the ReplicationRecoveryPlansClient object. + */ + ReplicationRecoveryPlansClient getReplicationRecoveryPlans(); + + /** + * Gets the SupportedOperatingSystemsOperationsClient object to access its operations. + * + * @return the SupportedOperatingSystemsOperationsClient object. + */ + SupportedOperatingSystemsOperationsClient getSupportedOperatingSystemsOperations(); + + /** + * Gets the ReplicationVaultHealthsClient object to access its operations. + * + * @return the ReplicationVaultHealthsClient object. + */ + ReplicationVaultHealthsClient getReplicationVaultHealths(); + + /** + * Gets the ReplicationVaultSettingsClient object to access its operations. + * + * @return the ReplicationVaultSettingsClient object. + */ + ReplicationVaultSettingsClient getReplicationVaultSettings(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SupportedOperatingSystemsOperationsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SupportedOperatingSystemsOperationsClient.java new file mode 100644 index 000000000000..c16408b3eb8c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SupportedOperatingSystemsOperationsClient.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner; + +/** + * An instance of this class provides access to all the operations defined in SupportedOperatingSystemsOperationsClient. + */ +public interface SupportedOperatingSystemsOperationsClient { + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param instanceType The instance type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String instanceType, Context context); + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportedOperatingSystemsInner get(String resourceName, String resourceGroupName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/TargetComputeSizesClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/TargetComputeSizesClient.java new file mode 100644 index 000000000000..d4593e06cdfc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/TargetComputeSizesClient.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner; + +/** An instance of this class provides access to all the operations defined in TargetComputeSizesClient. */ +public interface TargetComputeSizesClient { + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/AlertInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/AlertInner.java new file mode 100644 index 000000000000..68c36d9c721f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/AlertInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AlertProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Implements the Alert class. */ +@Fluent +public final class AlertInner extends ProxyResource { + /* + * Alert related data. + */ + @JsonProperty(value = "properties") + private AlertProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of AlertInner class. */ + public AlertInner() { + } + + /** + * Get the properties property: Alert related data. + * + * @return the properties value. + */ + public AlertProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Alert related data. + * + * @param properties the properties value to set. + * @return the AlertInner object itself. + */ + public AlertInner withProperties(AlertProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the AlertInner object itself. + */ + public AlertInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/EventInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/EventInner.java new file mode 100644 index 000000000000..3d57be6e9ac4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/EventInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EventProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Implements the Event class. */ +@Fluent +public final class EventInner extends ProxyResource { + /* + * Event related data. + */ + @JsonProperty(value = "properties") + private EventProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of EventInner class. */ + public EventInner() { + } + + /** + * Get the properties property: Event related data. + * + * @return the properties value. + */ + public EventProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Event related data. + * + * @param properties the properties value to set. + * @return the EventInner object itself. + */ + public EventInner withProperties(EventProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the EventInner object itself. + */ + public EventInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/FabricInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/FabricInner.java new file mode 100644 index 000000000000..8336d5e26e2e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/FabricInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Fabric definition. */ +@Fluent +public final class FabricInner extends ProxyResource { + /* + * Fabric related data. + */ + @JsonProperty(value = "properties") + private FabricProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of FabricInner class. */ + public FabricInner() { + } + + /** + * Get the properties property: Fabric related data. + * + * @return the properties value. + */ + public FabricProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Fabric related data. + * + * @param properties the properties value to set. + * @return the FabricInner object itself. + */ + public FabricInner withProperties(FabricProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the FabricInner object itself. + */ + public FabricInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/JobInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/JobInner.java new file mode 100644 index 000000000000..938477811ac9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/JobInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Job details. */ +@Fluent +public final class JobInner extends ProxyResource { + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private JobProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of JobInner class. */ + public JobInner() { + } + + /** + * Get the properties property: The custom data. + * + * @return the properties value. + */ + public JobProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The custom data. + * + * @param properties the properties value to set. + * @return the JobInner object itself. + */ + public JobInner withProperties(JobProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the JobInner object itself. + */ + public JobInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/LogicalNetworkInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/LogicalNetworkInner.java new file mode 100644 index 000000000000..f5717be39930 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/LogicalNetworkInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetworkProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Logical network data model. */ +@Fluent +public final class LogicalNetworkInner extends ProxyResource { + /* + * The Logical Network Properties. + */ + @JsonProperty(value = "properties") + private LogicalNetworkProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of LogicalNetworkInner class. */ + public LogicalNetworkInner() { + } + + /** + * Get the properties property: The Logical Network Properties. + * + * @return the properties value. + */ + public LogicalNetworkProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The Logical Network Properties. + * + * @param properties the properties value to set. + * @return the LogicalNetworkInner object itself. + */ + public LogicalNetworkInner withProperties(LogicalNetworkProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the LogicalNetworkInner object itself. + */ + public LogicalNetworkInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/MigrationItemInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/MigrationItemInner.java new file mode 100644 index 000000000000..67a87224c925 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/MigrationItemInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Migration item. */ +@Fluent +public final class MigrationItemInner extends ProxyResource { + /* + * The migration item properties. + */ + @JsonProperty(value = "properties") + private MigrationItemProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of MigrationItemInner class. */ + public MigrationItemInner() { + } + + /** + * Get the properties property: The migration item properties. + * + * @return the properties value. + */ + public MigrationItemProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The migration item properties. + * + * @param properties the properties value to set. + * @return the MigrationItemInner object itself. + */ + public MigrationItemInner withProperties(MigrationItemProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the MigrationItemInner object itself. + */ + public MigrationItemInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/MigrationRecoveryPointInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/MigrationRecoveryPointInner.java new file mode 100644 index 000000000000..30f6ce82265b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/MigrationRecoveryPointInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery point for a migration item. */ +@Fluent +public final class MigrationRecoveryPointInner extends ProxyResource { + /* + * Recovery point properties. + */ + @JsonProperty(value = "properties") + private MigrationRecoveryPointProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of MigrationRecoveryPointInner class. */ + public MigrationRecoveryPointInner() { + } + + /** + * Get the properties property: Recovery point properties. + * + * @return the properties value. + */ + public MigrationRecoveryPointProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Recovery point properties. + * + * @param properties the properties value to set. + * @return the MigrationRecoveryPointInner object itself. + */ + public MigrationRecoveryPointInner withProperties(MigrationRecoveryPointProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the MigrationRecoveryPointInner object itself. + */ + public MigrationRecoveryPointInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/NetworkInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/NetworkInner.java new file mode 100644 index 000000000000..d7280bf7300d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/NetworkInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network model. */ +@Fluent +public final class NetworkInner extends ProxyResource { + /* + * The Network Properties. + */ + @JsonProperty(value = "properties") + private NetworkProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of NetworkInner class. */ + public NetworkInner() { + } + + /** + * Get the properties property: The Network Properties. + * + * @return the properties value. + */ + public NetworkProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The Network Properties. + * + * @param properties the properties value to set. + * @return the NetworkInner object itself. + */ + public NetworkInner withProperties(NetworkProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the NetworkInner object itself. + */ + public NetworkInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/NetworkMappingInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/NetworkMappingInner.java new file mode 100644 index 000000000000..caecacbdf90b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/NetworkMappingInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network Mapping model. Ideally it should have been possible to inherit this class from prev version in + * InheritedModels as long as there is no difference in structure or method signature. Since there were no base Models + * for certain fields and methods viz NetworkMappingProperties and Load with required return type, the class has been + * introduced in its entirety with references to base models to facilitate extensions in subsequent versions. + */ +@Fluent +public final class NetworkMappingInner extends ProxyResource { + /* + * The Network Mapping Properties. + */ + @JsonProperty(value = "properties") + private NetworkMappingProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of NetworkMappingInner class. */ + public NetworkMappingInner() { + } + + /** + * Get the properties property: The Network Mapping Properties. + * + * @return the properties value. + */ + public NetworkMappingProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The Network Mapping Properties. + * + * @param properties the properties value to set. + * @return the NetworkMappingInner object itself. + */ + public NetworkMappingInner withProperties(NetworkMappingProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the NetworkMappingInner object itself. + */ + public NetworkMappingInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/OperationsDiscoveryInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/OperationsDiscoveryInner.java new file mode 100644 index 000000000000..b78663704e1f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/OperationsDiscoveryInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Display; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operations discovery class. */ +@Fluent +public final class OperationsDiscoveryInner { + /* + * Name of the API. The name of the operation being performed on this particular object. It should match the action + * name that appears in RBAC / the event service. Examples of operations include: * + * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * + * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * + * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace + * (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, + * Write, Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, + * Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a + * POST, Action should be used. As a note: all resource providers would need to include the "{Resource Provider + * Namespace}/register/action" operation in their response. This API is used to register for their service, and + * should include details about the operation (e.g. a localized name for the resource provider + any special + * considerations like PII release). + */ + @JsonProperty(value = "name") + private String name; + + /* + * Object type. + */ + @JsonProperty(value = "display") + private Display display; + + /* + * Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the + * audit logs UX. Default value is "user,system". + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties. Reserved for future use. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** Creates an instance of OperationsDiscoveryInner class. */ + public OperationsDiscoveryInner() { + } + + /** + * Get the name property: Name of the API. The name of the operation being performed on this particular object. It + * should match the action name that appears in RBAC / the event service. Examples of operations include: * + * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * + * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * + * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) + * Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, + * Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should + * be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action + * should be used. As a note: all resource providers would need to include the "{Resource Provider + * Namespace}/register/action" operation in their response. This API is used to register for their service, and + * should include details about the operation (e.g. a localized name for the resource provider + any special + * considerations like PII release). + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the API. The name of the operation being performed on this particular object. It + * should match the action name that appears in RBAC / the event service. Examples of operations include: * + * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * + * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * + * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) + * Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, + * Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should + * be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action + * should be used. As a note: all resource providers would need to include the "{Resource Provider + * Namespace}/register/action" operation in their response. This API is used to register for their service, and + * should include details about the operation (e.g. a localized name for the resource provider + any special + * considerations like PII release). + * + * @param name the name value to set. + * @return the OperationsDiscoveryInner object itself. + */ + public OperationsDiscoveryInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Object type. + * + * @return the display value. + */ + public Display display() { + return this.display; + } + + /** + * Set the display property: Object type. + * + * @param display the display value to set. + * @return the OperationsDiscoveryInner object itself. + */ + public OperationsDiscoveryInner withDisplay(Display display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin. The intended executor of the operation; governs the display of the operation in + * the RBAC UX and the audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin. The intended executor of the operation; governs the display of the operation in + * the RBAC UX and the audit logs UX. Default value is "user,system". + * + * @param origin the origin value to set. + * @return the OperationsDiscoveryInner object itself. + */ + public OperationsDiscoveryInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Properties. Reserved for future use. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Properties. Reserved for future use. + * + * @param properties the properties value to set. + * @return the OperationsDiscoveryInner object itself. + */ + public OperationsDiscoveryInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/PolicyInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/PolicyInner.java new file mode 100644 index 000000000000..f948c24ee817 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/PolicyInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection profile details. */ +@Fluent +public final class PolicyInner extends ProxyResource { + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private PolicyProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of PolicyInner class. */ + public PolicyInner() { + } + + /** + * Get the properties property: The custom data. + * + * @return the properties value. + */ + public PolicyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The custom data. + * + * @param properties the properties value to set. + * @return the PolicyInner object itself. + */ + public PolicyInner withProperties(PolicyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the PolicyInner object itself. + */ + public PolicyInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectableItemInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectableItemInner.java new file mode 100644 index 000000000000..65a6d182996c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectableItemInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItemProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication protected item. */ +@Fluent +public final class ProtectableItemInner extends ProxyResource { + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ProtectableItemProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of ProtectableItemInner class. */ + public ProtectableItemInner() { + } + + /** + * Get the properties property: The custom data. + * + * @return the properties value. + */ + public ProtectableItemProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The custom data. + * + * @param properties the properties value to set. + * @return the ProtectableItemInner object itself. + */ + public ProtectableItemInner withProperties(ProtectableItemProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the ProtectableItemInner object itself. + */ + public ProtectableItemInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectionContainerInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectionContainerInner.java new file mode 100644 index 000000000000..a0f2dc789359 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectionContainerInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection container details. */ +@Fluent +public final class ProtectionContainerInner extends ProxyResource { + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ProtectionContainerProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of ProtectionContainerInner class. */ + public ProtectionContainerInner() { + } + + /** + * Get the properties property: The custom data. + * + * @return the properties value. + */ + public ProtectionContainerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The custom data. + * + * @param properties the properties value to set. + * @return the ProtectionContainerInner object itself. + */ + public ProtectionContainerInner withProperties(ProtectionContainerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the ProtectionContainerInner object itself. + */ + public ProtectionContainerInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectionContainerMappingInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectionContainerMappingInner.java new file mode 100644 index 000000000000..c13c6f06c54a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ProtectionContainerMappingInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection container mapping object. */ +@Fluent +public final class ProtectionContainerMappingInner extends ProxyResource { + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ProtectionContainerMappingProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of ProtectionContainerMappingInner class. */ + public ProtectionContainerMappingInner() { + } + + /** + * Get the properties property: The custom data. + * + * @return the properties value. + */ + public ProtectionContainerMappingProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The custom data. + * + * @param properties the properties value to set. + * @return the ProtectionContainerMappingInner object itself. + */ + public ProtectionContainerMappingInner withProperties(ProtectionContainerMappingProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the ProtectionContainerMappingInner object itself. + */ + public ProtectionContainerMappingInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryPlanInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryPlanInner.java new file mode 100644 index 000000000000..25de3eb7c593 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryPlanInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan details. */ +@Fluent +public final class RecoveryPlanInner extends ProxyResource { + /* + * The custom details. + */ + @JsonProperty(value = "properties") + private RecoveryPlanProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of RecoveryPlanInner class. */ + public RecoveryPlanInner() { + } + + /** + * Get the properties property: The custom details. + * + * @return the properties value. + */ + public RecoveryPlanProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The custom details. + * + * @param properties the properties value to set. + * @return the RecoveryPlanInner object itself. + */ + public RecoveryPlanInner withProperties(RecoveryPlanProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the RecoveryPlanInner object itself. + */ + public RecoveryPlanInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryPointInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryPointInner.java new file mode 100644 index 000000000000..39a0215ba729 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryPointInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery point. */ +@Fluent +public final class RecoveryPointInner extends ProxyResource { + /* + * The recovery point properties. + */ + @JsonProperty(value = "properties") + private RecoveryPointProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of RecoveryPointInner class. */ + public RecoveryPointInner() { + } + + /** + * Get the properties property: The recovery point properties. + * + * @return the properties value. + */ + public RecoveryPointProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The recovery point properties. + * + * @param properties the properties value to set. + * @return the RecoveryPointInner object itself. + */ + public RecoveryPointInner withProperties(RecoveryPointProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the RecoveryPointInner object itself. + */ + public RecoveryPointInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryServicesProviderInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryServicesProviderInner.java new file mode 100644 index 000000000000..9c43790b841b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/RecoveryServicesProviderInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Provider details. */ +@Fluent +public final class RecoveryServicesProviderInner extends ProxyResource { + /* + * Provider properties. + */ + @JsonProperty(value = "properties") + private RecoveryServicesProviderProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of RecoveryServicesProviderInner class. */ + public RecoveryServicesProviderInner() { + } + + /** + * Get the properties property: Provider properties. + * + * @return the properties value. + */ + public RecoveryServicesProviderProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Provider properties. + * + * @param properties the properties value to set. + * @return the RecoveryServicesProviderInner object itself. + */ + public RecoveryServicesProviderInner withProperties(RecoveryServicesProviderProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the RecoveryServicesProviderInner object itself. + */ + public RecoveryServicesProviderInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationApplianceInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationApplianceInner.java new file mode 100644 index 000000000000..655d20f7aedb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationApplianceInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationApplianceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication appliance definition. */ +@Fluent +public final class ReplicationApplianceInner { + /* + * Appliance related data. + */ + @JsonProperty(value = "properties") + private ReplicationApplianceProperties properties; + + /** Creates an instance of ReplicationApplianceInner class. */ + public ReplicationApplianceInner() { + } + + /** + * Get the properties property: Appliance related data. + * + * @return the properties value. + */ + public ReplicationApplianceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Appliance related data. + * + * @param properties the properties value to set. + * @return the ReplicationApplianceInner object itself. + */ + public ReplicationApplianceInner withProperties(ReplicationApplianceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsCollectionInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsCollectionInner.java new file mode 100644 index 000000000000..cd771000f3b0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsCollectionInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication eligibility results collection response model. */ +@Fluent +public final class ReplicationEligibilityResultsCollectionInner { + /* + * The replication eligibility results details. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of ReplicationEligibilityResultsCollectionInner class. */ + public ReplicationEligibilityResultsCollectionInner() { + } + + /** + * Get the value property: The replication eligibility results details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The replication eligibility results details. + * + * @param value the value value to set. + * @return the ReplicationEligibilityResultsCollectionInner object itself. + */ + public ReplicationEligibilityResultsCollectionInner withValue(List value) { + this.value = value; + 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsInner.java new file mode 100644 index 000000000000..a7a36a12908e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication eligibility results response model. */ +@Immutable +public final class ReplicationEligibilityResultsInner { + /* + * Gets the name of this object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Gets the object type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Gets Unique ARM identifier for this object. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Gets properties model for replication eligibility results API. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationEligibilityResultsProperties properties; + + /** Creates an instance of ReplicationEligibilityResultsInner class. */ + public ReplicationEligibilityResultsInner() { + } + + /** + * Get the name property: Gets the name of this object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Gets the object type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the id property: Gets Unique ARM identifier for this object. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the properties property: Gets properties model for replication eligibility results API. + * + * @return the properties value. + */ + public ReplicationEligibilityResultsProperties properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationProtectedItemInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationProtectedItemInner.java new file mode 100644 index 000000000000..188be8996dca --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationProtectedItemInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication protected item. */ +@Fluent +public final class ReplicationProtectedItemInner extends ProxyResource { + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ReplicationProtectedItemProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of ReplicationProtectedItemInner class. */ + public ReplicationProtectedItemInner() { + } + + /** + * Get the properties property: The custom data. + * + * @return the properties value. + */ + public ReplicationProtectedItemProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The custom data. + * + * @param properties the properties value to set. + * @return the ReplicationProtectedItemInner object itself. + */ + public ReplicationProtectedItemInner withProperties(ReplicationProtectedItemProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the ReplicationProtectedItemInner object itself. + */ + public ReplicationProtectedItemInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationProtectionIntentInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationProtectionIntentInner.java new file mode 100644 index 000000000000..58ebcc1065cc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationProtectionIntentInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication protection intent. */ +@Fluent +public final class ReplicationProtectionIntentInner extends ProxyResource { + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ReplicationProtectionIntentProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of ReplicationProtectionIntentInner class. */ + public ReplicationProtectionIntentInner() { + } + + /** + * Get the properties property: The custom data. + * + * @return the properties value. + */ + public ReplicationProtectionIntentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The custom data. + * + * @param properties the properties value to set. + * @return the ReplicationProtectionIntentInner object itself. + */ + public ReplicationProtectionIntentInner withProperties(ReplicationProtectionIntentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the ReplicationProtectionIntentInner object itself. + */ + public ReplicationProtectionIntentInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/StorageClassificationInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/StorageClassificationInner.java new file mode 100644 index 000000000000..9e5b9f0c306f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/StorageClassificationInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage object definition. */ +@Fluent +public final class StorageClassificationInner extends ProxyResource { + /* + * Properties of the storage object. + */ + @JsonProperty(value = "properties") + private StorageClassificationProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of StorageClassificationInner class. */ + public StorageClassificationInner() { + } + + /** + * Get the properties property: Properties of the storage object. + * + * @return the properties value. + */ + public StorageClassificationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the storage object. + * + * @param properties the properties value to set. + * @return the StorageClassificationInner object itself. + */ + public StorageClassificationInner withProperties(StorageClassificationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the StorageClassificationInner object itself. + */ + public StorageClassificationInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/StorageClassificationMappingInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/StorageClassificationMappingInner.java new file mode 100644 index 000000000000..aa06a1e76bed --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/StorageClassificationMappingInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage mapping object. */ +@Fluent +public final class StorageClassificationMappingInner extends ProxyResource { + /* + * Properties of the storage mapping object. + */ + @JsonProperty(value = "properties") + private StorageClassificationMappingProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of StorageClassificationMappingInner class. */ + public StorageClassificationMappingInner() { + } + + /** + * Get the properties property: Properties of the storage mapping object. + * + * @return the properties value. + */ + public StorageClassificationMappingProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the storage mapping object. + * + * @param properties the properties value to set. + * @return the StorageClassificationMappingInner object itself. + */ + public StorageClassificationMappingInner withProperties(StorageClassificationMappingProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the StorageClassificationMappingInner object itself. + */ + public StorageClassificationMappingInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/SupportedOperatingSystemsInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/SupportedOperatingSystemsInner.java new file mode 100644 index 000000000000..944477364899 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/SupportedOperatingSystemsInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOSProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported operating systems. */ +@Fluent +public final class SupportedOperatingSystemsInner extends ProxyResource { + /* + * The supported operating systems properties. + */ + @JsonProperty(value = "properties") + private SupportedOSProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of SupportedOperatingSystemsInner class. */ + public SupportedOperatingSystemsInner() { + } + + /** + * Get the properties property: The supported operating systems properties. + * + * @return the properties value. + */ + public SupportedOSProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The supported operating systems properties. + * + * @param properties the properties value to set. + * @return the SupportedOperatingSystemsInner object itself. + */ + public SupportedOperatingSystemsInner withProperties(SupportedOSProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the SupportedOperatingSystemsInner object itself. + */ + public SupportedOperatingSystemsInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/TargetComputeSizeInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/TargetComputeSizeInner.java new file mode 100644 index 000000000000..5974967c25be --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/TargetComputeSizeInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizeProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents applicable recovery vm sizes. */ +@Fluent +public final class TargetComputeSizeInner { + /* + * The Id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The Type of the object. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private TargetComputeSizeProperties properties; + + /** Creates an instance of TargetComputeSizeInner class. */ + public TargetComputeSizeInner() { + } + + /** + * Get the id property: The Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The Id. + * + * @param id the id value to set. + * @return the TargetComputeSizeInner object itself. + */ + public TargetComputeSizeInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name. + * + * @param name the name value to set. + * @return the TargetComputeSizeInner object itself. + */ + public TargetComputeSizeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The Type of the object. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The Type of the object. + * + * @param type the type value to set. + * @return the TargetComputeSizeInner object itself. + */ + public TargetComputeSizeInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the properties property: The custom data. + * + * @return the properties value. + */ + public TargetComputeSizeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The custom data. + * + * @param properties the properties value to set. + * @return the TargetComputeSizeInner object itself. + */ + public TargetComputeSizeInner withProperties(TargetComputeSizeProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VCenterInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VCenterInner.java new file mode 100644 index 000000000000..749fb5ed62a1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VCenterInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenterProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** vCenter definition. */ +@Fluent +public final class VCenterInner extends ProxyResource { + /* + * VCenter related data. + */ + @JsonProperty(value = "properties") + private VCenterProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of VCenterInner class. */ + public VCenterInner() { + } + + /** + * Get the properties property: VCenter related data. + * + * @return the properties value. + */ + public VCenterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: VCenter related data. + * + * @param properties the properties value to set. + * @return the VCenterInner object itself. + */ + public VCenterInner withProperties(VCenterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the VCenterInner object itself. + */ + public VCenterInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VaultHealthDetailsInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VaultHealthDetailsInner.java new file mode 100644 index 000000000000..1bb508cf9722 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VaultHealthDetailsInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultHealthProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault health details definition. */ +@Fluent +public final class VaultHealthDetailsInner extends ProxyResource { + /* + * The vault health related data. + */ + @JsonProperty(value = "properties") + private VaultHealthProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of VaultHealthDetailsInner class. */ + public VaultHealthDetailsInner() { + } + + /** + * Get the properties property: The vault health related data. + * + * @return the properties value. + */ + public VaultHealthProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The vault health related data. + * + * @param properties the properties value to set. + * @return the VaultHealthDetailsInner object itself. + */ + public VaultHealthDetailsInner withProperties(VaultHealthProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the VaultHealthDetailsInner object itself. + */ + public VaultHealthDetailsInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VaultSettingInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VaultSettingInner.java new file mode 100644 index 000000000000..efa746a6fbbf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/VaultSettingInner.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.recoveryservicessiterecovery.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault setting. */ +@Fluent +public final class VaultSettingInner extends ProxyResource { + /* + * The vault setting properties. + */ + @JsonProperty(value = "properties") + private VaultSettingProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of VaultSettingInner class. */ + public VaultSettingInner() { + } + + /** + * Get the properties property: The vault setting properties. + * + * @return the properties value. + */ + public VaultSettingProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The vault setting properties. + * + * @param properties the properties value to set. + * @return the VaultSettingInner object itself. + */ + public VaultSettingInner withProperties(VaultSettingProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource Location. + * + * @param location the location value to set. + * @return the VaultSettingInner object itself. + */ + public VaultSettingInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/package-info.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/package-info.java new file mode 100644 index 000000000000..3c738e004489 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for SiteRecoveryManagementClient. null. */ +package com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models; diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/package-info.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/package-info.java new file mode 100644 index 000000000000..530afe9a082d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for SiteRecoveryManagementClient. null. */ +package com.azure.resourcemanager.recoveryservicessiterecovery.fluent; diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/AlertImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/AlertImpl.java new file mode 100644 index 000000000000..cbcddef106d2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/AlertImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.AlertInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Alert; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AlertProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties; + +public final class AlertImpl implements Alert, Alert.Definition { + private AlertInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + AlertImpl( + AlertInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 AlertProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public AlertInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String alertSettingName; + + private ConfigureAlertRequest createRequest; + + public AlertImpl withExistingVault(String resourceName, String resourceGroupName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public Alert create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationAlertSettings() + .createWithResponse(resourceName, resourceGroupName, alertSettingName, createRequest, Context.NONE) + .getValue(); + return this; + } + + public Alert create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationAlertSettings() + .createWithResponse(resourceName, resourceGroupName, alertSettingName, createRequest, context) + .getValue(); + return this; + } + + AlertImpl(String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new AlertInner(); + this.serviceManager = serviceManager; + this.alertSettingName = name; + this.createRequest = new ConfigureAlertRequest(); + } + + public Alert refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationAlertSettings() + .getWithResponse(resourceName, resourceGroupName, alertSettingName, Context.NONE) + .getValue(); + return this; + } + + public Alert refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationAlertSettings() + .getWithResponse(resourceName, resourceGroupName, alertSettingName, context) + .getValue(); + return this; + } + + public AlertImpl withProperties(ConfigureAlertRequestProperties properties) { + this.createRequest.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/EventImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/EventImpl.java new file mode 100644 index 000000000000..667334a1f756 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/EventImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.EventInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Event; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EventProperties; + +public final class EventImpl implements Event { + private EventInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + EventImpl( + EventInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 EventProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public EventInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/FabricImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/FabricImpl.java new file mode 100644 index 000000000000..33e00483446c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/FabricImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.FabricInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Fabric; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInput; + +public final class FabricImpl implements Fabric, Fabric.Definition { + private FabricInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + FabricImpl( + FabricInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 FabricProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public FabricInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String fabricName; + + private FabricCreationInput createInput; + + public FabricImpl withExistingVault(String resourceName, String resourceGroupName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public Fabric create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationFabrics() + .create(resourceName, resourceGroupName, fabricName, createInput, Context.NONE); + return this; + } + + public Fabric create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationFabrics() + .create(resourceName, resourceGroupName, fabricName, createInput, context); + return this; + } + + FabricImpl(String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new FabricInner(); + this.serviceManager = serviceManager; + this.fabricName = name; + this.createInput = new FabricCreationInput(); + } + + public Fabric refresh() { + String localFilter = null; + this.innerObject = + serviceManager + .serviceClient() + .getReplicationFabrics() + .getWithResponse(resourceName, resourceGroupName, fabricName, localFilter, Context.NONE) + .getValue(); + return this; + } + + public Fabric refresh(Context context) { + String localFilter = null; + this.innerObject = + serviceManager + .serviceClient() + .getReplicationFabrics() + .getWithResponse(resourceName, resourceGroupName, fabricName, localFilter, context) + .getValue(); + return this; + } + + public Fabric checkConsistency() { + return serviceManager.replicationFabrics().checkConsistency(resourceName, resourceGroupName, fabricName); + } + + public Fabric checkConsistency(Context context) { + return serviceManager + .replicationFabrics() + .checkConsistency(resourceName, resourceGroupName, fabricName, context); + } + + public void migrateToAad() { + serviceManager.replicationFabrics().migrateToAad(resourceName, resourceGroupName, fabricName); + } + + public void migrateToAad(Context context) { + serviceManager.replicationFabrics().migrateToAad(resourceName, resourceGroupName, fabricName, context); + } + + public Fabric reassociateGateway(FailoverProcessServerRequest failoverProcessServerRequest) { + return serviceManager + .replicationFabrics() + .reassociateGateway(resourceName, resourceGroupName, fabricName, failoverProcessServerRequest); + } + + public Fabric reassociateGateway(FailoverProcessServerRequest failoverProcessServerRequest, Context context) { + return serviceManager + .replicationFabrics() + .reassociateGateway(resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, context); + } + + public void delete() { + serviceManager.replicationFabrics().delete(resourceName, resourceGroupName, fabricName); + } + + public void delete(Context context) { + serviceManager.replicationFabrics().delete(resourceName, resourceGroupName, fabricName, context); + } + + public Fabric renewCertificate(RenewCertificateInput renewCertificate) { + return serviceManager + .replicationFabrics() + .renewCertificate(resourceName, resourceGroupName, fabricName, renewCertificate); + } + + public Fabric renewCertificate(RenewCertificateInput renewCertificate, Context context) { + return serviceManager + .replicationFabrics() + .renewCertificate(resourceName, resourceGroupName, fabricName, renewCertificate, context); + } + + public FabricImpl withProperties(FabricCreationInputProperties properties) { + this.createInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/JobImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/JobImpl.java new file mode 100644 index 000000000000..8f795d88ba01 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/JobImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.JobInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Job; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobProperties; + +public final class JobImpl implements Job { + private JobInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + JobImpl( + JobInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 JobProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public JobInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/LogicalNetworkImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/LogicalNetworkImpl.java new file mode 100644 index 000000000000..590a54832702 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/LogicalNetworkImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetwork; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetworkProperties; + +public final class LogicalNetworkImpl implements LogicalNetwork { + private LogicalNetworkInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + LogicalNetworkImpl( + LogicalNetworkInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 LogicalNetworkProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public LogicalNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationItemImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationItemImpl.java new file mode 100644 index 000000000000..bfcb6ec7f77d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationItemImpl.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInputProperties; + +public final class MigrationItemImpl implements MigrationItem, MigrationItem.Definition, MigrationItem.Update { + private MigrationItemInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public MigrationItemProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MigrationItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String fabricName; + + private String protectionContainerName; + + private String migrationItemName; + + private EnableMigrationInput createInput; + + private UpdateMigrationItemInput updateInput; + + public MigrationItemImpl withExistingReplicationProtectionContainer( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + this.protectionContainerName = protectionContainerName; + return this; + } + + public MigrationItem create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationMigrationItems() + .create( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + createInput, + Context.NONE); + return this; + } + + public MigrationItem create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationMigrationItems() + .create( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + createInput, + context); + return this; + } + + MigrationItemImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new MigrationItemInner(); + this.serviceManager = serviceManager; + this.migrationItemName = name; + this.createInput = new EnableMigrationInput(); + } + + public MigrationItemImpl update() { + this.updateInput = new UpdateMigrationItemInput(); + return this; + } + + public MigrationItem apply() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationMigrationItems() + .update( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + updateInput, + Context.NONE); + return this; + } + + public MigrationItem apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationMigrationItems() + .update( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + updateInput, + context); + return this; + } + + MigrationItemImpl( + MigrationItemInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fabricName = Utils.getValueFromIdByName(innerObject.id(), "replicationFabrics"); + this.protectionContainerName = Utils.getValueFromIdByName(innerObject.id(), "replicationProtectionContainers"); + this.migrationItemName = Utils.getValueFromIdByName(innerObject.id(), "replicationMigrationItems"); + } + + public MigrationItem refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationMigrationItems() + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + Context.NONE) + .getValue(); + return this; + } + + public MigrationItem refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationMigrationItems() + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, context) + .getValue(); + return this; + } + + public MigrationItem migrate(MigrateInput migrateInput) { + return serviceManager + .replicationMigrationItems() + .migrate( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrateInput); + } + + public MigrationItem migrate(MigrateInput migrateInput, Context context) { + return serviceManager + .replicationMigrationItems() + .migrate( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput, + context); + } + + public MigrationItem pauseReplication(PauseReplicationInput pauseReplicationInput) { + return serviceManager + .replicationMigrationItems() + .pauseReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput); + } + + public MigrationItem pauseReplication(PauseReplicationInput pauseReplicationInput, Context context) { + return serviceManager + .replicationMigrationItems() + .pauseReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + context); + } + + public MigrationItem resumeReplication(ResumeReplicationInput resumeReplicationInput) { + return serviceManager + .replicationMigrationItems() + .resumeReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput); + } + + public MigrationItem resumeReplication(ResumeReplicationInput resumeReplicationInput, Context context) { + return serviceManager + .replicationMigrationItems() + .resumeReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + context); + } + + public MigrationItem resync(ResyncInput input) { + return serviceManager + .replicationMigrationItems() + .resync(resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input); + } + + public MigrationItem resync(ResyncInput input, Context context) { + return serviceManager + .replicationMigrationItems() + .resync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input, + context); + } + + public MigrationItem testMigrate(TestMigrateInput testMigrateInput) { + return serviceManager + .replicationMigrationItems() + .testMigrate( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput); + } + + public MigrationItem testMigrate(TestMigrateInput testMigrateInput, Context context) { + return serviceManager + .replicationMigrationItems() + .testMigrate( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput, + context); + } + + public MigrationItem testMigrateCleanup(TestMigrateCleanupInput testMigrateCleanupInput) { + return serviceManager + .replicationMigrationItems() + .testMigrateCleanup( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput); + } + + public MigrationItem testMigrateCleanup(TestMigrateCleanupInput testMigrateCleanupInput, Context context) { + return serviceManager + .replicationMigrationItems() + .testMigrateCleanup( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput, + context); + } + + public MigrationItemImpl withProperties(EnableMigrationInputProperties properties) { + this.createInput.withProperties(properties); + return this; + } + + public MigrationItemImpl withProperties(UpdateMigrationItemInputProperties properties) { + this.updateInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointImpl.java new file mode 100644 index 000000000000..94d7563b71c4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPoint; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointProperties; + +public final class MigrationRecoveryPointImpl implements MigrationRecoveryPoint { + private MigrationRecoveryPointInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + MigrationRecoveryPointImpl( + MigrationRecoveryPointInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 MigrationRecoveryPointProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public MigrationRecoveryPointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsClientImpl.java new file mode 100644 index 000000000000..8245f9931caf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsClientImpl.java @@ -0,0 +1,715 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.MigrationRecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MigrationRecoveryPointsClient. */ +public final class MigrationRecoveryPointsClientImpl implements MigrationRecoveryPointsClient { + /** The proxy service used to perform REST calls. */ + private final MigrationRecoveryPointsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of MigrationRecoveryPointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MigrationRecoveryPointsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create(MigrationRecoveryPointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientMigrationRecoveryPoints to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface MigrationRecoveryPointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationMigrationItems( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints" + + "/{migrationRecoveryPointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @PathParam("migrationRecoveryPointName") String migrationRecoveryPointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationMigrationItemsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationMigrationItemsSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByReplicationMigrationItems( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationMigrationItemsSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationMigrationItems( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationMigrationItemsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + return new PagedFlux<>( + () -> + listByReplicationMigrationItemsSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName), + nextLink -> listByReplicationMigrationItemsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationMigrationItemsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context) { + return new PagedFlux<>( + () -> + listByReplicationMigrationItemsSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, context), + nextLink -> listByReplicationMigrationItemsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationMigrationItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + return new PagedIterable<>( + listByReplicationMigrationItemsAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName)); + } + + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationMigrationItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context) { + return new PagedIterable<>( + listByReplicationMigrationItemsAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, context)); + } + + /** + * Gets a recovery point for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrationRecoveryPointName The migration 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 a recovery point for a migration item along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (migrationRecoveryPointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter migrationRecoveryPointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a recovery point for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrationRecoveryPointName The migration 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 a recovery point for a migration item along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (migrationRecoveryPointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter migrationRecoveryPointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName, + accept, + context); + } + + /** + * Gets a recovery point for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrationRecoveryPointName The migration 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 a recovery point for a migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName) { + return getWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a recovery point for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrationRecoveryPointName The migration 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 a recovery point for a migration item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName, + Context context) { + return getWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName, + context) + .block(); + } + + /** + * Gets a recovery point for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrationRecoveryPointName The migration 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 a recovery point for a migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationRecoveryPointInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName) { + return getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName, + Context.NONE) + .getValue(); + } + + /** + * 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 collection of migration recovery points along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationMigrationItemsNextSinglePageAsync( + 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.listByReplicationMigrationItemsNext(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 collection of migration recovery points along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationMigrationItemsNextSinglePageAsync( + 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 + .listByReplicationMigrationItemsNext(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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsImpl.java new file mode 100644 index 000000000000..9a50fa045178 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.MigrationRecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPoint; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPoints; + +public final class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { + private static final ClientLogger LOGGER = new ClientLogger(MigrationRecoveryPointsImpl.class); + + private final MigrationRecoveryPointsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public MigrationRecoveryPointsImpl( + MigrationRecoveryPointsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationMigrationItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationMigrationItems( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName); + return Utils.mapPage(inner, inner1 -> new MigrationRecoveryPointImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationMigrationItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationMigrationItems( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, context); + return Utils.mapPage(inner, inner1 -> new MigrationRecoveryPointImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MigrationRecoveryPointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MigrationRecoveryPoint get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName) { + MigrationRecoveryPointInner inner = + this + .serviceClient() + .get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName); + if (inner != null) { + return new MigrationRecoveryPointImpl(inner, this.manager()); + } else { + return null; + } + } + + private MigrationRecoveryPointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/NetworkImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/NetworkImpl.java new file mode 100644 index 000000000000..213bca89a041 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/NetworkImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Network; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkProperties; + +public final class NetworkImpl implements Network { + private NetworkInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + NetworkImpl( + NetworkInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 NetworkProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public NetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/NetworkMappingImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/NetworkMappingImpl.java new file mode 100644 index 000000000000..67c3a6d107e0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/NetworkMappingImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInputProperties; + +public final class NetworkMappingImpl implements NetworkMapping, NetworkMapping.Definition, NetworkMapping.Update { + private NetworkMappingInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public NetworkMappingProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkMappingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String fabricName; + + private String networkName; + + private String networkMappingName; + + private CreateNetworkMappingInput createInput; + + private UpdateNetworkMappingInput updateInput; + + public NetworkMappingImpl withExistingReplicationNetwork( + String resourceName, String resourceGroupName, String fabricName, String networkName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + this.networkName = networkName; + return this; + } + + public NetworkMapping create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationNetworkMappings() + .create( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + createInput, + Context.NONE); + return this; + } + + public NetworkMapping create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationNetworkMappings() + .create( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, createInput, context); + return this; + } + + NetworkMappingImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new NetworkMappingInner(); + this.serviceManager = serviceManager; + this.networkMappingName = name; + this.createInput = new CreateNetworkMappingInput(); + } + + public NetworkMappingImpl update() { + this.updateInput = new UpdateNetworkMappingInput(); + return this; + } + + public NetworkMapping apply() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationNetworkMappings() + .update( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + updateInput, + Context.NONE); + return this; + } + + public NetworkMapping apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationNetworkMappings() + .update( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, updateInput, context); + return this; + } + + NetworkMappingImpl( + NetworkMappingInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fabricName = Utils.getValueFromIdByName(innerObject.id(), "replicationFabrics"); + this.networkName = Utils.getValueFromIdByName(innerObject.id(), "replicationNetworks"); + this.networkMappingName = Utils.getValueFromIdByName(innerObject.id(), "replicationNetworkMappings"); + } + + public NetworkMapping refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationNetworkMappings() + .getWithResponse( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, Context.NONE) + .getValue(); + return this; + } + + public NetworkMapping refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationNetworkMappings() + .getWithResponse(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context) + .getValue(); + return this; + } + + public NetworkMappingImpl withProperties(CreateNetworkMappingInputProperties properties) { + this.createInput.withProperties(properties); + return this; + } + + public NetworkMappingImpl withProperties(UpdateNetworkMappingInputProperties properties) { + this.updateInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..b733f95bc11e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsClientImpl.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.OperationsDiscoveryCollection; +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 SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @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); + } + + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + 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())); + } + + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 collection of ClientDiscovery details 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 collection of ClientDiscovery details 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsDiscoveryImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsDiscoveryImpl.java new file mode 100644 index 000000000000..f9fc5e231956 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsDiscoveryImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Display; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.OperationsDiscovery; + +public final class OperationsDiscoveryImpl implements OperationsDiscovery { + private OperationsDiscoveryInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + OperationsDiscoveryImpl( + OperationsDiscoveryInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Display display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationsDiscoveryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsImpl.java new file mode 100644 index 000000000000..b03ddf3f720a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Operations; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.OperationsDiscovery; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new OperationsDiscoveryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new OperationsDiscoveryImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/PolicyImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/PolicyImpl.java new file mode 100644 index 000000000000..a1dc259efaf7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/PolicyImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.PolicyInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Policy; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInputProperties; + +public final class PolicyImpl implements Policy, Policy.Definition, Policy.Update { + private PolicyInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PolicyProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String policyName; + + private CreatePolicyInput createInput; + + private UpdatePolicyInput updateInput; + + public PolicyImpl withExistingVault(String resourceName, String resourceGroupName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public Policy create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationPolicies() + .create(resourceName, resourceGroupName, policyName, createInput, Context.NONE); + return this; + } + + public Policy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationPolicies() + .create(resourceName, resourceGroupName, policyName, createInput, context); + return this; + } + + PolicyImpl(String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new PolicyInner(); + this.serviceManager = serviceManager; + this.policyName = name; + this.createInput = new CreatePolicyInput(); + } + + public PolicyImpl update() { + this.updateInput = new UpdatePolicyInput(); + return this; + } + + public Policy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationPolicies() + .update(resourceName, resourceGroupName, policyName, updateInput, Context.NONE); + return this; + } + + public Policy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationPolicies() + .update(resourceName, resourceGroupName, policyName, updateInput, context); + return this; + } + + PolicyImpl( + PolicyInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.policyName = Utils.getValueFromIdByName(innerObject.id(), "replicationPolicies"); + } + + public Policy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationPolicies() + .getWithResponse(resourceName, resourceGroupName, policyName, Context.NONE) + .getValue(); + return this; + } + + public Policy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationPolicies() + .getWithResponse(resourceName, resourceGroupName, policyName, context) + .getValue(); + return this; + } + + public PolicyImpl withProperties(CreatePolicyInputProperties properties) { + this.createInput.withProperties(properties); + return this; + } + + public PolicyImpl withProperties(UpdatePolicyInputProperties properties) { + this.updateInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectableItemImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectableItemImpl.java new file mode 100644 index 000000000000..72b2669f2aff --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectableItemImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectableItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItemProperties; + +public final class ProtectableItemImpl implements ProtectableItem { + private ProtectableItemInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + ProtectableItemImpl( + ProtectableItemInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 ProtectableItemProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public ProtectableItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectionContainerImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectionContainerImpl.java new file mode 100644 index 000000000000..40736062caf5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectionContainerImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainer; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput; + +public final class ProtectionContainerImpl implements ProtectionContainer, ProtectionContainer.Definition { + private ProtectionContainerInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + ProtectionContainerImpl( + ProtectionContainerInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 ProtectionContainerProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ProtectionContainerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String fabricName; + + private String protectionContainerName; + + private CreateProtectionContainerInput createCreationInput; + + public ProtectionContainerImpl withExistingReplicationFabric( + String resourceName, String resourceGroupName, String fabricName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + return this; + } + + public ProtectionContainer create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainers() + .create( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + createCreationInput, + Context.NONE); + return this; + } + + public ProtectionContainer create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainers() + .create( + resourceName, resourceGroupName, fabricName, protectionContainerName, createCreationInput, context); + return this; + } + + ProtectionContainerImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new ProtectionContainerInner(); + this.serviceManager = serviceManager; + this.protectionContainerName = name; + this.createCreationInput = new CreateProtectionContainerInput(); + } + + public ProtectionContainer refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainers() + .getWithResponse(resourceName, resourceGroupName, fabricName, protectionContainerName, Context.NONE) + .getValue(); + return this; + } + + public ProtectionContainer refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainers() + .getWithResponse(resourceName, resourceGroupName, fabricName, protectionContainerName, context) + .getValue(); + return this; + } + + public ProtectionContainer discoverProtectableItem(DiscoverProtectableItemRequest discoverProtectableItemRequest) { + return serviceManager + .replicationProtectionContainers() + .discoverProtectableItem( + resourceName, resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest); + } + + public ProtectionContainer discoverProtectableItem( + DiscoverProtectableItemRequest discoverProtectableItemRequest, Context context) { + return serviceManager + .replicationProtectionContainers() + .discoverProtectableItem( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest, + context); + } + + public void delete() { + serviceManager + .replicationProtectionContainers() + .delete(resourceName, resourceGroupName, fabricName, protectionContainerName); + } + + public void delete(Context context) { + serviceManager + .replicationProtectionContainers() + .delete(resourceName, resourceGroupName, fabricName, protectionContainerName, context); + } + + public ProtectionContainer switchProtection(SwitchProtectionInput switchInput) { + return serviceManager + .replicationProtectionContainers() + .switchProtection(resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput); + } + + public ProtectionContainer switchProtection(SwitchProtectionInput switchInput, Context context) { + return serviceManager + .replicationProtectionContainers() + .switchProtection( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, context); + } + + public ProtectionContainerImpl withProperties(CreateProtectionContainerInputProperties properties) { + this.createCreationInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectionContainerMappingImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectionContainerMappingImpl.java new file mode 100644 index 000000000000..849a120e9fad --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectionContainerMappingImpl.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties; + +public final class ProtectionContainerMappingImpl + implements ProtectionContainerMapping, ProtectionContainerMapping.Definition, ProtectionContainerMapping.Update { + private ProtectionContainerMappingInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProtectionContainerMappingProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ProtectionContainerMappingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String fabricName; + + private String protectionContainerName; + + private String mappingName; + + private CreateProtectionContainerMappingInput createCreationInput; + + private UpdateProtectionContainerMappingInput updateUpdateInput; + + public ProtectionContainerMappingImpl withExistingReplicationProtectionContainer( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + this.protectionContainerName = protectionContainerName; + return this; + } + + public ProtectionContainerMapping create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainerMappings() + .create( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + createCreationInput, + Context.NONE); + return this; + } + + public ProtectionContainerMapping create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainerMappings() + .create( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + createCreationInput, + context); + return this; + } + + ProtectionContainerMappingImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new ProtectionContainerMappingInner(); + this.serviceManager = serviceManager; + this.mappingName = name; + this.createCreationInput = new CreateProtectionContainerMappingInput(); + } + + public ProtectionContainerMappingImpl update() { + this.updateUpdateInput = new UpdateProtectionContainerMappingInput(); + return this; + } + + public ProtectionContainerMapping apply() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainerMappings() + .update( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + updateUpdateInput, + Context.NONE); + return this; + } + + public ProtectionContainerMapping apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainerMappings() + .update( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + updateUpdateInput, + context); + return this; + } + + ProtectionContainerMappingImpl( + ProtectionContainerMappingInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fabricName = Utils.getValueFromIdByName(innerObject.id(), "replicationFabrics"); + this.protectionContainerName = Utils.getValueFromIdByName(innerObject.id(), "replicationProtectionContainers"); + this.mappingName = Utils.getValueFromIdByName(innerObject.id(), "replicationProtectionContainerMappings"); + } + + public ProtectionContainerMapping refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainerMappings() + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, Context.NONE) + .getValue(); + return this; + } + + public ProtectionContainerMapping refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionContainerMappings() + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context) + .getValue(); + return this; + } + + public void delete(RemoveProtectionContainerMappingInput removalInput) { + serviceManager + .replicationProtectionContainerMappings() + .delete(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput); + } + + public void delete(RemoveProtectionContainerMappingInput removalInput, Context context) { + serviceManager + .replicationProtectionContainerMappings() + .delete( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + removalInput, + context); + } + + public ProtectionContainerMappingImpl withProperties(CreateProtectionContainerMappingInputProperties properties) { + this.createCreationInput.withProperties(properties); + return this; + } + + public ProtectionContainerMappingImpl withProperties(UpdateProtectionContainerMappingInputProperties properties) { + this.updateUpdateInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPlanImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPlanImpl.java new file mode 100644 index 000000000000..8f16edddcb20 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPlanImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlan; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInputProperties; + +public final class RecoveryPlanImpl implements RecoveryPlan, RecoveryPlan.Definition, RecoveryPlan.Update { + private RecoveryPlanInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public RecoveryPlanProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RecoveryPlanInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String recoveryPlanName; + + private CreateRecoveryPlanInput createInput; + + private UpdateRecoveryPlanInput updateInput; + + public RecoveryPlanImpl withExistingVault(String resourceName, String resourceGroupName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public RecoveryPlan create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryPlans() + .create(resourceName, resourceGroupName, recoveryPlanName, createInput, Context.NONE); + return this; + } + + public RecoveryPlan create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryPlans() + .create(resourceName, resourceGroupName, recoveryPlanName, createInput, context); + return this; + } + + RecoveryPlanImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new RecoveryPlanInner(); + this.serviceManager = serviceManager; + this.recoveryPlanName = name; + this.createInput = new CreateRecoveryPlanInput(); + } + + public RecoveryPlanImpl update() { + this.updateInput = new UpdateRecoveryPlanInput(); + return this; + } + + public RecoveryPlan apply() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryPlans() + .update(resourceName, resourceGroupName, recoveryPlanName, updateInput, Context.NONE); + return this; + } + + public RecoveryPlan apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryPlans() + .update(resourceName, resourceGroupName, recoveryPlanName, updateInput, context); + return this; + } + + RecoveryPlanImpl( + RecoveryPlanInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.recoveryPlanName = Utils.getValueFromIdByName(innerObject.id(), "replicationRecoveryPlans"); + } + + public RecoveryPlan refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryPlans() + .getWithResponse(resourceName, resourceGroupName, recoveryPlanName, Context.NONE) + .getValue(); + return this; + } + + public RecoveryPlan refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryPlans() + .getWithResponse(resourceName, resourceGroupName, recoveryPlanName, context) + .getValue(); + return this; + } + + public RecoveryPlan failoverCancel() { + return serviceManager + .replicationRecoveryPlans() + .failoverCancel(resourceName, resourceGroupName, recoveryPlanName); + } + + public RecoveryPlan failoverCancel(Context context) { + return serviceManager + .replicationRecoveryPlans() + .failoverCancel(resourceName, resourceGroupName, recoveryPlanName, context); + } + + public RecoveryPlan failoverCommit() { + return serviceManager + .replicationRecoveryPlans() + .failoverCommit(resourceName, resourceGroupName, recoveryPlanName); + } + + public RecoveryPlan failoverCommit(Context context) { + return serviceManager + .replicationRecoveryPlans() + .failoverCommit(resourceName, resourceGroupName, recoveryPlanName, context); + } + + public RecoveryPlan plannedFailover(RecoveryPlanPlannedFailoverInput input) { + return serviceManager + .replicationRecoveryPlans() + .plannedFailover(resourceName, resourceGroupName, recoveryPlanName, input); + } + + public RecoveryPlan plannedFailover(RecoveryPlanPlannedFailoverInput input, Context context) { + return serviceManager + .replicationRecoveryPlans() + .plannedFailover(resourceName, resourceGroupName, recoveryPlanName, input, context); + } + + public RecoveryPlan reprotect() { + return serviceManager.replicationRecoveryPlans().reprotect(resourceName, resourceGroupName, recoveryPlanName); + } + + public RecoveryPlan reprotect(Context context) { + return serviceManager + .replicationRecoveryPlans() + .reprotect(resourceName, resourceGroupName, recoveryPlanName, context); + } + + public RecoveryPlan testFailover(RecoveryPlanTestFailoverInput input) { + return serviceManager + .replicationRecoveryPlans() + .testFailover(resourceName, resourceGroupName, recoveryPlanName, input); + } + + public RecoveryPlan testFailover(RecoveryPlanTestFailoverInput input, Context context) { + return serviceManager + .replicationRecoveryPlans() + .testFailover(resourceName, resourceGroupName, recoveryPlanName, input, context); + } + + public RecoveryPlan testFailoverCleanup(RecoveryPlanTestFailoverCleanupInput input) { + return serviceManager + .replicationRecoveryPlans() + .testFailoverCleanup(resourceName, resourceGroupName, recoveryPlanName, input); + } + + public RecoveryPlan testFailoverCleanup(RecoveryPlanTestFailoverCleanupInput input, Context context) { + return serviceManager + .replicationRecoveryPlans() + .testFailoverCleanup(resourceName, resourceGroupName, recoveryPlanName, input, context); + } + + public RecoveryPlan unplannedFailover(RecoveryPlanUnplannedFailoverInput input) { + return serviceManager + .replicationRecoveryPlans() + .unplannedFailover(resourceName, resourceGroupName, recoveryPlanName, input); + } + + public RecoveryPlan unplannedFailover(RecoveryPlanUnplannedFailoverInput input, Context context) { + return serviceManager + .replicationRecoveryPlans() + .unplannedFailover(resourceName, resourceGroupName, recoveryPlanName, input, context); + } + + public RecoveryPlanImpl withProperties(CreateRecoveryPlanInputProperties properties) { + this.createInput.withProperties(properties); + return this; + } + + public RecoveryPlanImpl withProperties(UpdateRecoveryPlanInputProperties properties) { + this.updateInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointImpl.java new file mode 100644 index 000000000000..a638df994b46 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPointInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPoint; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointProperties; + +public final class RecoveryPointImpl implements RecoveryPoint { + private RecoveryPointInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + RecoveryPointImpl( + RecoveryPointInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 RecoveryPointProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public RecoveryPointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsClientImpl.java new file mode 100644 index 000000000000..4126e89b8e3d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsClientImpl.java @@ -0,0 +1,750 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPointInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointCollection; +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 SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of RecoveryPointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryPointsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy.create(RecoveryPointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientRecoveryPoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface RecoveryPointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectedItems( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints" + + "/{recoveryPointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @PathParam("recoveryPointName") String recoveryPointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectedItemsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectedItemsSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByReplicationProtectedItems( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectedItemsSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationProtectedItems( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectedItemsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return new PagedFlux<>( + () -> + listByReplicationProtectedItemsSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName), + nextLink -> listByReplicationProtectedItemsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectedItemsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return new PagedFlux<>( + () -> + listByReplicationProtectedItemsSinglePageAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context), + nextLink -> listByReplicationProtectedItemsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return new PagedIterable<>( + listByReplicationProtectedItemsAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName)); + } + + /** + * Gets the list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return new PagedIterable<>( + listByReplicationProtectedItemsAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context)); + } + + /** + * Gets a recovery point. + * + *

Get the details of specified recovery point. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 specified recovery point along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a recovery point. + * + *

Get the details of specified recovery point. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 specified recovery point along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName, + accept, + context); + } + + /** + * Gets a recovery point. + * + *

Get the details of specified recovery point. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 specified recovery point on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName) { + return getWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a recovery point. + * + *

Get the details of specified recovery point. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 specified recovery point along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName, + Context context) { + return getWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName, + context) + .block(); + } + + /** + * Gets a recovery point. + * + *

Get the details of specified recovery point. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 specified recovery point. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPointInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName) { + return getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName, + Context.NONE) + .getValue(); + } + + /** + * 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 collection of recovery point details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectedItemsNextSinglePageAsync( + 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.listByReplicationProtectedItemsNext(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 collection of recovery point details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectedItemsNextSinglePageAsync( + 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 + .listByReplicationProtectedItemsNext(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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsImpl.java new file mode 100644 index 000000000000..6de6a1009ed8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPointInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPoint; +import com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public RecoveryPointsImpl( + RecoveryPointsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectedItems( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + return Utils.mapPage(inner, inner1 -> new RecoveryPointImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + return Utils.mapPage(inner, inner1 -> new RecoveryPointImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecoveryPointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RecoveryPoint get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName) { + RecoveryPointInner inner = + this + .serviceClient() + .get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName); + if (inner != null) { + return new RecoveryPointImpl(inner, this.manager()); + } else { + return null; + } + } + + private RecoveryPointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryServicesProviderImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryServicesProviderImpl.java new file mode 100644 index 000000000000..4743b041845e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryServicesProviderImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProvider; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderProperties; + +public final class RecoveryServicesProviderImpl + implements RecoveryServicesProvider, RecoveryServicesProvider.Definition { + private RecoveryServicesProviderInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + RecoveryServicesProviderImpl( + RecoveryServicesProviderInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 RecoveryServicesProviderProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public RecoveryServicesProviderInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String fabricName; + + private String providerName; + + private AddRecoveryServicesProviderInput createAddProviderInput; + + public RecoveryServicesProviderImpl withExistingReplicationFabric( + String resourceName, String resourceGroupName, String fabricName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + return this; + } + + public RecoveryServicesProvider create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryServicesProviders() + .create( + resourceName, resourceGroupName, fabricName, providerName, createAddProviderInput, Context.NONE); + return this; + } + + public RecoveryServicesProvider create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryServicesProviders() + .create(resourceName, resourceGroupName, fabricName, providerName, createAddProviderInput, context); + return this; + } + + RecoveryServicesProviderImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new RecoveryServicesProviderInner(); + this.serviceManager = serviceManager; + this.providerName = name; + this.createAddProviderInput = new AddRecoveryServicesProviderInput(); + } + + public RecoveryServicesProvider refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryServicesProviders() + .getWithResponse(resourceName, resourceGroupName, fabricName, providerName, Context.NONE) + .getValue(); + return this; + } + + public RecoveryServicesProvider refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationRecoveryServicesProviders() + .getWithResponse(resourceName, resourceGroupName, fabricName, providerName, context) + .getValue(); + return this; + } + + public RecoveryServicesProvider refreshProvider() { + return serviceManager + .replicationRecoveryServicesProviders() + .refreshProvider(resourceName, resourceGroupName, fabricName, providerName); + } + + public RecoveryServicesProvider refreshProvider(Context context) { + return serviceManager + .replicationRecoveryServicesProviders() + .refreshProvider(resourceName, resourceGroupName, fabricName, providerName, context); + } + + public void delete() { + serviceManager + .replicationRecoveryServicesProviders() + .delete(resourceName, resourceGroupName, fabricName, providerName); + } + + public void delete(Context context) { + serviceManager + .replicationRecoveryServicesProviders() + .delete(resourceName, resourceGroupName, fabricName, providerName, context); + } + + public RecoveryServicesProviderImpl withProperties(AddRecoveryServicesProviderInputProperties properties) { + this.createAddProviderInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsClientImpl.java new file mode 100644 index 000000000000..06b233307eb1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsClientImpl.java @@ -0,0 +1,752 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationAlertSettingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.AlertInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AlertCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationAlertSettingsClient. */ +public final class ReplicationAlertSettingsClientImpl implements ReplicationAlertSettingsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationAlertSettingsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationAlertSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationAlertSettingsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create(ReplicationAlertSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationAlertSettings to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationAlertSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationAlertSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("alertSettingName") String alertSettingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("alertSettingName") String alertSettingName, + @BodyParam("application/json") ConfigureAlertRequest request, + @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 list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 email notification(alert) configurations for the vault along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 email notification(alert) configurations for the vault along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 email notification(alert) configurations for the vault as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 email notification(alert) configurations for the vault as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 email notification(alert) configurations for the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 email notification(alert) configurations for the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, context)); + } + + /** + * Gets an email notification(alert) configuration. + * + *

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

Gets the details of the specified email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 specified email notification(alert) configuration along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String alertSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (alertSettingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + alertSettingName, + accept, + context); + } + + /** + * Gets an email notification(alert) configuration. + * + *

Gets the details of the specified email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 specified email notification(alert) configuration on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName, String alertSettingName) { + return getWithResponseAsync(resourceName, resourceGroupName, alertSettingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an email notification(alert) configuration. + * + *

Gets the details of the specified email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 specified email notification(alert) configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String alertSettingName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, alertSettingName, context).block(); + } + + /** + * Gets an email notification(alert) configuration. + * + *

Gets the details of the specified email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 specified email notification(alert) configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertInner get(String resourceName, String resourceGroupName, String alertSettingName) { + return getWithResponse(resourceName, resourceGroupName, alertSettingName, Context.NONE).getValue(); + } + + /** + * Configures email notifications for this vault. + * + *

Create or update an email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification(alert) configuration. + * @param request The input to configure the email notification(alert). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Alert class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceName, String resourceGroupName, String alertSettingName, ConfigureAlertRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (alertSettingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertSettingName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + alertSettingName, + request, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Configures email notifications for this vault. + * + *

Create or update an email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification(alert) configuration. + * @param request The input to configure the email notification(alert). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Alert class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String alertSettingName, + ConfigureAlertRequest request, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (alertSettingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertSettingName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + alertSettingName, + request, + accept, + context); + } + + /** + * Configures email notifications for this vault. + * + *

Create or update an email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification(alert) configuration. + * @param request The input to configure the email notification(alert). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Alert class on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, String resourceGroupName, String alertSettingName, ConfigureAlertRequest request) { + return createWithResponseAsync(resourceName, resourceGroupName, alertSettingName, request) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Configures email notifications for this vault. + * + *

Create or update an email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification(alert) configuration. + * @param request The input to configure the email notification(alert). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Alert class along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceName, + String resourceGroupName, + String alertSettingName, + ConfigureAlertRequest request, + Context context) { + return createWithResponseAsync(resourceName, resourceGroupName, alertSettingName, request, context).block(); + } + + /** + * Configures email notifications for this vault. + * + *

Create or update an email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification(alert) configuration. + * @param request The input to configure the email notification(alert). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Alert class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertInner create( + String resourceName, String resourceGroupName, String alertSettingName, ConfigureAlertRequest request) { + return createWithResponse(resourceName, resourceGroupName, alertSettingName, request, Context.NONE).getValue(); + } + + /** + * 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 collection of alerts 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 collection of alerts 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsImpl.java new file mode 100644 index 000000000000..3864a55ceae9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationAlertSettingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.AlertInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Alert; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationAlertSettings; + +public final class ReplicationAlertSettingsImpl implements ReplicationAlertSettings { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationAlertSettingsImpl.class); + + private final ReplicationAlertSettingsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationAlertSettingsImpl( + ReplicationAlertSettingsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String alertSettingName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, alertSettingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Alert get(String resourceName, String resourceGroupName, String alertSettingName) { + AlertInner inner = this.serviceClient().get(resourceName, resourceGroupName, alertSettingName); + if (inner != null) { + return new AlertImpl(inner, this.manager()); + } else { + return null; + } + } + + public Alert getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 alertSettingName = Utils.getValueFromIdByName(id, "replicationAlertSettings"); + if (alertSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationAlertSettings'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, alertSettingName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 alertSettingName = Utils.getValueFromIdByName(id, "replicationAlertSettings"); + if (alertSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationAlertSettings'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, alertSettingName, context); + } + + private ReplicationAlertSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public AlertImpl define(String name) { + return new AlertImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationApplianceImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationApplianceImpl.java new file mode 100644 index 000000000000..c6d001695da1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationApplianceImpl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationApplianceInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationAppliance; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationApplianceProperties; + +public final class ReplicationApplianceImpl implements ReplicationAppliance { + private ReplicationApplianceInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + ReplicationApplianceImpl( + ReplicationApplianceInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ReplicationApplianceProperties properties() { + return this.innerModel().properties(); + } + + public ReplicationApplianceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAppliancesClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAppliancesClientImpl.java new file mode 100644 index 000000000000..0f5b5529dbb8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAppliancesClientImpl.java @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationAppliancesClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationApplianceInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplianceCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationAppliancesClient. */ +public final class ReplicationAppliancesClientImpl implements ReplicationAppliancesClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationAppliancesService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationAppliancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationAppliancesClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create(ReplicationAppliancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationAppliances to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationAppliancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationAppliances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @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 list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery appliances for the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery appliances for the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery appliances for the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Azure Site Recovery appliances for the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery appliances for the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Azure Site Recovery appliances for the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, filter)); + } + + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery appliances for the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, filter, 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 collection of appliance details 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 collection of appliance details 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAppliancesImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAppliancesImpl.java new file mode 100644 index 000000000000..18e7ea871677 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAppliancesImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationAppliancesClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationApplianceInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationAppliance; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationAppliances; + +public final class ReplicationAppliancesImpl implements ReplicationAppliances { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationAppliancesImpl.class); + + private final ReplicationAppliancesClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationAppliancesImpl( + ReplicationAppliancesClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ReplicationApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceName, String resourceGroupName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, filter, context); + return Utils.mapPage(inner, inner1 -> new ReplicationApplianceImpl(inner1, this.manager())); + } + + private ReplicationAppliancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsCollectionImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsCollectionImpl.java new file mode 100644 index 000000000000..c7b6fd4cc281 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsCollectionImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResults; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsCollection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ReplicationEligibilityResultsCollectionImpl implements ReplicationEligibilityResultsCollection { + private ReplicationEligibilityResultsCollectionInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + ReplicationEligibilityResultsCollectionImpl( + ReplicationEligibilityResultsCollectionInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ReplicationEligibilityResultsImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ReplicationEligibilityResultsCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsImpl.java new file mode 100644 index 000000000000..0f58240e1cee --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResults; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsProperties; + +public final class ReplicationEligibilityResultsImpl implements ReplicationEligibilityResults { + private ReplicationEligibilityResultsInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + ReplicationEligibilityResultsImpl( + ReplicationEligibilityResultsInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String id() { + return this.innerModel().id(); + } + + public ReplicationEligibilityResultsProperties properties() { + return this.innerModel().properties(); + } + + public ReplicationEligibilityResultsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java new file mode 100644 index 000000000000..cd0359964d0d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationEligibilityResultsOperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ReplicationEligibilityResultsOperationsClient. + */ +public final class ReplicationEligibilityResultsOperationsClientImpl + implements ReplicationEligibilityResultsOperationsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationEligibilityResultsOperationsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationEligibilityResultsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationEligibilityResultsOperationsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationEligibilityResultsOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationEligibilityResultsOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationEligibilityResultsOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices" + + "/replicationEligibilityResults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices" + + "/replicationEligibilityResults/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results collection response model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String virtualMachineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String virtualMachineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName 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(), + resourceGroupName, + this.client.getSubscriptionId(), + virtualMachineName, + accept, + context); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results collection response model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String virtualMachineName) { + return listWithResponseAsync(resourceGroupName, virtualMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String virtualMachineName, Context context) { + return listWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results collection response model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationEligibilityResultsCollectionInner list(String resourceGroupName, String virtualMachineName) { + return listWithResponse(resourceGroupName, virtualMachineName, Context.NONE).getValue(); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results response model along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualMachineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualMachineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceGroupName, + this.client.getSubscriptionId(), + virtualMachineName, + accept, + context); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results response model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualMachineName) { + return getWithResponseAsync(resourceGroupName, virtualMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualMachineName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results response model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationEligibilityResultsInner get(String resourceGroupName, String virtualMachineName) { + return getWithResponse(resourceGroupName, virtualMachineName, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsImpl.java new file mode 100644 index 000000000000..5171c4dac906 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsImpl.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationEligibilityResultsOperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResults; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsOperations; + +public final class ReplicationEligibilityResultsOperationsImpl implements ReplicationEligibilityResultsOperations { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationEligibilityResultsOperationsImpl.class); + + private final ReplicationEligibilityResultsOperationsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationEligibilityResultsOperationsImpl( + ReplicationEligibilityResultsOperationsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse( + String resourceGroupName, String virtualMachineName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, virtualMachineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicationEligibilityResultsCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ReplicationEligibilityResultsCollection list(String resourceGroupName, String virtualMachineName) { + ReplicationEligibilityResultsCollectionInner inner = + this.serviceClient().list(resourceGroupName, virtualMachineName); + if (inner != null) { + return new ReplicationEligibilityResultsCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualMachineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualMachineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicationEligibilityResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ReplicationEligibilityResults get(String resourceGroupName, String virtualMachineName) { + ReplicationEligibilityResultsInner inner = this.serviceClient().get(resourceGroupName, virtualMachineName); + if (inner != null) { + return new ReplicationEligibilityResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + private ReplicationEligibilityResultsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsClientImpl.java new file mode 100644 index 000000000000..ae6f6ec9260e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsClientImpl.java @@ -0,0 +1,561 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationEventsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.EventInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EventCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationEventsClient. */ +public final class ReplicationEventsClientImpl implements ReplicationEventsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationEventsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationEventsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationEventsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy.create(ReplicationEventsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationEvents to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationEventsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationEvents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationEvents/{eventName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("eventName") String eventName, + @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 list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery events for the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery events for the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery events for the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Azure Site Recovery events for the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery events for the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Azure Site Recovery events for the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, filter)); + } + + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery events for the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, filter, context)); + } + + /** + * Get the details of an Azure Site recovery event. + * + *

The operation to get the details of an Azure Site recovery event. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param eventName The name of the Azure Site Recovery event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Event class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String eventName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + eventName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the details of an Azure Site recovery event. + * + *

The operation to get the details of an Azure Site recovery event. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param eventName The name of the Azure Site Recovery event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Event class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + eventName, + accept, + context); + } + + /** + * Get the details of an Azure Site recovery event. + * + *

The operation to get the details of an Azure Site recovery event. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param eventName The name of the Azure Site Recovery event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Event class on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName, String eventName) { + return getWithResponseAsync(resourceName, resourceGroupName, eventName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the details of an Azure Site recovery event. + * + *

The operation to get the details of an Azure Site recovery event. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param eventName The name of the Azure Site Recovery event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Event class along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String eventName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, eventName, context).block(); + } + + /** + * Get the details of an Azure Site recovery event. + * + *

The operation to get the details of an Azure Site recovery event. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param eventName The name of the Azure Site Recovery event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Event class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventInner get(String resourceName, String resourceGroupName, String eventName) { + return getWithResponse(resourceName, resourceGroupName, eventName, Context.NONE).getValue(); + } + + /** + * 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 collection of fabric details 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 collection of fabric details 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsImpl.java new file mode 100644 index 000000000000..95433dd19119 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationEventsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.EventInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Event; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEvents; + +public final class ReplicationEventsImpl implements ReplicationEvents { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationEventsImpl.class); + + private final ReplicationEventsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationEventsImpl( + ReplicationEventsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, filter, context); + return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String eventName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, eventName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Event get(String resourceName, String resourceGroupName, String eventName) { + EventInner inner = this.serviceClient().get(resourceName, resourceGroupName, eventName); + if (inner != null) { + return new EventImpl(inner, this.manager()); + } else { + return null; + } + } + + private ReplicationEventsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationFabricsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationFabricsClientImpl.java new file mode 100644 index 000000000000..0d9a230e263f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationFabricsClientImpl.java @@ -0,0 +1,2719 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationFabricsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.FabricInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInput; +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 ReplicationFabricsClient. */ +public final class ReplicationFabricsClientImpl implements ReplicationFabricsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationFabricsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationFabricsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationFabricsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy.create(ReplicationFabricsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationFabrics to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationFabricsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @BodyParam("application/json") FabricCreationInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> checkConsistency( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrateToAad( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reassociateGateway( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @BodyParam("application/json") FailoverProcessServerRequest failoverProcessServerRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/remove") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> renewCertificate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @BodyParam("application/json") RenewCertificateInput renewCertificate, + @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 list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Azure Site Recovery fabrics in the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Azure Site Recovery fabrics in the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Azure Site Recovery fabrics in the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Azure Site Recovery fabrics in the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Azure Site Recovery fabrics in the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Azure Site Recovery fabrics in the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, context)); + } + + /** + * Gets the details of an ASR fabric. + * + *

Gets the details of an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Azure Site Recovery fabric along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + filter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the details of an ASR fabric. + * + *

Gets the details of an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Azure Site Recovery fabric along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + filter, + accept, + context); + } + + /** + * Gets the details of an ASR fabric. + * + *

Gets the details of an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 an Azure Site Recovery fabric on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName, String fabricName) { + final String filter = null; + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of an ASR fabric. + * + *

Gets the details of an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Azure Site Recovery fabric along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String filter, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, filter, context).block(); + } + + /** + * Gets the details of an ASR fabric. + * + *

Gets the details of an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 an Azure Site Recovery fabric. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricInner get(String resourceName, String resourceGroupName, String fabricName) { + final String filter = null; + return getWithResponse(resourceName, resourceGroupName, fabricName, filter, Context.NONE).getValue(); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + input, + accept, + context); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricInner> beginCreateAsync( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input) { + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, fabricName, input); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricInner.class, FabricInner.class, this.client.getContext()); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricInner> beginCreateAsync( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, fabricName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricInner.class, FabricInner.class, context); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, input).getSyncPoller(); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input, Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, input, context).getSyncPoller(); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input, Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricInner create( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input) { + return createAsync(resourceName, resourceGroupName, fabricName, input).block(); + } + + /** + * Creates an Azure Site Recovery fabric. + * + *

The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the ASR fabric. + * @param input Fabric creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricInner create( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input, Context context) { + return createAsync(resourceName, resourceGroupName, fabricName, input, context).block(); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> purgeWithResponseAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .purge( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> purgeWithResponseAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .purge( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + context); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeAsync( + String resourceName, String resourceGroupName, String fabricName) { + Mono>> mono = purgeWithResponseAsync(resourceName, resourceGroupName, fabricName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurge( + String resourceName, String resourceGroupName, String fabricName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName).getSyncPoller(); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurge( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, context).getSyncPoller(); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 purgeAsync(String resourceName, String resourceGroupName, String fabricName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 purgeAsync(String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 purge(String resourceName, String resourceGroupName, String fabricName) { + purgeAsync(resourceName, resourceGroupName, fabricName).block(); + } + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 purge(String resourceName, String resourceGroupName, String fabricName, Context context) { + purgeAsync(resourceName, resourceGroupName, fabricName, context).block(); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> checkConsistencyWithResponseAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .checkConsistency( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 fabric definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> checkConsistencyWithResponseAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .checkConsistency( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricInner> beginCheckConsistencyAsync( + String resourceName, String resourceGroupName, String fabricName) { + Mono>> mono = + checkConsistencyWithResponseAsync(resourceName, resourceGroupName, fabricName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricInner.class, FabricInner.class, this.client.getContext()); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 fabric definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricInner> beginCheckConsistencyAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + checkConsistencyWithResponseAsync(resourceName, resourceGroupName, fabricName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricInner.class, FabricInner.class, context); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricInner> beginCheckConsistency( + String resourceName, String resourceGroupName, String fabricName) { + return beginCheckConsistencyAsync(resourceName, resourceGroupName, fabricName).getSyncPoller(); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 fabric definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricInner> beginCheckConsistency( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginCheckConsistencyAsync(resourceName, resourceGroupName, fabricName, context).getSyncPoller(); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkConsistencyAsync(String resourceName, String resourceGroupName, String fabricName) { + return beginCheckConsistencyAsync(resourceName, resourceGroupName, fabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 fabric definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkConsistencyAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginCheckConsistencyAsync(resourceName, resourceGroupName, fabricName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricInner checkConsistency(String resourceName, String resourceGroupName, String fabricName) { + return checkConsistencyAsync(resourceName, resourceGroupName, fabricName).block(); + } + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 fabric definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricInner checkConsistency( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return checkConsistencyAsync(resourceName, resourceGroupName, fabricName, context).block(); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> migrateToAadWithResponseAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .migrateToAad( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> migrateToAadWithResponseAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .migrateToAad( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + context); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginMigrateToAadAsync( + String resourceName, String resourceGroupName, String fabricName) { + Mono>> mono = + migrateToAadWithResponseAsync(resourceName, resourceGroupName, fabricName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginMigrateToAadAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + migrateToAadWithResponseAsync(resourceName, resourceGroupName, fabricName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginMigrateToAad( + String resourceName, String resourceGroupName, String fabricName) { + return beginMigrateToAadAsync(resourceName, resourceGroupName, fabricName).getSyncPoller(); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginMigrateToAad( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginMigrateToAadAsync(resourceName, resourceGroupName, fabricName, context).getSyncPoller(); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migrateToAadAsync(String resourceName, String resourceGroupName, String fabricName) { + return beginMigrateToAadAsync(resourceName, resourceGroupName, fabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migrateToAadAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginMigrateToAadAsync(resourceName, resourceGroupName, fabricName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 migrateToAad(String resourceName, String resourceGroupName, String fabricName) { + migrateToAadAsync(resourceName, resourceGroupName, fabricName).block(); + } + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 migrateToAad(String resourceName, String resourceGroupName, String fabricName, Context context) { + migrateToAadAsync(resourceName, resourceGroupName, fabricName, context).block(); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reassociateGatewayWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (failoverProcessServerRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter failoverProcessServerRequest is required and cannot be null.")); + } else { + failoverProcessServerRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reassociateGateway( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + failoverProcessServerRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 fabric definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reassociateGatewayWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (failoverProcessServerRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter failoverProcessServerRequest is required and cannot be null.")); + } else { + failoverProcessServerRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reassociateGateway( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + failoverProcessServerRequest, + accept, + context); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricInner> beginReassociateGatewayAsync( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest) { + Mono>> mono = + reassociateGatewayWithResponseAsync( + resourceName, resourceGroupName, fabricName, failoverProcessServerRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricInner.class, FabricInner.class, this.client.getContext()); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 the {@link PollerFlux} for polling of fabric definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricInner> beginReassociateGatewayAsync( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reassociateGatewayWithResponseAsync( + resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricInner.class, FabricInner.class, context); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricInner> beginReassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest) { + return beginReassociateGatewayAsync(resourceName, resourceGroupName, fabricName, failoverProcessServerRequest) + .getSyncPoller(); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 the {@link SyncPoller} for polling of fabric definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricInner> beginReassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context) { + return beginReassociateGatewayAsync( + resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, context) + .getSyncPoller(); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reassociateGatewayAsync( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest) { + return beginReassociateGatewayAsync(resourceName, resourceGroupName, fabricName, failoverProcessServerRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 fabric definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reassociateGatewayAsync( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context) { + return beginReassociateGatewayAsync( + resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricInner reassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest) { + return reassociateGatewayAsync(resourceName, resourceGroupName, fabricName, failoverProcessServerRequest) + .block(); + } + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 fabric definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricInner reassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context) { + return reassociateGatewayAsync( + resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, context) + .block(); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + context); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, String resourceGroupName, String fabricName) { + Mono>> mono = deleteWithResponseAsync(resourceName, resourceGroupName, fabricName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, String resourceGroupName, String fabricName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, String resourceGroupName, String fabricName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName).getSyncPoller(); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, String resourceGroupName, String fabricName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, context).getSyncPoller(); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, String resourceGroupName, String fabricName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, String resourceGroupName, String fabricName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, String resourceGroupName, String fabricName) { + deleteAsync(resourceName, resourceGroupName, fabricName).block(); + } + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, String resourceGroupName, String fabricName, Context context) { + deleteAsync(resourceName, resourceGroupName, fabricName, context).block(); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> renewCertificateWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (renewCertificate == null) { + return Mono + .error(new IllegalArgumentException("Parameter renewCertificate is required and cannot be null.")); + } else { + renewCertificate.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .renewCertificate( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + renewCertificate, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> renewCertificateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (renewCertificate == null) { + return Mono + .error(new IllegalArgumentException("Parameter renewCertificate is required and cannot be null.")); + } else { + renewCertificate.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .renewCertificate( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + renewCertificate, + accept, + context); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricInner> beginRenewCertificateAsync( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate) { + Mono>> mono = + renewCertificateWithResponseAsync(resourceName, resourceGroupName, fabricName, renewCertificate); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricInner.class, FabricInner.class, this.client.getContext()); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricInner> beginRenewCertificateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + renewCertificateWithResponseAsync(resourceName, resourceGroupName, fabricName, renewCertificate, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricInner.class, FabricInner.class, context); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricInner> beginRenewCertificate( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate) { + return beginRenewCertificateAsync(resourceName, resourceGroupName, fabricName, renewCertificate) + .getSyncPoller(); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricInner> beginRenewCertificate( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context) { + return beginRenewCertificateAsync(resourceName, resourceGroupName, fabricName, renewCertificate, context) + .getSyncPoller(); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono renewCertificateAsync( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate) { + return beginRenewCertificateAsync(resourceName, resourceGroupName, fabricName, renewCertificate) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono renewCertificateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context) { + return beginRenewCertificateAsync(resourceName, resourceGroupName, fabricName, renewCertificate, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricInner renewCertificate( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate) { + return renewCertificateAsync(resourceName, resourceGroupName, fabricName, renewCertificate).block(); + } + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricInner renewCertificate( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context) { + return renewCertificateAsync(resourceName, resourceGroupName, fabricName, renewCertificate, 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 collection of fabric details 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 collection of fabric details 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationFabricsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationFabricsImpl.java new file mode 100644 index 000000000000..600902682476 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationFabricsImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationFabricsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.FabricInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Fabric; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationFabrics; + +public final class ReplicationFabricsImpl implements ReplicationFabrics { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationFabricsImpl.class); + + private final ReplicationFabricsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationFabricsImpl( + ReplicationFabricsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new FabricImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new FabricImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String filter, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, fabricName, filter, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FabricImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Fabric get(String resourceName, String resourceGroupName, String fabricName) { + FabricInner inner = this.serviceClient().get(resourceName, resourceGroupName, fabricName); + if (inner != null) { + return new FabricImpl(inner, this.manager()); + } else { + return null; + } + } + + public void purge(String resourceName, String resourceGroupName, String fabricName) { + this.serviceClient().purge(resourceName, resourceGroupName, fabricName); + } + + public void purge(String resourceName, String resourceGroupName, String fabricName, Context context) { + this.serviceClient().purge(resourceName, resourceGroupName, fabricName, context); + } + + public Fabric checkConsistency(String resourceName, String resourceGroupName, String fabricName) { + FabricInner inner = this.serviceClient().checkConsistency(resourceName, resourceGroupName, fabricName); + if (inner != null) { + return new FabricImpl(inner, this.manager()); + } else { + return null; + } + } + + public Fabric checkConsistency(String resourceName, String resourceGroupName, String fabricName, Context context) { + FabricInner inner = this.serviceClient().checkConsistency(resourceName, resourceGroupName, fabricName, context); + if (inner != null) { + return new FabricImpl(inner, this.manager()); + } else { + return null; + } + } + + public void migrateToAad(String resourceName, String resourceGroupName, String fabricName) { + this.serviceClient().migrateToAad(resourceName, resourceGroupName, fabricName); + } + + public void migrateToAad(String resourceName, String resourceGroupName, String fabricName, Context context) { + this.serviceClient().migrateToAad(resourceName, resourceGroupName, fabricName, context); + } + + public Fabric reassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest) { + FabricInner inner = + this + .serviceClient() + .reassociateGateway(resourceName, resourceGroupName, fabricName, failoverProcessServerRequest); + if (inner != null) { + return new FabricImpl(inner, this.manager()); + } else { + return null; + } + } + + public Fabric reassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context) { + FabricInner inner = + this + .serviceClient() + .reassociateGateway(resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, context); + if (inner != null) { + return new FabricImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceName, String resourceGroupName, String fabricName) { + this.serviceClient().delete(resourceName, resourceGroupName, fabricName); + } + + public void delete(String resourceName, String resourceGroupName, String fabricName, Context context) { + this.serviceClient().delete(resourceName, resourceGroupName, fabricName, context); + } + + public Fabric renewCertificate( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate) { + FabricInner inner = + this.serviceClient().renewCertificate(resourceName, resourceGroupName, fabricName, renewCertificate); + if (inner != null) { + return new FabricImpl(inner, this.manager()); + } else { + return null; + } + } + + public Fabric renewCertificate( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context) { + FabricInner inner = + this + .serviceClient() + .renewCertificate(resourceName, resourceGroupName, fabricName, renewCertificate, context); + if (inner != null) { + return new FabricImpl(inner, this.manager()); + } else { + return null; + } + } + + public Fabric getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 localFilter = null; + return this.getWithResponse(resourceName, resourceGroupName, fabricName, localFilter, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, String filter, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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.getWithResponse(resourceName, resourceGroupName, fabricName, filter, context); + } + + private ReplicationFabricsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public FabricImpl define(String name) { + return new FabricImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsClientImpl.java new file mode 100644 index 000000000000..be689af48d79 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsClientImpl.java @@ -0,0 +1,1792 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationJobsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.JobInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobQueryParameter; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParams; +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 ReplicationJobsClient. */ +public final class ReplicationJobsClientImpl implements ReplicationJobsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationJobsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationJobsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy.create(ReplicationJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationJobs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationJobsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationJobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationJobs/{jobName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("jobName") String jobName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationJobs/{jobName}/cancel") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("jobName") String jobName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationJobs/{jobName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("jobName") String jobName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationJobs/{jobName}/resume") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resume( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("jobName") String jobName, + @BodyParam("application/json") ResumeJobParams resumeJobParams, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationJobs/export") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> export( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") JobQueryParameter jobQueryParameter, + @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 list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery Jobs for the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery Jobs for the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery Jobs for the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Azure Site Recovery Jobs for the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery Jobs for the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Azure Site Recovery Jobs for the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, filter)); + } + + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery Jobs for the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, filter, context)); + } + + /** + * Gets the job details. + * + *

Get the details of an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Site Recovery job along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the job details. + * + *

Get the details of an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Site Recovery job along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context); + } + + /** + * Gets the job details. + * + *

Get the details of an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Site Recovery job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName, String jobName) { + return getWithResponseAsync(resourceName, resourceGroupName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the job details. + * + *

Get the details of an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Site Recovery job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String jobName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, jobName, context).block(); + } + + /** + * Gets the job details. + * + *

Get the details of an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Site Recovery job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner get(String resourceName, String resourceGroupName, String jobName) { + return getWithResponse(resourceName, resourceGroupName, jobName, Context.NONE).getValue(); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceName, String resourceGroupName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .cancel( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceName, String resourceGroupName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .cancel( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginCancelAsync( + String resourceName, String resourceGroupName, String jobName) { + Mono>> mono = cancelWithResponseAsync(resourceName, resourceGroupName, jobName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, this.client.getContext()); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginCancelAsync( + String resourceName, String resourceGroupName, String jobName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cancelWithResponseAsync(resourceName, resourceGroupName, jobName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, context); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginCancel( + String resourceName, String resourceGroupName, String jobName) { + return beginCancelAsync(resourceName, resourceGroupName, jobName).getSyncPoller(); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginCancel( + String resourceName, String resourceGroupName, String jobName, Context context) { + return beginCancelAsync(resourceName, resourceGroupName, jobName, context).getSyncPoller(); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceName, String resourceGroupName, String jobName) { + return beginCancelAsync(resourceName, resourceGroupName, jobName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceName, String resourceGroupName, String jobName, Context context) { + return beginCancelAsync(resourceName, resourceGroupName, jobName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner cancel(String resourceName, String resourceGroupName, String jobName) { + return cancelAsync(resourceName, resourceGroupName, jobName).block(); + } + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner cancel(String resourceName, String resourceGroupName, String jobName, Context context) { + return cancelAsync(resourceName, resourceGroupName, jobName, context).block(); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceName, String resourceGroupName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceName, String resourceGroupName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginRestartAsync( + String resourceName, String resourceGroupName, String jobName) { + Mono>> mono = restartWithResponseAsync(resourceName, resourceGroupName, jobName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, this.client.getContext()); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginRestartAsync( + String resourceName, String resourceGroupName, String jobName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceName, resourceGroupName, jobName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, context); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginRestart( + String resourceName, String resourceGroupName, String jobName) { + return beginRestartAsync(resourceName, resourceGroupName, jobName).getSyncPoller(); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginRestart( + String resourceName, String resourceGroupName, String jobName, Context context) { + return beginRestartAsync(resourceName, resourceGroupName, jobName, context).getSyncPoller(); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceName, String resourceGroupName, String jobName) { + return beginRestartAsync(resourceName, resourceGroupName, jobName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceName, String resourceGroupName, String jobName, Context context) { + return beginRestartAsync(resourceName, resourceGroupName, jobName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner restart(String resourceName, String resourceGroupName, String jobName) { + return restartAsync(resourceName, resourceGroupName, jobName).block(); + } + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner restart(String resourceName, String resourceGroupName, String jobName, Context context) { + return restartAsync(resourceName, resourceGroupName, jobName, context).block(); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync( + String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (resumeJobParams == null) { + return Mono + .error(new IllegalArgumentException("Parameter resumeJobParams is required and cannot be null.")); + } else { + resumeJobParams.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resume( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + resumeJobParams, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (resumeJobParams == null) { + return Mono + .error(new IllegalArgumentException("Parameter resumeJobParams is required and cannot be null.")); + } else { + resumeJobParams.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resume( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + resumeJobParams, + accept, + context); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginResumeAsync( + String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams) { + Mono>> mono = + resumeWithResponseAsync(resourceName, resourceGroupName, jobName, resumeJobParams); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, this.client.getContext()); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginResumeAsync( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resumeWithResponseAsync(resourceName, resourceGroupName, jobName, resumeJobParams, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, context); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginResume( + String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams) { + return beginResumeAsync(resourceName, resourceGroupName, jobName, resumeJobParams).getSyncPoller(); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginResume( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context) { + return beginResumeAsync(resourceName, resourceGroupName, jobName, resumeJobParams, context).getSyncPoller(); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync( + String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams) { + return beginResumeAsync(resourceName, resourceGroupName, jobName, resumeJobParams) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context) { + return beginResumeAsync(resourceName, resourceGroupName, jobName, resumeJobParams, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner resume( + String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams) { + return resumeAsync(resourceName, resourceGroupName, jobName, resumeJobParams).block(); + } + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner resume( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context) { + return resumeAsync(resourceName, resourceGroupName, jobName, resumeJobParams, context).block(); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportWithResponseAsync( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (jobQueryParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobQueryParameter is required and cannot be null.")); + } else { + jobQueryParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .export( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobQueryParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportWithResponseAsync( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (jobQueryParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobQueryParameter is required and cannot be null.")); + } else { + jobQueryParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .export( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + jobQueryParameter, + accept, + context); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginExportAsync( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter) { + Mono>> mono = + exportWithResponseAsync(resourceName, resourceGroupName, jobQueryParameter); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, this.client.getContext()); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginExportAsync( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + exportWithResponseAsync(resourceName, resourceGroupName, jobQueryParameter, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, context); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginExport( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter) { + return beginExportAsync(resourceName, resourceGroupName, jobQueryParameter).getSyncPoller(); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 job details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginExport( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context) { + return beginExportAsync(resourceName, resourceGroupName, jobQueryParameter, context).getSyncPoller(); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportAsync( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter) { + return beginExportAsync(resourceName, resourceGroupName, jobQueryParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportAsync( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context) { + return beginExportAsync(resourceName, resourceGroupName, jobQueryParameter, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner export(String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter) { + return exportAsync(resourceName, resourceGroupName, jobQueryParameter).block(); + } + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner export( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context) { + return exportAsync(resourceName, resourceGroupName, jobQueryParameter, 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 collection of jobs 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 collection of jobs 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsImpl.java new file mode 100644 index 000000000000..2a61f804ce79 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationJobsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.JobInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Job; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobQueryParameter; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationJobs; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParams; + +public final class ReplicationJobsImpl implements ReplicationJobs { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationJobsImpl.class); + + private final ReplicationJobsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationJobsImpl( + ReplicationJobsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, filter, context); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String jobName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, jobName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Job get(String resourceName, String resourceGroupName, String jobName) { + JobInner inner = this.serviceClient().get(resourceName, resourceGroupName, jobName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job cancel(String resourceName, String resourceGroupName, String jobName) { + JobInner inner = this.serviceClient().cancel(resourceName, resourceGroupName, jobName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job cancel(String resourceName, String resourceGroupName, String jobName, Context context) { + JobInner inner = this.serviceClient().cancel(resourceName, resourceGroupName, jobName, context); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job restart(String resourceName, String resourceGroupName, String jobName) { + JobInner inner = this.serviceClient().restart(resourceName, resourceGroupName, jobName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job restart(String resourceName, String resourceGroupName, String jobName, Context context) { + JobInner inner = this.serviceClient().restart(resourceName, resourceGroupName, jobName, context); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job resume(String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams) { + JobInner inner = this.serviceClient().resume(resourceName, resourceGroupName, jobName, resumeJobParams); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job resume( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context) { + JobInner inner = + this.serviceClient().resume(resourceName, resourceGroupName, jobName, resumeJobParams, context); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job export(String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter) { + JobInner inner = this.serviceClient().export(resourceName, resourceGroupName, jobQueryParameter); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job export( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context) { + JobInner inner = this.serviceClient().export(resourceName, resourceGroupName, jobQueryParameter, context); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + private ReplicationJobsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksClientImpl.java new file mode 100644 index 000000000000..94bfb4d69a8f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksClientImpl.java @@ -0,0 +1,571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationLogicalNetworksClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetworkCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationLogicalNetworksClient. */ +public final class ReplicationLogicalNetworksClientImpl implements ReplicationLogicalNetworksClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationLogicalNetworksService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationLogicalNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationLogicalNetworksClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationLogicalNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationLogicalNetworks to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationLogicalNetworksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabrics( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks" + + "/{logicalNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("logicalNetworkName") String logicalNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabricsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server 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 list of logical networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of logical networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server 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 list of logical networks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of logical networks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName, context), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server 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 list of logical networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of logical networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName, context)); + } + + /** + * Gets a logical network with specified server id and logical network name. + * + *

Gets the details of a logical network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param logicalNetworkName Logical network 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 a logical network along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + logicalNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a logical network with specified server id and logical network name. + * + *

Gets the details of a logical network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param logicalNetworkName Logical network 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 a logical network along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (logicalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter logicalNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + logicalNetworkName, + accept, + context); + } + + /** + * Gets a logical network with specified server id and logical network name. + * + *

Gets the details of a logical network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param logicalNetworkName Logical network 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 a logical network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, logicalNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a logical network with specified server id and logical network name. + * + *

Gets the details of a logical network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param logicalNetworkName Logical network 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 a logical network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, logicalNetworkName, context).block(); + } + + /** + * Gets a logical network with specified server id and logical network name. + * + *

Gets the details of a logical network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param logicalNetworkName Logical network 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 a logical network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicalNetworkInner get( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName) { + return getWithResponse(resourceName, resourceGroupName, fabricName, logicalNetworkName, Context.NONE) + .getValue(); + } + + /** + * 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 list of logical networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync(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.listByReplicationFabricsNext(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 list of logical networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync( + 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 + .listByReplicationFabricsNext(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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksImpl.java new file mode 100644 index 000000000000..75a17d341268 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationLogicalNetworksClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetwork; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationLogicalNetworks; + +public final class ReplicationLogicalNetworksImpl implements ReplicationLogicalNetworks { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationLogicalNetworksImpl.class); + + private final ReplicationLogicalNetworksClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationLogicalNetworksImpl( + ReplicationLogicalNetworksClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName); + return Utils.mapPage(inner, inner1 -> new LogicalNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName, context); + return Utils.mapPage(inner, inner1 -> new LogicalNetworkImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceName, resourceGroupName, fabricName, logicalNetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LogicalNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LogicalNetwork get( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName) { + LogicalNetworkInner inner = + this.serviceClient().get(resourceName, resourceGroupName, fabricName, logicalNetworkName); + if (inner != null) { + return new LogicalNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + private ReplicationLogicalNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsClientImpl.java new file mode 100644 index 000000000000..991029438b6d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsClientImpl.java @@ -0,0 +1,5300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.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.recoveryservicessiterecovery.fluent.ReplicationMigrationItemsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInput; +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 ReplicationMigrationItemsClient. */ +public final class ReplicationMigrationItemsClientImpl implements ReplicationMigrationItemsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationMigrationItemsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationMigrationItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationMigrationItemsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationMigrationItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationMigrationItems to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationMigrationItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainers( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @QueryParam("skipToken") String skipToken, + @QueryParam("takeToken") String takeToken, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @BodyParam("application/json") EnableMigrationInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @QueryParam("deleteOption") String deleteOption, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @BodyParam("application/json") UpdateMigrationItemInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @BodyParam("application/json") MigrateInput migrateInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/pauseReplication") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> pauseReplication( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @BodyParam("application/json") PauseReplicationInput pauseReplicationInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resumeReplication") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resumeReplication( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @BodyParam("application/json") ResumeReplicationInput resumeReplicationInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resync( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @BodyParam("application/json") ResyncInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> testMigrate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @BodyParam("application/json") TestMigrateInput testMigrateInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> testMigrateCleanup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("migrationItemName") String migrationItemName, + @BodyParam("application/json") TestMigrateCleanupInput testMigrateCleanupInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationMigrationItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("skipToken") String skipToken, + @QueryParam("takeToken") String takeToken, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainersNext( + @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 list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR migration items in the protection container along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String skipToken, + String takeToken, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByReplicationProtectionContainers( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + skipToken, + takeToken, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR migration items in the protection container along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String skipToken, + String takeToken, + String filter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationProtectionContainers( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + skipToken, + takeToken, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR migration items in the protection container as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String skipToken, + String takeToken, + String filter) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, skipToken, takeToken, filter), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR migration items in the protection container as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + final String skipToken = null; + final String takeToken = null; + final String filter = null; + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, skipToken, takeToken, filter), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR migration items in the protection container as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String skipToken, + String takeToken, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + skipToken, + takeToken, + filter, + context), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR migration items in the protection container as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + final String skipToken = null; + final String takeToken = null; + final String filter = null; + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, skipToken, takeToken, filter)); + } + + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR migration items in the protection container as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String skipToken, + String takeToken, + String filter, + Context context) { + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + skipToken, + takeToken, + filter, + context)); + } + + /** + * Gets the details of a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 a migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the details of a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 a migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + accept, + context); + } + + /** + * Gets the details of a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 a migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 a migration item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, context) + .block(); + } + + /** + * Gets the details of a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 a migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + return getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, Context.NONE) + .getValue(); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + input, + accept, + context); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input) { + Mono>> mono = + createWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationItemInner.class, + MigrationItemInner.class, + this.client.getContext()); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MigrationItemInner.class, MigrationItemInner.class, context); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .getSyncPoller(); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input, + Context context) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, context) + .getSyncPoller(); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input, + Context context) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input) { + return createAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .block(); + } + + /** + * Enables migration. + * + *

The operation to create an ASR migration item (enable migration). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Enable migration input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input, + Context context) { + return createAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, context) + .block(); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + deleteOption, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + deleteOption, + context); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption) { + Mono>> mono = + deleteWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, deleteOption); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + final String deleteOption = null; + Mono>> mono = + deleteWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, deleteOption); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + deleteOption, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + final String deleteOption = null; + return beginDeleteAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, deleteOption) + .getSyncPoller(); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + deleteOption, + context) + .getSyncPoller(); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption) { + return beginDeleteAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, deleteOption) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + final String deleteOption = null; + return beginDeleteAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, deleteOption) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + deleteOption, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + final String deleteOption = null; + deleteAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, deleteOption) + .block(); + } + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context) { + deleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + deleteOption, + context) + .block(); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + input, + accept, + context); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input) { + Mono>> mono = + updateWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationItemInner.class, + MigrationItemInner.class, + this.client.getContext()); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MigrationItemInner.class, MigrationItemInner.class, context); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .getSyncPoller(); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input, + Context context) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, context) + .getSyncPoller(); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input, + Context context) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input) { + return updateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .block(); + } + + /** + * Updates migration item. + * + *

The operation to update the recovery settings of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Update migration item input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input, + Context context) { + return updateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, context) + .block(); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (migrateInput == null) { + return Mono.error(new IllegalArgumentException("Parameter migrateInput is required and cannot be null.")); + } else { + migrateInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .migrate( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + migrateInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (migrateInput == null) { + return Mono.error(new IllegalArgumentException("Parameter migrateInput is required and cannot be null.")); + } else { + migrateInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .migrate( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + migrateInput, + accept, + context); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginMigrateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput) { + Mono>> mono = + migrateWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrateInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationItemInner.class, + MigrationItemInner.class, + this.client.getContext()); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginMigrateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + migrateWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MigrationItemInner.class, MigrationItemInner.class, context); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput) { + return beginMigrateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrateInput) + .getSyncPoller(); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context) { + return beginMigrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput, + context) + .getSyncPoller(); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput) { + return beginMigrateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrateInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context) { + return beginMigrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner migrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput) { + return migrateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrateInput) + .block(); + } + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner migrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context) { + return migrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput, + context) + .block(); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> pauseReplicationWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (pauseReplicationInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter pauseReplicationInput is required and cannot be null.")); + } else { + pauseReplicationInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .pauseReplication( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> pauseReplicationWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (pauseReplicationInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter pauseReplicationInput is required and cannot be null.")); + } else { + pauseReplicationInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .pauseReplication( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + accept, + context); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginPauseReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput) { + Mono>> mono = + pauseReplicationWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationItemInner.class, + MigrationItemInner.class, + this.client.getContext()); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginPauseReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + pauseReplicationWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MigrationItemInner.class, MigrationItemInner.class, context); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginPauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput) { + return beginPauseReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput) + .getSyncPoller(); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginPauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput, + Context context) { + return beginPauseReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + context) + .getSyncPoller(); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pauseReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput) { + return beginPauseReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pauseReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput, + Context context) { + return beginPauseReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner pauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput) { + return pauseReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput) + .block(); + } + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner pauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput, + Context context) { + return pauseReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + context) + .block(); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeReplicationWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (resumeReplicationInput == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resumeReplicationInput is required and cannot be null.")); + } else { + resumeReplicationInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resumeReplication( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeReplicationWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (resumeReplicationInput == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resumeReplicationInput is required and cannot be null.")); + } else { + resumeReplicationInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resumeReplication( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + accept, + context); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginResumeReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput) { + Mono>> mono = + resumeReplicationWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationItemInner.class, + MigrationItemInner.class, + this.client.getContext()); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginResumeReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resumeReplicationWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MigrationItemInner.class, MigrationItemInner.class, context); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginResumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput) { + return beginResumeReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput) + .getSyncPoller(); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginResumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput, + Context context) { + return beginResumeReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + context) + .getSyncPoller(); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput) { + return beginResumeReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput, + Context context) { + return beginResumeReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner resumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput) { + return resumeReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput) + .block(); + } + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner resumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput, + Context context) { + return resumeReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + context) + .block(); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resyncWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resync( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resyncWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resync( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + input, + accept, + context); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginResyncAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input) { + Mono>> mono = + resyncWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationItemInner.class, + MigrationItemInner.class, + this.client.getContext()); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginResyncAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resyncWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MigrationItemInner.class, MigrationItemInner.class, context); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginResync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input) { + return beginResyncAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .getSyncPoller(); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginResync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input, + Context context) { + return beginResyncAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, context) + .getSyncPoller(); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resyncAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input) { + return beginResyncAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resyncAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input, + Context context) { + return beginResyncAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner resync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input) { + return resyncAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .block(); + } + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner resync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input, + Context context) { + return resyncAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, context) + .block(); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testMigrateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (testMigrateInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter testMigrateInput is required and cannot be null.")); + } else { + testMigrateInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .testMigrate( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testMigrateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (testMigrateInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter testMigrateInput is required and cannot be null.")); + } else { + testMigrateInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .testMigrate( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput, + accept, + context); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginTestMigrateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput) { + Mono>> mono = + testMigrateWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationItemInner.class, + MigrationItemInner.class, + this.client.getContext()); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginTestMigrateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + testMigrateWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MigrationItemInner.class, MigrationItemInner.class, context); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginTestMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput) { + return beginTestMigrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput) + .getSyncPoller(); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginTestMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context) { + return beginTestMigrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput, + context) + .getSyncPoller(); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testMigrateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput) { + return beginTestMigrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testMigrateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context) { + return beginTestMigrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner testMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput) { + return testMigrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput) + .block(); + } + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner testMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context) { + return testMigrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput, + context) + .block(); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testMigrateCleanupWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (testMigrateCleanupInput == null) { + return Mono + .error( + new IllegalArgumentException("Parameter testMigrateCleanupInput is required and cannot be null.")); + } else { + testMigrateCleanupInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .testMigrateCleanup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testMigrateCleanupWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (migrationItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationItemName is required and cannot be null.")); + } + if (testMigrateCleanupInput == null) { + return Mono + .error( + new IllegalArgumentException("Parameter testMigrateCleanupInput is required and cannot be null.")); + } else { + testMigrateCleanupInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .testMigrateCleanup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput, + accept, + context); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginTestMigrateCleanupAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput) { + Mono>> mono = + testMigrateCleanupWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationItemInner.class, + MigrationItemInner.class, + this.client.getContext()); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationItemInner> beginTestMigrateCleanupAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + testMigrateCleanupWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MigrationItemInner.class, MigrationItemInner.class, context); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginTestMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput) { + return beginTestMigrateCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput) + .getSyncPoller(); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationItemInner> beginTestMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context) { + return beginTestMigrateCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput, + context) + .getSyncPoller(); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testMigrateCleanupAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput) { + return beginTestMigrateCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testMigrateCleanupAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context) { + return beginTestMigrateCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner testMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput) { + return testMigrateCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput) + .block(); + } + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationItemInner testMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context) { + return testMigrateCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput, + context) + .block(); + } + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of migration items in the vault along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String skipToken, String takeToken, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + skipToken, + takeToken, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of migration items in the vault along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, + String resourceGroupName, + String skipToken, + String takeToken, + String filter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + skipToken, + takeToken, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of migration items in the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, String skipToken, String takeToken, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, skipToken, takeToken, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration items in the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + final String skipToken = null; + final String takeToken = null; + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, skipToken, takeToken, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of migration items in the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, + String resourceGroupName, + String skipToken, + String takeToken, + String filter, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, skipToken, takeToken, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 migration items in the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + final String skipToken = null; + final String takeToken = null; + final String filter = null; + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, skipToken, takeToken, filter)); + } + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of migration items in the vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, + String resourceGroupName, + String skipToken, + String takeToken, + String filter, + Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, skipToken, takeToken, filter, 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 migration item collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersNextSinglePageAsync( + 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 + .listByReplicationProtectionContainersNext( + 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 migration item collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersNextSinglePageAsync( + 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 + .listByReplicationProtectionContainersNext(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 migration item 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 migration item 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsImpl.java new file mode 100644 index 000000000000..c033f6fcbe05 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsImpl.java @@ -0,0 +1,682 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationMigrationItemsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationMigrationItems; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInput; + +public final class ReplicationMigrationItemsImpl implements ReplicationMigrationItems { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationMigrationItemsImpl.class); + + private final ReplicationMigrationItemsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationMigrationItemsImpl( + ReplicationMigrationItemsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, resourceGroupName, fabricName, protectionContainerName); + return Utils.mapPage(inner, inner1 -> new MigrationItemImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String skipToken, + String takeToken, + String filter, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + skipToken, + takeToken, + filter, + context); + return Utils.mapPage(inner, inner1 -> new MigrationItemImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MigrationItemImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MigrationItem get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + MigrationItemInner inner = + this + .serviceClient() + .get(resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName) { + this + .serviceClient() + .delete(resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName); + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context) { + this + .serviceClient() + .delete( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + deleteOption, + context); + } + + public MigrationItem migrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput) { + MigrationItemInner inner = + this + .serviceClient() + .migrate( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem migrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context) { + MigrationItemInner inner = + this + .serviceClient() + .migrate( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput, + context); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem pauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput) { + MigrationItemInner inner = + this + .serviceClient() + .pauseReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem pauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput, + Context context) { + MigrationItemInner inner = + this + .serviceClient() + .pauseReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + context); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem resumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput) { + MigrationItemInner inner = + this + .serviceClient() + .resumeReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem resumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput, + Context context) { + MigrationItemInner inner = + this + .serviceClient() + .resumeReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + context); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem resync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input) { + MigrationItemInner inner = + this + .serviceClient() + .resync(resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem resync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input, + Context context) { + MigrationItemInner inner = + this + .serviceClient() + .resync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input, + context); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem testMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput) { + MigrationItemInner inner = + this + .serviceClient() + .testMigrate( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem testMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context) { + MigrationItemInner inner = + this + .serviceClient() + .testMigrate( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput, + context); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem testMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput) { + MigrationItemInner inner = + this + .serviceClient() + .testMigrateCleanup( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrationItem testMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context) { + MigrationItemInner inner = + this + .serviceClient() + .testMigrateCleanup( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput, + context); + if (inner != null) { + return new MigrationItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new MigrationItemImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceName, + String resourceGroupName, + String skipToken, + String takeToken, + String filter, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, skipToken, takeToken, filter, context); + return Utils.mapPage(inner, inner1 -> new MigrationItemImpl(inner1, this.manager())); + } + + public MigrationItem getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + String migrationItemName = Utils.getValueFromIdByName(id, "replicationMigrationItems"); + if (migrationItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationMigrationItems'.", + id))); + } + return this + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + String migrationItemName = Utils.getValueFromIdByName(id, "replicationMigrationItems"); + if (migrationItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationMigrationItems'.", + id))); + } + return this + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, context); + } + + public void deleteById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + String migrationItemName = Utils.getValueFromIdByName(id, "replicationMigrationItems"); + if (migrationItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationMigrationItems'.", + id))); + } + String localDeleteOption = null; + this + .delete( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + localDeleteOption, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, String deleteOption, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + String migrationItemName = Utils.getValueFromIdByName(id, "replicationMigrationItems"); + if (migrationItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationMigrationItems'.", + id))); + } + this + .delete( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + deleteOption, + context); + } + + private ReplicationMigrationItemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public MigrationItemImpl define(String name) { + return new MigrationItemImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsClientImpl.java new file mode 100644 index 000000000000..304bbb42adbc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsClientImpl.java @@ -0,0 +1,2156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationNetworkMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInput; +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 ReplicationNetworkMappingsClient. */ +public final class ReplicationNetworkMappingsClientImpl implements ReplicationNetworkMappingsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationNetworkMappingsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationNetworkMappingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationNetworkMappingsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationNetworkMappingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationNetworkMappings to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationNetworkMappingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}" + + "/replicationNetworkMappings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationNetworks( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("networkName") String networkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}" + + "/replicationNetworkMappings/{networkMappingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("networkName") String networkName, + @PathParam("networkMappingName") String networkMappingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}" + + "/replicationNetworkMappings/{networkMappingName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("networkName") String networkName, + @PathParam("networkMappingName") String networkMappingName, + @BodyParam("application/json") CreateNetworkMappingInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}" + + "/replicationNetworkMappings/{networkMappingName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("networkName") String networkName, + @PathParam("networkMappingName") String networkMappingName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}" + + "/replicationNetworkMappings/{networkMappingName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("networkName") String networkName, + @PathParam("networkMappingName") String networkMappingName, + @BodyParam("application/json") UpdateNetworkMappingInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationNetworkMappings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationNetworksNext( + @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 all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationNetworksSinglePageAsync( + String resourceName, String resourceGroupName, String fabricName, String networkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByReplicationNetworks( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationNetworksSinglePageAsync( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationNetworks( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationNetworksAsync( + String resourceName, String resourceGroupName, String fabricName, String networkName) { + return new PagedFlux<>( + () -> listByReplicationNetworksSinglePageAsync(resourceName, resourceGroupName, fabricName, networkName), + nextLink -> listByReplicationNetworksNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationNetworksAsync( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context) { + return new PagedFlux<>( + () -> + listByReplicationNetworksSinglePageAsync( + resourceName, resourceGroupName, fabricName, networkName, context), + nextLink -> listByReplicationNetworksNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName) { + return new PagedIterable<>( + listByReplicationNetworksAsync(resourceName, resourceGroupName, fabricName, networkName)); + } + + /** + * Gets all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context) { + return new PagedIterable<>( + listByReplicationNetworksAsync(resourceName, resourceGroupName, fabricName, networkName, context)); + } + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping 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 an ASR network mapping along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + if (networkMappingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkMappingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + networkMappingName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping 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 an ASR network mapping along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + if (networkMappingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkMappingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + networkMappingName, + accept, + context); + } + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping 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 an ASR network mapping on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping 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 an ASR network mapping along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context) + .block(); + } + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping 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 an ASR network mapping. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkMappingInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + return getWithResponse( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, Context.NONE) + .getValue(); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + if (networkMappingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkMappingName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + networkMappingName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + if (networkMappingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkMappingName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + networkMappingName, + input, + accept, + context); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkMappingInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input) { + Mono>> mono = + createWithResponseAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkMappingInner.class, + NetworkMappingInner.class, + this.client.getContext()); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkMappingInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkMappingInner.class, NetworkMappingInner.class, context); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input) + .getSyncPoller(); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input, + Context context) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, context) + .getSyncPoller(); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input, + Context context) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input) { + return createAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input).block(); + } + + /** + * Creates network mapping. + * + *

The operation to create an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Create network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input, + Context context) { + return createAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, context) + .block(); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + if (networkMappingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkMappingName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + networkMappingName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + if (networkMappingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkMappingName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + networkMappingName, + context); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName) + .getSyncPoller(); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context) + .getSyncPoller(); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + deleteAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName).block(); + } + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context) { + deleteAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context).block(); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + if (networkMappingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkMappingName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + networkMappingName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + if (networkMappingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkMappingName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + networkMappingName, + input, + accept, + context); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkMappingInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input) { + Mono>> mono = + updateWithResponseAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkMappingInner.class, + NetworkMappingInner.class, + this.client.getContext()); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkMappingInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkMappingInner.class, NetworkMappingInner.class, context); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input) + .getSyncPoller(); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network Mapping model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input, + Context context) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, context) + .getSyncPoller(); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input, + Context context) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkMappingInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input) { + return updateAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input).block(); + } + + /** + * Updates network mapping. + * + *

The operation to update an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping name. + * @param input Update network mapping input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Mapping model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkMappingInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input, + Context context) { + return updateAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, context) + .block(); + } + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network mappings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network mappings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network mappings as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network mappings as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network mappings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network mappings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 list of network mappings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationNetworksNextSinglePageAsync(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.listByReplicationNetworksNext(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 list of network mappings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationNetworksNextSinglePageAsync( + 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 + .listByReplicationNetworksNext(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 list of network mappings 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 list of network mappings 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsImpl.java new file mode 100644 index 000000000000..01879ddba81d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsImpl.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationNetworkMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationNetworkMappings; + +public final class ReplicationNetworkMappingsImpl implements ReplicationNetworkMappings { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationNetworkMappingsImpl.class); + + private final ReplicationNetworkMappingsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationNetworkMappingsImpl( + ReplicationNetworkMappingsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName) { + PagedIterable inner = + this.serviceClient().listByReplicationNetworks(resourceName, resourceGroupName, fabricName, networkName); + return Utils.mapPage(inner, inner1 -> new NetworkMappingImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationNetworks(resourceName, resourceGroupName, fabricName, networkName, context); + return Utils.mapPage(inner, inner1 -> new NetworkMappingImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkMappingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkMapping get( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + NetworkMappingInner inner = + this.serviceClient().get(resourceName, resourceGroupName, fabricName, networkName, networkMappingName); + if (inner != null) { + return new NetworkMappingImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + this.serviceClient().delete(resourceName, resourceGroupName, fabricName, networkName, networkMappingName); + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context) { + this + .serviceClient() + .delete(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context); + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkMappingImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkMappingImpl(inner1, this.manager())); + } + + public NetworkMapping getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 networkName = Utils.getValueFromIdByName(id, "replicationNetworks"); + if (networkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationNetworks'.", id))); + } + String networkMappingName = Utils.getValueFromIdByName(id, "replicationNetworkMappings"); + if (networkMappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationNetworkMappings'.", + id))); + } + return this + .getWithResponse(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 networkName = Utils.getValueFromIdByName(id, "replicationNetworks"); + if (networkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationNetworks'.", id))); + } + String networkMappingName = Utils.getValueFromIdByName(id, "replicationNetworkMappings"); + if (networkMappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationNetworkMappings'.", + id))); + } + return this + .getWithResponse(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context); + } + + public void deleteById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 networkName = Utils.getValueFromIdByName(id, "replicationNetworks"); + if (networkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationNetworks'.", id))); + } + String networkMappingName = Utils.getValueFromIdByName(id, "replicationNetworkMappings"); + if (networkMappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationNetworkMappings'.", + id))); + } + this.delete(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 networkName = Utils.getValueFromIdByName(id, "replicationNetworks"); + if (networkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationNetworks'.", id))); + } + String networkMappingName = Utils.getValueFromIdByName(id, "replicationNetworkMappings"); + if (networkMappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationNetworkMappings'.", + id))); + } + this.delete(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, context); + } + + private ReplicationNetworkMappingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public NetworkMappingImpl define(String name) { + return new NetworkMappingImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksClientImpl.java new file mode 100644 index 000000000000..5e693d7480a1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksClientImpl.java @@ -0,0 +1,850 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationNetworksClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationNetworksClient. */ +public final class ReplicationNetworksClientImpl implements ReplicationNetworksClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationNetworksService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationNetworksClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy.create(ReplicationNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationNetworks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationNetworksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabrics( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("networkName") String networkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabricsNext( + @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 list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName, context), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * Gets the list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName, context)); + } + + /** + * Gets a network with specified server id and network name. + * + *

Gets the details of a network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param networkName Primary network 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 a network along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String networkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a network with specified server id and network name. + * + *

Gets the details of a network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param networkName Primary network 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 a network along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (networkName == null) { + return Mono.error(new IllegalArgumentException("Parameter networkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + networkName, + accept, + context); + } + + /** + * Gets a network with specified server id and network name. + * + *

Gets the details of a network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param networkName Primary network 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 a network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String networkName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, networkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a network with specified server id and network name. + * + *

Gets the details of a network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param networkName Primary network 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 a network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, networkName, context).block(); + } + + /** + * Gets a network with specified server id and network name. + * + *

Gets the details of a network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param networkName Primary network 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 a network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInner get(String resourceName, String resourceGroupName, String fabricName, String networkName) { + return getWithResponse(resourceName, resourceGroupName, fabricName, networkName, Context.NONE).getValue(); + } + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of networks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of networks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of networks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 list of networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync(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.listByReplicationFabricsNext(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 list of networks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync( + 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 + .listByReplicationFabricsNext(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 list of networks 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 list of networks 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksImpl.java new file mode 100644 index 000000000000..856a8728a3bc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationNetworksClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Network; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationNetworks; + +public final class ReplicationNetworksImpl implements ReplicationNetworks { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationNetworksImpl.class); + + private final ReplicationNetworksClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationNetworksImpl( + ReplicationNetworksClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName); + return Utils.mapPage(inner, inner1 -> new NetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName, context); + return Utils.mapPage(inner, inner1 -> new NetworkImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, fabricName, networkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Network get(String resourceName, String resourceGroupName, String fabricName, String networkName) { + NetworkInner inner = this.serviceClient().get(resourceName, resourceGroupName, fabricName, networkName); + if (inner != null) { + return new NetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkImpl(inner1, this.manager())); + } + + private ReplicationNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesClientImpl.java new file mode 100644 index 000000000000..4127929a519a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesClientImpl.java @@ -0,0 +1,1459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationPoliciesClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.PolicyInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInput; +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 ReplicationPoliciesClient. */ +public final class ReplicationPoliciesClientImpl implements ReplicationPoliciesClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationPoliciesService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationPoliciesClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy.create(ReplicationPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationPolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationPolicies/{policyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyName") String policyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationPolicies/{policyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyName") String policyName, + @BodyParam("application/json") CreatePolicyInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationPolicies/{policyName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyName") String policyName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationPolicies/{policyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyName") String policyName, + @BodyParam("application/json") UpdatePolicyInput input, + @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 list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Profile Collection details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Profile Collection details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Profile Collection details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Profile Collection details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Profile Collection details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Profile Collection details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, context)); + } + + /** + * Gets the requested policy. + * + *

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

Gets the details of a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 a replication policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + accept, + context); + } + + /** + * Gets the requested policy. + * + *

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

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

Gets the details of a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 a replication policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyInner get(String resourceName, String resourceGroupName, String policyName) { + return getWithResponse(resourceName, resourceGroupName, policyName, Context.NONE).getValue(); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + input, + accept, + context); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PolicyInner> beginCreateAsync( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input) { + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, policyName, input); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PolicyInner.class, PolicyInner.class, this.client.getContext()); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PolicyInner> beginCreateAsync( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, policyName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PolicyInner.class, PolicyInner.class, context); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PolicyInner> beginCreate( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input) { + return beginCreateAsync(resourceName, resourceGroupName, policyName, input).getSyncPoller(); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PolicyInner> beginCreate( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input, Context context) { + return beginCreateAsync(resourceName, resourceGroupName, policyName, input, context).getSyncPoller(); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input) { + return beginCreateAsync(resourceName, resourceGroupName, policyName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input, Context context) { + return beginCreateAsync(resourceName, resourceGroupName, policyName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyInner create( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input) { + return createAsync(resourceName, resourceGroupName, policyName, input).block(); + } + + /** + * Creates the policy. + * + *

The operation to create a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication policy name. + * @param input Create policy input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyInner create( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input, Context context) { + return createAsync(resourceName, resourceGroupName, policyName, input, context).block(); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + context); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName) { + Mono>> mono = deleteWithResponseAsync(resourceName, resourceGroupName, policyName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, policyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName) { + return beginDeleteAsync(resourceName, resourceGroupName, policyName).getSyncPoller(); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, policyName, context).getSyncPoller(); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName) { + return beginDeleteAsync(resourceName, resourceGroupName, policyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, policyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName) { + deleteAsync(resourceName, resourceGroupName, policyName).block(); + } + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName, Context context) { + deleteAsync(resourceName, resourceGroupName, policyName, context).block(); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + input, + accept, + context); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PolicyInner> beginUpdateAsync( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input) { + Mono>> mono = + updateWithResponseAsync(resourceName, resourceGroupName, policyName, input); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PolicyInner.class, PolicyInner.class, this.client.getContext()); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PolicyInner> beginUpdateAsync( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceName, resourceGroupName, policyName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PolicyInner.class, PolicyInner.class, context); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PolicyInner> beginUpdate( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, policyName, input).getSyncPoller(); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection profile details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PolicyInner> beginUpdate( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input, Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, policyName, input, context).getSyncPoller(); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, policyName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input, Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, policyName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyInner update( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input) { + return updateAsync(resourceName, resourceGroupName, policyName, input).block(); + } + + /** + * Updates the policy. + * + *

The operation to update a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Policy Id. + * @param input Update Policy Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection profile details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyInner update( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input, Context context) { + return updateAsync(resourceName, resourceGroupName, policyName, input, 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 protection Profile Collection details 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 protection Profile Collection details 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesImpl.java new file mode 100644 index 000000000000..17c3e9067fde --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationPoliciesClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.PolicyInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Policy; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationPolicies; + +public final class ReplicationPoliciesImpl implements ReplicationPolicies { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationPoliciesImpl.class); + + private final ReplicationPoliciesClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationPoliciesImpl( + ReplicationPoliciesClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PolicyImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String policyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, policyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Policy get(String resourceName, String resourceGroupName, String policyName) { + PolicyInner inner = this.serviceClient().get(resourceName, resourceGroupName, policyName); + if (inner != null) { + return new PolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceName, String resourceGroupName, String policyName) { + this.serviceClient().delete(resourceName, resourceGroupName, policyName); + } + + public void delete(String resourceName, String resourceGroupName, String policyName, Context context) { + this.serviceClient().delete(resourceName, resourceGroupName, policyName, context); + } + + public Policy getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 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(resourceName, resourceGroupName, policyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 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(resourceName, resourceGroupName, policyName, context); + } + + public void deleteById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 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(resourceName, resourceGroupName, policyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 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(resourceName, resourceGroupName, policyName, context); + } + + private ReplicationPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public PolicyImpl define(String name) { + return new PolicyImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsClientImpl.java new file mode 100644 index 000000000000..5cd8179a1de0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsClientImpl.java @@ -0,0 +1,748 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationProtectableItemsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectableItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItemCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationProtectableItemsClient. */ +public final class ReplicationProtectableItemsClientImpl implements ReplicationProtectableItemsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationProtectableItemsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationProtectableItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationProtectableItemsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationProtectableItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationProtectableItems to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationProtectableItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectableItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainers( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @QueryParam("$filter") String filter, + @QueryParam("$take") String take, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectableItems/{protectableItemName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("protectableItemName") String protectableItemName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param filter OData filter options. + * @param take take OData query parameter. + * @param skipToken skipToken OData query 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 protectable item collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + String take, + String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByReplicationProtectionContainers( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + filter, + take, + skipToken, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param filter OData filter options. + * @param take take OData query parameter. + * @param skipToken skipToken OData query 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 protectable item collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + String take, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationProtectionContainers( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + filter, + take, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param filter OData filter options. + * @param take take OData query parameter. + * @param skipToken skipToken OData query 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 protectable item collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + String take, + String skipToken) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, filter, take, skipToken), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protectable item collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + final String filter = null; + final String take = null; + final String skipToken = null; + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, filter, take, skipToken), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param filter OData filter options. + * @param take take OData query parameter. + * @param skipToken skipToken OData query 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 protectable item collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + String take, + String skipToken, + Context context) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + filter, + take, + skipToken, + context), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protectable item collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + final String filter = null; + final String take = null; + final String skipToken = null; + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, filter, take, skipToken)); + } + + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param filter OData filter options. + * @param take take OData query parameter. + * @param skipToken skipToken OData query 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 protectable item collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + String take, + String skipToken, + Context context) { + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + filter, + take, + skipToken, + context)); + } + + /** + * Gets the details of a protectable item. + * + *

The operation to get the details of a protectable item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param protectableItemName Protectable 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 replication protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (protectableItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectableItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + protectableItemName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the details of a protectable item. + * + *

The operation to get the details of a protectable item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param protectableItemName Protectable 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 replication protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (protectableItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectableItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + protectableItemName, + accept, + context); + } + + /** + * Gets the details of a protectable item. + * + *

The operation to get the details of a protectable item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param protectableItemName Protectable 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 replication protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, protectableItemName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a protectable item. + * + *

The operation to get the details of a protectable item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param protectableItemName Protectable 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 replication protected item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName, + Context context) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, protectableItemName, context) + .block(); + } + + /** + * Gets the details of a protectable item. + * + *

The operation to get the details of a protectable item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param protectableItemName Protectable 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectableItemInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName) { + return getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, protectableItemName, Context.NONE) + .getValue(); + } + + /** + * 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 protectable item collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersNextSinglePageAsync( + 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 + .listByReplicationProtectionContainersNext( + 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 protectable item collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersNextSinglePageAsync( + 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 + .listByReplicationProtectionContainersNext(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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsImpl.java new file mode 100644 index 000000000000..4ef0d72dca5a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsImpl.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationProtectableItemsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectableItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectableItems; + +public final class ReplicationProtectableItemsImpl implements ReplicationProtectableItems { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationProtectableItemsImpl.class); + + private final ReplicationProtectableItemsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationProtectableItemsImpl( + ReplicationProtectableItemsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, resourceGroupName, fabricName, protectionContainerName); + return Utils.mapPage(inner, inner1 -> new ProtectableItemImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + String take, + String skipToken, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + filter, + take, + skipToken, + context); + return Utils.mapPage(inner, inner1 -> new ProtectableItemImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, protectableItemName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectableItemImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProtectableItem get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName) { + ProtectableItemInner inner = + this + .serviceClient() + .get(resourceName, resourceGroupName, fabricName, protectionContainerName, protectableItemName); + if (inner != null) { + return new ProtectableItemImpl(inner, this.manager()); + } else { + return null; + } + } + + private ReplicationProtectableItemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemImpl.java new file mode 100644 index 000000000000..f3b613836e9a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemImpl.java @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties; + +public final class ReplicationProtectedItemImpl + implements ReplicationProtectedItem, ReplicationProtectedItem.Definition, ReplicationProtectedItem.Update { + private ReplicationProtectedItemInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ReplicationProtectedItemProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ReplicationProtectedItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String fabricName; + + private String protectionContainerName; + + private String replicatedProtectedItemName; + + private EnableProtectionInput createInput; + + private UpdateReplicationProtectedItemInput updateUpdateProtectionInput; + + public ReplicationProtectedItemImpl withExistingReplicationProtectionContainer( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + this.protectionContainerName = protectionContainerName; + return this; + } + + public ReplicationProtectedItem create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectedItems() + .create( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + createInput, + Context.NONE); + return this; + } + + public ReplicationProtectedItem create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectedItems() + .create( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + createInput, + context); + return this; + } + + ReplicationProtectedItemImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new ReplicationProtectedItemInner(); + this.serviceManager = serviceManager; + this.replicatedProtectedItemName = name; + this.createInput = new EnableProtectionInput(); + } + + public ReplicationProtectedItemImpl update() { + this.updateUpdateProtectionInput = new UpdateReplicationProtectedItemInput(); + return this; + } + + public ReplicationProtectedItem apply() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectedItems() + .update( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateUpdateProtectionInput, + Context.NONE); + return this; + } + + public ReplicationProtectedItem apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectedItems() + .update( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateUpdateProtectionInput, + context); + return this; + } + + ReplicationProtectedItemImpl( + ReplicationProtectedItemInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fabricName = Utils.getValueFromIdByName(innerObject.id(), "replicationFabrics"); + this.protectionContainerName = Utils.getValueFromIdByName(innerObject.id(), "replicationProtectionContainers"); + this.replicatedProtectedItemName = Utils.getValueFromIdByName(innerObject.id(), "replicationProtectedItems"); + } + + public ReplicationProtectedItem refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectedItems() + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + Context.NONE) + .getValue(); + return this; + } + + public ReplicationProtectedItem refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectedItems() + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .getValue(); + return this; + } + + public ReplicationProtectedItem addDisks(AddDisksInput addDisksInput) { + return serviceManager + .replicationProtectedItems() + .addDisks( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput); + } + + public ReplicationProtectedItem addDisks(AddDisksInput addDisksInput, Context context) { + return serviceManager + .replicationProtectedItems() + .addDisks( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput, + context); + } + + public ReplicationProtectedItem applyRecoveryPoint(ApplyRecoveryPointInput applyRecoveryPointInput) { + return serviceManager + .replicationProtectedItems() + .applyRecoveryPoint( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput); + } + + public ReplicationProtectedItem applyRecoveryPoint( + ApplyRecoveryPointInput applyRecoveryPointInput, Context context) { + return serviceManager + .replicationProtectedItems() + .applyRecoveryPoint( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput, + context); + } + + public ReplicationProtectedItem failoverCancel() { + return serviceManager + .replicationProtectedItems() + .failoverCancel( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + } + + public ReplicationProtectedItem failoverCancel(Context context) { + return serviceManager + .replicationProtectedItems() + .failoverCancel( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + } + + public ReplicationProtectedItem failoverCommit() { + return serviceManager + .replicationProtectedItems() + .failoverCommit( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + } + + public ReplicationProtectedItem failoverCommit(Context context) { + return serviceManager + .replicationProtectedItems() + .failoverCommit( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + } + + public ReplicationProtectedItem plannedFailover(PlannedFailoverInput failoverInput) { + return serviceManager + .replicationProtectedItems() + .plannedFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput); + } + + public ReplicationProtectedItem plannedFailover(PlannedFailoverInput failoverInput, Context context) { + return serviceManager + .replicationProtectedItems() + .plannedFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context); + } + + public void delete(DisableProtectionInput disableProtectionInput) { + serviceManager + .replicationProtectedItems() + .delete( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput); + } + + public void delete(DisableProtectionInput disableProtectionInput, Context context) { + serviceManager + .replicationProtectedItems() + .delete( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput, + context); + } + + public ReplicationProtectedItem removeDisks(RemoveDisksInput removeDisksInput) { + return serviceManager + .replicationProtectedItems() + .removeDisks( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput); + } + + public ReplicationProtectedItem removeDisks(RemoveDisksInput removeDisksInput, Context context) { + return serviceManager + .replicationProtectedItems() + .removeDisks( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput, + context); + } + + public ReplicationProtectedItem repairReplication() { + return serviceManager + .replicationProtectedItems() + .repairReplication( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + } + + public ReplicationProtectedItem repairReplication(Context context) { + return serviceManager + .replicationProtectedItems() + .repairReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + } + + public ReplicationProtectedItem reprotect(ReverseReplicationInput reprotectInput) { + return serviceManager + .replicationProtectedItems() + .reprotect( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput); + } + + public ReplicationProtectedItem reprotect(ReverseReplicationInput reprotectInput, Context context) { + return serviceManager + .replicationProtectedItems() + .reprotect( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput, + context); + } + + public ReplicationProtectedItem resolveHealthErrors(ResolveHealthInput resolveHealthInput) { + return serviceManager + .replicationProtectedItems() + .resolveHealthErrors( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput); + } + + public ReplicationProtectedItem resolveHealthErrors(ResolveHealthInput resolveHealthInput, Context context) { + return serviceManager + .replicationProtectedItems() + .resolveHealthErrors( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput, + context); + } + + public ReplicationProtectedItem switchProvider(SwitchProviderInput switchProviderInput) { + return serviceManager + .replicationProtectedItems() + .switchProvider( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput); + } + + public ReplicationProtectedItem switchProvider(SwitchProviderInput switchProviderInput, Context context) { + return serviceManager + .replicationProtectedItems() + .switchProvider( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput, + context); + } + + public ReplicationProtectedItem testFailover(TestFailoverInput testfailoverInput) { + return serviceManager + .replicationProtectedItems() + .testFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput); + } + + public ReplicationProtectedItem testFailover(TestFailoverInput testfailoverInput, Context context) { + return serviceManager + .replicationProtectedItems() + .testFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput, + context); + } + + public ReplicationProtectedItem testFailoverCleanup(TestFailoverCleanupInput cleanupInput) { + return serviceManager + .replicationProtectedItems() + .testFailoverCleanup( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput); + } + + public ReplicationProtectedItem testFailoverCleanup(TestFailoverCleanupInput cleanupInput, Context context) { + return serviceManager + .replicationProtectedItems() + .testFailoverCleanup( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput, + context); + } + + public ReplicationProtectedItem unplannedFailover(UnplannedFailoverInput failoverInput) { + return serviceManager + .replicationProtectedItems() + .unplannedFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput); + } + + public ReplicationProtectedItem unplannedFailover(UnplannedFailoverInput failoverInput, Context context) { + return serviceManager + .replicationProtectedItems() + .unplannedFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context); + } + + public ReplicationProtectedItem updateAppliance( + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput) { + return serviceManager + .replicationProtectedItems() + .updateAppliance( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput); + } + + public ReplicationProtectedItem updateAppliance( + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, Context context) { + return serviceManager + .replicationProtectedItems() + .updateAppliance( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput, + context); + } + + public ReplicationProtectedItem updateMobilityService(UpdateMobilityServiceRequest updateMobilityServiceRequest) { + return serviceManager + .replicationProtectedItems() + .updateMobilityService( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest); + } + + public ReplicationProtectedItem updateMobilityService( + UpdateMobilityServiceRequest updateMobilityServiceRequest, Context context) { + return serviceManager + .replicationProtectedItems() + .updateMobilityService( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest, + context); + } + + public ReplicationProtectedItemImpl withProperties(EnableProtectionInputProperties properties) { + this.createInput.withProperties(properties); + return this; + } + + public ReplicationProtectedItemImpl withProperties(UpdateReplicationProtectedItemInputProperties properties) { + this.updateUpdateProtectionInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsClientImpl.java new file mode 100644 index 000000000000..e4d26d08da0a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsClientImpl.java @@ -0,0 +1,10118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.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.recoveryservicessiterecovery.fluent.ReplicationProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInput; +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 ReplicationProtectedItemsClient. */ +public final class ReplicationProtectedItemsClientImpl implements ReplicationProtectedItemsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationProtectedItemsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationProtectedItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationProtectedItemsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationProtectedItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationProtectedItems to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationProtectedItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainers( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") EnableProtectionInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") UpdateReplicationProtectedItemInput updateProtectionInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> addDisks( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") AddDisksInput addDisksInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" + + "/applyRecoveryPoint") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> applyRecoveryPoint( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") ApplyRecoveryPointInput applyRecoveryPointInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failoverCancel( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failoverCommit( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> plannedFailover( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") PlannedFailoverInput failoverInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") DisableProtectionInput disableProtectionInput, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> removeDisks( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") RemoveDisksInput removeDisksInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" + + "/repairReplication") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> repairReplication( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reprotect( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") ReverseReplicationInput reprotectInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" + + "/resolveHealthErrors") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resolveHealthErrors( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") ResolveHealthInput resolveHealthInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> switchProvider( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") SwitchProviderInput switchProviderInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> testFailover( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") TestFailoverInput testfailoverInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" + + "/testFailoverCleanup") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> testFailoverCleanup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") TestFailoverCleanupInput cleanupInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" + + "/unplannedFailover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> unplannedFailover( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") UnplannedFailoverInput failoverInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAppliance( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" + + "/updateMobilityService") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateMobilityService( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @BodyParam("application/json") UpdateMobilityServiceRequest updateMobilityServiceRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationProtectedItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("skipToken") String skipToken, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainersNext( + @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 list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByReplicationProtectionContainers( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationProtectionContainers( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, context), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName)); + } + + /** + * Gets the list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, context)); + } + + /** + * Gets the details of a Replication protected item. + * + *

Gets the details of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 an ASR replication protected item along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the details of a Replication protected item. + * + *

Gets the details of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 an ASR replication protected item along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context); + } + + /** + * Gets the details of a Replication protected item. + * + *

Gets the details of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 an ASR replication protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a Replication protected item. + * + *

Gets the details of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 an ASR replication protected item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return getWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .block(); + } + + /** + * Gets the details of a Replication protected item. + * + *

Gets the details of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 an ASR replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + Context.NONE) + .getValue(); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input, + accept, + context); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input) { + Mono>> mono = + createWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input) + .getSyncPoller(); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input, + Context context) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input, + context) + .getSyncPoller(); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input, + Context context) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input) { + return createAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input) + .block(); + } + + /** + * Enables protection. + * + *

The operation to create an ASR replication protected item (Enable replication). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName A name for the replication protected item. + * @param input Enable Protection Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input, + Context context) { + return createAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input, + context) + .block(); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .purge( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .purge( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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> beginPurgeAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + Mono>> mono = + purgeWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + purgeWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginPurgeAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .getSyncPoller(); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginPurgeAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .getSyncPoller(); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 purgeAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginPurgeAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginPurgeAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + purgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .block(); + } + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + purgeAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .block(); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (updateProtectionInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateProtectionInput is required and cannot be null.")); + } else { + updateProtectionInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (updateProtectionInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateProtectionInput is required and cannot be null.")); + } else { + updateProtectionInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput, + accept, + context); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput) { + Mono>> mono = + updateWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput) { + return beginUpdateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput) + .getSyncPoller(); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput, + Context context) { + return beginUpdateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput, + context) + .getSyncPoller(); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput) { + return beginUpdateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput, + Context context) { + return beginUpdateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput) { + return updateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput) + .block(); + } + + /** + * Updates the replication protected item settings. + * + *

The operation to update the recovery settings of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param updateProtectionInput Update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput, + Context context) { + return updateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput, + context) + .block(); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> addDisksWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (addDisksInput == null) { + return Mono.error(new IllegalArgumentException("Parameter addDisksInput is required and cannot be null.")); + } else { + addDisksInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .addDisks( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> addDisksWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (addDisksInput == null) { + return Mono.error(new IllegalArgumentException("Parameter addDisksInput is required and cannot be null.")); + } else { + addDisksInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .addDisks( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput, + accept, + context); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginAddDisksAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput) { + Mono>> mono = + addDisksWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginAddDisksAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + addDisksWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginAddDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput) { + return beginAddDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput) + .getSyncPoller(); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginAddDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context) { + return beginAddDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput, + context) + .getSyncPoller(); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addDisksAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput) { + return beginAddDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addDisksAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context) { + return beginAddDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner addDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput) { + return addDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput) + .block(); + } + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner addDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context) { + return addDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput, + context) + .block(); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> applyRecoveryPointWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (applyRecoveryPointInput == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applyRecoveryPointInput is required and cannot be null.")); + } else { + applyRecoveryPointInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .applyRecoveryPoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> applyRecoveryPointWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (applyRecoveryPointInput == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applyRecoveryPointInput is required and cannot be null.")); + } else { + applyRecoveryPointInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .applyRecoveryPoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput, + accept, + context); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginApplyRecoveryPointAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput) { + Mono>> mono = + applyRecoveryPointWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginApplyRecoveryPointAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + applyRecoveryPointWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginApplyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput) { + return beginApplyRecoveryPointAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput) + .getSyncPoller(); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginApplyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context) { + return beginApplyRecoveryPointAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput, + context) + .getSyncPoller(); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyRecoveryPointAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput) { + return beginApplyRecoveryPointAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyRecoveryPointAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context) { + return beginApplyRecoveryPointAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner applyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput) { + return applyRecoveryPointAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput) + .block(); + } + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner applyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context) { + return applyRecoveryPointAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput, + context) + .block(); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverCancelWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .failoverCancel( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverCancelWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .failoverCancel( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginFailoverCancelAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + Mono>> mono = + failoverCancelWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link PollerFlux} for polling of replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginFailoverCancelAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + failoverCancelWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginFailoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginFailoverCancelAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .getSyncPoller(); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link SyncPoller} for polling of replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginFailoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginFailoverCancelAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .getSyncPoller(); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverCancelAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginFailoverCancelAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverCancelAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginFailoverCancelAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner failoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return failoverCancelAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .block(); + } + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner failoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return failoverCancelAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .block(); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverCommitWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .failoverCommit( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverCommitWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .failoverCommit( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginFailoverCommitAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + Mono>> mono = + failoverCommitWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link PollerFlux} for polling of replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginFailoverCommitAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + failoverCommitWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginFailoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginFailoverCommitAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .getSyncPoller(); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 {@link SyncPoller} for polling of replication protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginFailoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginFailoverCommitAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .getSyncPoller(); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverCommitAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginFailoverCommitAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverCommitAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginFailoverCommitAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner failoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return failoverCommitAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .block(); + } + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner failoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return failoverCommitAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .block(); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> plannedFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (failoverInput == null) { + return Mono.error(new IllegalArgumentException("Parameter failoverInput is required and cannot be null.")); + } else { + failoverInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .plannedFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> plannedFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (failoverInput == null) { + return Mono.error(new IllegalArgumentException("Parameter failoverInput is required and cannot be null.")); + } else { + failoverInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .plannedFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + accept, + context); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginPlannedFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput) { + Mono>> mono = + plannedFailoverWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginPlannedFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + plannedFailoverWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput) { + return beginPlannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput) + .getSyncPoller(); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context) { + return beginPlannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context) + .getSyncPoller(); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono plannedFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput) { + return beginPlannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono plannedFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context) { + return beginPlannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput) { + return plannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput) + .block(); + } + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context) { + return plannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context) + .block(); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (disableProtectionInput == null) { + return Mono + .error( + new IllegalArgumentException("Parameter disableProtectionInput is required and cannot be null.")); + } else { + disableProtectionInput.validate(); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (disableProtectionInput == null) { + return Mono + .error( + new IllegalArgumentException("Parameter disableProtectionInput is required and cannot be null.")); + } else { + disableProtectionInput.validate(); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput, + context); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput) { + Mono>> mono = + deleteWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput) + .getSyncPoller(); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput, + context) + .getSyncPoller(); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput) { + deleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput) + .block(); + } + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context) { + deleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput, + context) + .block(); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> removeDisksWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (removeDisksInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter removeDisksInput is required and cannot be null.")); + } else { + removeDisksInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .removeDisks( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> removeDisksWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (removeDisksInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter removeDisksInput is required and cannot be null.")); + } else { + removeDisksInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .removeDisks( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput, + accept, + context); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginRemoveDisksAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput) { + Mono>> mono = + removeDisksWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginRemoveDisksAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + removeDisksWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginRemoveDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput) { + return beginRemoveDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput) + .getSyncPoller(); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginRemoveDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context) { + return beginRemoveDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput, + context) + .getSyncPoller(); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono removeDisksAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput) { + return beginRemoveDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono removeDisksAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context) { + return beginRemoveDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner removeDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput) { + return removeDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput) + .block(); + } + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner removeDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context) { + return removeDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput, + context) + .block(); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> repairReplicationWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .repairReplication( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> repairReplicationWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .repairReplication( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginRepairReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + Mono>> mono = + repairReplicationWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginRepairReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + repairReplicationWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginRepairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginRepairReplicationAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .getSyncPoller(); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginRepairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginRepairReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .getSyncPoller(); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono repairReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginRepairReplicationAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono repairReplicationAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginRepairReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner repairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return repairReplicationAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .block(); + } + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner repairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return repairReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .block(); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reprotectWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (reprotectInput == null) { + return Mono.error(new IllegalArgumentException("Parameter reprotectInput is required and cannot be null.")); + } else { + reprotectInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reprotect( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reprotectWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (reprotectInput == null) { + return Mono.error(new IllegalArgumentException("Parameter reprotectInput is required and cannot be null.")); + } else { + reprotectInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reprotect( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput, + accept, + context); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginReprotectAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput) { + Mono>> mono = + reprotectWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginReprotectAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reprotectWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginReprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput) { + return beginReprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput) + .getSyncPoller(); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginReprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput, + Context context) { + return beginReprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput, + context) + .getSyncPoller(); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reprotectAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput) { + return beginReprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reprotectAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput, + Context context) { + return beginReprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput) { + return reprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput) + .block(); + } + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput, + Context context) { + return reprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput, + context) + .block(); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resolveHealthErrorsWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (resolveHealthInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter resolveHealthInput is required and cannot be null.")); + } else { + resolveHealthInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resolveHealthErrors( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resolveHealthErrorsWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (resolveHealthInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter resolveHealthInput is required and cannot be null.")); + } else { + resolveHealthInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resolveHealthErrors( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput, + accept, + context); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginResolveHealthErrorsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput) { + Mono>> mono = + resolveHealthErrorsWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginResolveHealthErrorsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resolveHealthErrorsWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> + beginResolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput) { + return beginResolveHealthErrorsAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput) + .getSyncPoller(); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> + beginResolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context) { + return beginResolveHealthErrorsAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput, + context) + .getSyncPoller(); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resolveHealthErrorsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput) { + return beginResolveHealthErrorsAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resolveHealthErrorsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context) { + return beginResolveHealthErrorsAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner resolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput) { + return resolveHealthErrorsAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput) + .block(); + } + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner resolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context) { + return resolveHealthErrorsAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput, + context) + .block(); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> switchProviderWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (switchProviderInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter switchProviderInput is required and cannot be null.")); + } else { + switchProviderInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .switchProvider( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> switchProviderWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (switchProviderInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter switchProviderInput is required and cannot be null.")); + } else { + switchProviderInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .switchProvider( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput, + accept, + context); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginSwitchProviderAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput) { + Mono>> mono = + switchProviderWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginSwitchProviderAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + switchProviderWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginSwitchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput) { + return beginSwitchProviderAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput) + .getSyncPoller(); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginSwitchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput, + Context context) { + return beginSwitchProviderAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput, + context) + .getSyncPoller(); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono switchProviderAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput) { + return beginSwitchProviderAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono switchProviderAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput, + Context context) { + return beginSwitchProviderAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner switchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput) { + return switchProviderAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput) + .block(); + } + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner switchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput, + Context context) { + return switchProviderAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput, + context) + .block(); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (testfailoverInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter testfailoverInput is required and cannot be null.")); + } else { + testfailoverInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .testFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (testfailoverInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter testfailoverInput is required and cannot be null.")); + } else { + testfailoverInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .testFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput, + accept, + context); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginTestFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput) { + Mono>> mono = + testFailoverWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> beginTestFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + testFailoverWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput) { + return beginTestFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput) + .getSyncPoller(); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput, + Context context) { + return beginTestFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput, + context) + .getSyncPoller(); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput) { + return beginTestFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput, + Context context) { + return beginTestFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner testFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput) { + return testFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput) + .block(); + } + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner testFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput, + Context context) { + return testFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput, + context) + .block(); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverCleanupWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (cleanupInput == null) { + return Mono.error(new IllegalArgumentException("Parameter cleanupInput is required and cannot be null.")); + } else { + cleanupInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .testFailoverCleanup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverCleanupWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (cleanupInput == null) { + return Mono.error(new IllegalArgumentException("Parameter cleanupInput is required and cannot be null.")); + } else { + cleanupInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .testFailoverCleanup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput, + accept, + context); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginTestFailoverCleanupAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput) { + Mono>> mono = + testFailoverCleanupWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginTestFailoverCleanupAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + testFailoverCleanupWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> + beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput) { + return beginTestFailoverCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput) + .getSyncPoller(); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> + beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context) { + return beginTestFailoverCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput, + context) + .getSyncPoller(); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverCleanupAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput) { + return beginTestFailoverCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverCleanupAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context) { + return beginTestFailoverCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner testFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput) { + return testFailoverCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput) + .block(); + } + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner testFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context) { + return testFailoverCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput, + context) + .block(); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> unplannedFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (failoverInput == null) { + return Mono.error(new IllegalArgumentException("Parameter failoverInput is required and cannot be null.")); + } else { + failoverInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .unplannedFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> unplannedFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (failoverInput == null) { + return Mono.error(new IllegalArgumentException("Parameter failoverInput is required and cannot be null.")); + } else { + failoverInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .unplannedFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + accept, + context); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginUnplannedFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput) { + Mono>> mono = + unplannedFailoverWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginUnplannedFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + unplannedFailoverWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput) { + return beginUnplannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput) + .getSyncPoller(); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context) { + return beginUnplannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context) + .getSyncPoller(); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono unplannedFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput) { + return beginUnplannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono unplannedFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context) { + return beginUnplannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput) { + return unplannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput) + .block(); + } + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context) { + return unplannedFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context) + .block(); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateApplianceWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (applianceUpdateInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter applianceUpdateInput is required and cannot be null.")); + } else { + applianceUpdateInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAppliance( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateApplianceWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (applianceUpdateInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter applianceUpdateInput is required and cannot be null.")); + } else { + applianceUpdateInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAppliance( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput, + accept, + context); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginUpdateApplianceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput) { + Mono>> mono = + updateApplianceWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginUpdateApplianceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateApplianceWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginUpdateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput) { + return beginUpdateApplianceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput) + .getSyncPoller(); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> beginUpdateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + Context context) { + return beginUpdateApplianceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput, + context) + .getSyncPoller(); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateApplianceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput) { + return beginUpdateApplianceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateApplianceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + Context context) { + return beginUpdateApplianceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner updateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput) { + return updateApplianceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput) + .block(); + } + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner updateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + Context context) { + return updateApplianceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput, + context) + .block(); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateMobilityServiceWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (updateMobilityServiceRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter updateMobilityServiceRequest is required and cannot be null.")); + } else { + updateMobilityServiceRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateMobilityService( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateMobilityServiceWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + if (updateMobilityServiceRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter updateMobilityServiceRequest is required and cannot be null.")); + } else { + updateMobilityServiceRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateMobilityService( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest, + accept, + context); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginUpdateMobilityServiceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + Mono>> mono = + updateMobilityServiceWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + this.client.getContext()); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationProtectedItemInner> + beginUpdateMobilityServiceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateMobilityServiceWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> + beginUpdateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + return beginUpdateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest) + .getSyncPoller(); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protected item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationProtectedItemInner> + beginUpdateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + return beginUpdateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest, + context) + .getSyncPoller(); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateMobilityServiceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + return beginUpdateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateMobilityServiceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + return beginUpdateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner updateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + return updateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest) + .block(); + } + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner updateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + return updateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest, + context) + .block(); + } + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR replication protected items in the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String skipToken, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + skipToken, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR replication protected items in the vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String skipToken, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + skipToken, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR replication protected items in the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, String skipToken, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, skipToken, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ASR replication protected items in the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + final String skipToken = null; + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, skipToken, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR replication protected items in the vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, String skipToken, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, skipToken, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ASR replication protected items in the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + final String skipToken = null; + final String filter = null; + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, skipToken, filter)); + } + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR replication protected items in the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, skipToken, filter, 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 protected item collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersNextSinglePageAsync( + 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 + .listByReplicationProtectionContainersNext( + 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 protected item collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersNextSinglePageAsync( + 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 + .listByReplicationProtectionContainersNext(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 replication protected item 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 protected item 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsImpl.java new file mode 100644 index 000000000000..0be183930e1e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsImpl.java @@ -0,0 +1,1042 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItems; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest; + +public final class ReplicationProtectedItemsImpl implements ReplicationProtectedItems { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationProtectedItemsImpl.class); + + private final ReplicationProtectedItemsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationProtectedItemsImpl( + ReplicationProtectedItemsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, resourceGroupName, fabricName, protectionContainerName); + return Utils.mapPage(inner, inner1 -> new ReplicationProtectedItemImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, resourceGroupName, fabricName, protectionContainerName, context); + return Utils.mapPage(inner, inner1 -> new ReplicationProtectedItemImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicationProtectedItemImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ReplicationProtectedItem get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .get(resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public void purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + this + .serviceClient() + .purge(resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + } + + public void purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + this + .serviceClient() + .purge( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + } + + public ReplicationProtectedItem addDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .addDisks( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem addDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .addDisks( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem applyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .applyRecoveryPoint( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem applyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .applyRecoveryPoint( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem failoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .failoverCancel( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem failoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .failoverCancel( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem failoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .failoverCommit( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem failoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .failoverCommit( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .plannedFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .plannedFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput) { + this + .serviceClient() + .delete( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput); + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context) { + this + .serviceClient() + .delete( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput, + context); + } + + public ReplicationProtectedItem removeDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .removeDisks( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem removeDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .removeDisks( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem repairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .repairReplication( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem repairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .repairReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .reprotect( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .reprotect( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem resolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .resolveHealthErrors( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem resolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .resolveHealthErrors( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem switchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .switchProvider( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem switchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .switchProvider( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem testFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .testFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem testFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .testFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem testFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .testFailoverCleanup( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem testFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .testFailoverCleanup( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .unplannedFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .unplannedFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem updateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .updateAppliance( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem updateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .updateAppliance( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem updateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .updateMobilityService( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectedItem updateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .updateMobilityService( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest, + context); + if (inner != null) { + return new ReplicationProtectedItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ReplicationProtectedItemImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, skipToken, filter, context); + return Utils.mapPage(inner, inner1 -> new ReplicationProtectedItemImpl(inner1, this.manager())); + } + + public ReplicationProtectedItem getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + String replicatedProtectedItemName = Utils.getValueFromIdByName(id, "replicationProtectedItems"); + if (replicatedProtectedItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationProtectedItems'.", + id))); + } + return this + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + String replicatedProtectedItemName = Utils.getValueFromIdByName(id, "replicationProtectedItems"); + if (replicatedProtectedItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationProtectedItems'.", + id))); + } + return this + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + } + + private ReplicationProtectedItemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public ReplicationProtectedItemImpl define(String name) { + return new ReplicationProtectedItemImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java new file mode 100644 index 000000000000..f93d3b3c0fae --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java @@ -0,0 +1,2700 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.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.recoveryservicessiterecovery.fluent.ReplicationProtectionContainerMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput; +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 + * ReplicationProtectionContainerMappingsClient. + */ +public final class ReplicationProtectionContainerMappingsClientImpl + implements ReplicationProtectionContainerMappingsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationProtectionContainerMappingsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationProtectionContainerMappingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationProtectionContainerMappingsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationProtectionContainerMappingsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationProtectionContainerMappings to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationProtectionContainerMappingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectionContainerMappings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainers( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, + @BodyParam("application/json") CreateProtectionContainerMappingInput creationInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, + @BodyParam("application/json") UpdateProtectionContainerMappingInput updateInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("mappingName") String mappingName, + @BodyParam("application/json") RemoveProtectionContainerMappingInput removalInput, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationProtectionContainerMappings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectionContainersNext( + @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 list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByReplicationProtectionContainers( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationProtectionContainers( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, context), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName)); + } + + /** + * Gets the list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, context)); + } + + /** + * Gets a protection container mapping. + * + *

Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping 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 a protection container mapping along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a protection container mapping. + * + *

Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping 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 a protection container mapping along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + accept, + context); + } + + /** + * Gets a protection container mapping. + * + *

Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping 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 a protection container mapping on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a protection container mapping. + * + *

Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping 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 a protection container mapping along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context) + .block(); + } + + /** + * Gets a protection container mapping. + * + *

Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping 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 a protection container mapping. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + return getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, Context.NONE) + .getValue(); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (creationInput == null) { + return Mono.error(new IllegalArgumentException("Parameter creationInput is required and cannot be null.")); + } else { + creationInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + creationInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (creationInput == null) { + return Mono.error(new IllegalArgumentException("Parameter creationInput is required and cannot be null.")); + } else { + creationInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + creationInput, + accept, + context); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerMappingInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput) { + Mono>> mono = + createWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, creationInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerMappingInner.class, + ProtectionContainerMappingInner.class, + this.client.getContext()); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerMappingInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + creationInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerMappingInner.class, + ProtectionContainerMappingInner.class, + context); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, creationInput) + .getSyncPoller(); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput, + Context context) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + creationInput, + context) + .getSyncPoller(); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, creationInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput, + Context context) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + creationInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput) { + return createAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, creationInput) + .block(); + } + + /** + * Create protection container mapping. + * + *

The operation to create a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param creationInput Mapping creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput, + Context context) { + return createAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + creationInput, + context) + .block(); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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>> purgeWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .purge( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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>> purgeWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .purge( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + context); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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> beginPurgeAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + Mono>> mono = + purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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> beginPurgeAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + purgeWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName) + .getSyncPoller(); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context) { + return beginPurgeAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context) + .getSyncPoller(); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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 purgeAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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 purgeAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context) { + return beginPurgeAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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 purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + purgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName).block(); + } + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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 purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context) { + purgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context).block(); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (updateInput == null) { + return Mono.error(new IllegalArgumentException("Parameter updateInput is required and cannot be null.")); + } else { + updateInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + updateInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (updateInput == null) { + return Mono.error(new IllegalArgumentException("Parameter updateInput is required and cannot be null.")); + } else { + updateInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + updateInput, + accept, + context); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerMappingInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput) { + Mono>> mono = + updateWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerMappingInner.class, + ProtectionContainerMappingInner.class, + this.client.getContext()); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerMappingInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + updateInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerMappingInner.class, + ProtectionContainerMappingInner.class, + context); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput) + .getSyncPoller(); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput, + Context context) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput, context) + .getSyncPoller(); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput, + Context context) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput) { + return updateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput) + .block(); + } + + /** + * Update protection container mapping. + * + *

The operation to update protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param updateInput Mapping update input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerMappingInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput, + Context context) { + return updateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput, context) + .block(); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (removalInput == null) { + return Mono.error(new IllegalArgumentException("Parameter removalInput is required and cannot be null.")); + } else { + removalInput.validate(); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + removalInput, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (mappingName == null) { + return Mono.error(new IllegalArgumentException("Parameter mappingName is required and cannot be null.")); + } + if (removalInput == null) { + return Mono.error(new IllegalArgumentException("Parameter removalInput is required and cannot be null.")); + } else { + removalInput.validate(); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + mappingName, + removalInput, + context); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput) { + Mono>> mono = + deleteWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + removalInput, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput) { + return beginDeleteAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput) + .getSyncPoller(); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + removalInput, + context) + .getSyncPoller(); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput) { + return beginDeleteAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + removalInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput) { + deleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput) + .block(); + } + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context) { + deleteAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + removalInput, + context) + .block(); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationProtectionContainersNextSinglePageAsync(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 + .listByReplicationProtectionContainersNext( + 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 protection container mapping collection class along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationProtectionContainersNextSinglePageAsync(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 + .listByReplicationProtectionContainersNext(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 protection container mapping collection class 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 protection container mapping collection class 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsImpl.java new file mode 100644 index 000000000000..0f65fd155c5e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationProtectionContainerMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionContainerMappings; + +public final class ReplicationProtectionContainerMappingsImpl implements ReplicationProtectionContainerMappings { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationProtectionContainerMappingsImpl.class); + + private final ReplicationProtectionContainerMappingsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationProtectionContainerMappingsImpl( + ReplicationProtectionContainerMappingsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, resourceGroupName, fabricName, protectionContainerName); + return Utils.mapPage(inner, inner1 -> new ProtectionContainerMappingImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, resourceGroupName, fabricName, protectionContainerName, context); + return Utils.mapPage(inner, inner1 -> new ProtectionContainerMappingImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectionContainerMappingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProtectionContainerMapping get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + ProtectionContainerMappingInner inner = + this.serviceClient().get(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName); + if (inner != null) { + return new ProtectionContainerMappingImpl(inner, this.manager()); + } else { + return null; + } + } + + public void purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + this.serviceClient().purge(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName); + } + + public void purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context) { + this + .serviceClient() + .purge(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context); + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput) { + this + .serviceClient() + .delete(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput); + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context) { + this + .serviceClient() + .delete( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + removalInput, + context); + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ProtectionContainerMappingImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ProtectionContainerMappingImpl(inner1, this.manager())); + } + + public ProtectionContainerMapping getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + String mappingName = Utils.getValueFromIdByName(id, "replicationProtectionContainerMappings"); + if (mappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainerMappings'.", + id))); + } + return this + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + String mappingName = Utils.getValueFromIdByName(id, "replicationProtectionContainerMappings"); + if (mappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainerMappings'.", + id))); + } + return this + .getWithResponse( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, context); + } + + private ReplicationProtectionContainerMappingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public ProtectionContainerMappingImpl define(String name) { + return new ProtectionContainerMappingImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersClientImpl.java new file mode 100644 index 000000000000..4609a5a92fd1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersClientImpl.java @@ -0,0 +1,2469 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.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.recoveryservicessiterecovery.fluent.ReplicationProtectionContainersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput; +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 ReplicationProtectionContainersClient. */ +public final class ReplicationProtectionContainersClientImpl implements ReplicationProtectionContainersClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationProtectionContainersService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationProtectionContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationProtectionContainersClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationProtectionContainersService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationProtectionContainers to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationProtectionContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabrics( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @BodyParam("application/json") CreateProtectionContainerInput creationInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/discoverProtectableItem") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> discoverProtectableItem( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @BodyParam("application/json") DiscoverProtectableItemRequest discoverProtectableItemRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/remove") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/switchprotection") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> switchProtection( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @BodyParam("application/json") SwitchProtectionInput switchInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationProtectionContainers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabricsNext( + @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 list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName, context), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * Gets the list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName, context)); + } + + /** + * Gets the protection container details. + * + *

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

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

Gets the details of a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 a protection container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the protection container details. + * + *

Gets the details of a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 a protection container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, context) + .block(); + } + + /** + * Gets the protection container details. + * + *

Gets the details of a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 a protection container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerInner get( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return getWithResponse(resourceName, resourceGroupName, fabricName, protectionContainerName, Context.NONE) + .getValue(); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (creationInput == null) { + return Mono.error(new IllegalArgumentException("Parameter creationInput is required and cannot be null.")); + } else { + creationInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + creationInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (creationInput == null) { + return Mono.error(new IllegalArgumentException("Parameter creationInput is required and cannot be null.")); + } else { + creationInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + creationInput, + accept, + context); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput) { + Mono>> mono = + createWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerInner.class, + ProtectionContainerInner.class, + this.client.getContext()); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerInner.class, + ProtectionContainerInner.class, + context); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput) + .getSyncPoller(); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput, + Context context) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput, context) + .getSyncPoller(); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput, + Context context) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput) { + return createAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput).block(); + } + + /** + * Create a protection container. + * + *

Operation to create a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM name. + * @param creationInput Creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput, + Context context) { + return createAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput, context) + .block(); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> discoverProtectableItemWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (discoverProtectableItemRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter discoverProtectableItemRequest is required and cannot be null.")); + } else { + discoverProtectableItemRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .discoverProtectableItem( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + discoverProtectableItemRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> discoverProtectableItemWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (discoverProtectableItemRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter discoverProtectableItemRequest is required and cannot be null.")); + } else { + discoverProtectableItemRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .discoverProtectableItem( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + discoverProtectableItemRequest, + accept, + context); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerInner> + beginDiscoverProtectableItemAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest) { + Mono>> mono = + discoverProtectableItemWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerInner.class, + ProtectionContainerInner.class, + this.client.getContext()); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerInner> + beginDiscoverProtectableItemAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + discoverProtectableItemWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerInner.class, + ProtectionContainerInner.class, + context); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerInner> beginDiscoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest) { + return beginDiscoverProtectableItemAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest) + .getSyncPoller(); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerInner> beginDiscoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context) { + return beginDiscoverProtectableItemAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest, + context) + .getSyncPoller(); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono discoverProtectableItemAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest) { + return beginDiscoverProtectableItemAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono discoverProtectableItemAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context) { + return beginDiscoverProtectableItemAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerInner discoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest) { + return discoverProtectableItemAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest) + .block(); + } + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerInner discoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context) { + return discoverProtectableItemAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest, + context) + .block(); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + context); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName).getSyncPoller(); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, context) + .getSyncPoller(); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + deleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName).block(); + } + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + deleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, context).block(); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> switchProtectionWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (switchInput == null) { + return Mono.error(new IllegalArgumentException("Parameter switchInput is required and cannot be null.")); + } else { + switchInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .switchProtection( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + switchInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> switchProtectionWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (switchInput == null) { + return Mono.error(new IllegalArgumentException("Parameter switchInput is required and cannot be null.")); + } else { + switchInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .switchProtection( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + switchInput, + accept, + context); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerInner> beginSwitchProtectionAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput) { + Mono>> mono = + switchProtectionWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerInner.class, + ProtectionContainerInner.class, + this.client.getContext()); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectionContainerInner> beginSwitchProtectionAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + switchProtectionWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectionContainerInner.class, + ProtectionContainerInner.class, + context); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerInner> beginSwitchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput) { + return beginSwitchProtectionAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput) + .getSyncPoller(); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 protection container details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectionContainerInner> beginSwitchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context) { + return beginSwitchProtectionAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, context) + .getSyncPoller(); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono switchProtectionAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput) { + return beginSwitchProtectionAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono switchProtectionAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context) { + return beginSwitchProtectionAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerInner switchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput) { + return switchProtectionAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput) + .block(); + } + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerInner switchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context) { + return switchProtectionAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, context) + .block(); + } + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Container collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Container collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Container collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Container collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Container collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Container collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 protection Container collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync(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.listByReplicationFabricsNext(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 protection Container collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync( + 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 + .listByReplicationFabricsNext(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 protection Container 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 protection Container 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersImpl.java new file mode 100644 index 000000000000..889267c3fda4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersImpl.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationProtectionContainersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainer; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionContainers; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput; + +public final class ReplicationProtectionContainersImpl implements ReplicationProtectionContainers { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationProtectionContainersImpl.class); + + private final ReplicationProtectionContainersClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationProtectionContainersImpl( + ReplicationProtectionContainersClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName); + return Utils.mapPage(inner, inner1 -> new ProtectionContainerImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName, context); + return Utils.mapPage(inner, inner1 -> new ProtectionContainerImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceName, resourceGroupName, fabricName, protectionContainerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectionContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProtectionContainer get( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + ProtectionContainerInner inner = + this.serviceClient().get(resourceName, resourceGroupName, fabricName, protectionContainerName); + if (inner != null) { + return new ProtectionContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProtectionContainer discoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest) { + ProtectionContainerInner inner = + this + .serviceClient() + .discoverProtectableItem( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest); + if (inner != null) { + return new ProtectionContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProtectionContainer discoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context) { + ProtectionContainerInner inner = + this + .serviceClient() + .discoverProtectableItem( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest, + context); + if (inner != null) { + return new ProtectionContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + this.serviceClient().delete(resourceName, resourceGroupName, fabricName, protectionContainerName); + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + this.serviceClient().delete(resourceName, resourceGroupName, fabricName, protectionContainerName, context); + } + + public ProtectionContainer switchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput) { + ProtectionContainerInner inner = + this + .serviceClient() + .switchProtection(resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput); + if (inner != null) { + return new ProtectionContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProtectionContainer switchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context) { + ProtectionContainerInner inner = + this + .serviceClient() + .switchProtection( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, context); + if (inner != null) { + return new ProtectionContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ProtectionContainerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ProtectionContainerImpl(inner1, this.manager())); + } + + public ProtectionContainer getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + return this + .getWithResponse(resourceName, resourceGroupName, fabricName, protectionContainerName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 protectionContainerName = Utils.getValueFromIdByName(id, "replicationProtectionContainers"); + if (protectionContainerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionContainers'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, fabricName, protectionContainerName, context); + } + + private ReplicationProtectionContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public ProtectionContainerImpl define(String name) { + return new ProtectionContainerImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentImpl.java new file mode 100644 index 000000000000..8be7ce13bb41 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntent; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentProperties; + +public final class ReplicationProtectionIntentImpl + implements ReplicationProtectionIntent, ReplicationProtectionIntent.Definition { + private ReplicationProtectionIntentInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + ReplicationProtectionIntentImpl( + ReplicationProtectionIntentInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 ReplicationProtectionIntentProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ReplicationProtectionIntentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String intentObjectName; + + private CreateProtectionIntentInput createInput; + + public ReplicationProtectionIntentImpl withExistingVault(String resourceName, String resourceGroupName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public ReplicationProtectionIntent create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionIntents() + .createWithResponse(resourceName, resourceGroupName, intentObjectName, createInput, Context.NONE) + .getValue(); + return this; + } + + public ReplicationProtectionIntent create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionIntents() + .createWithResponse(resourceName, resourceGroupName, intentObjectName, createInput, context) + .getValue(); + return this; + } + + ReplicationProtectionIntentImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new ReplicationProtectionIntentInner(); + this.serviceManager = serviceManager; + this.intentObjectName = name; + this.createInput = new CreateProtectionIntentInput(); + } + + public ReplicationProtectionIntent refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionIntents() + .getWithResponse(resourceName, resourceGroupName, intentObjectName, Context.NONE) + .getValue(); + return this; + } + + public ReplicationProtectionIntent refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationProtectionIntents() + .getWithResponse(resourceName, resourceGroupName, intentObjectName, context) + .getValue(); + return this; + } + + public ReplicationProtectionIntentImpl withProperties(CreateProtectionIntentProperties properties) { + this.createInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsClientImpl.java new file mode 100644 index 000000000000..5e4b4b57b9eb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsClientImpl.java @@ -0,0 +1,802 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationProtectionIntentsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationProtectionIntentsClient. */ +public final class ReplicationProtectionIntentsClientImpl implements ReplicationProtectionIntentsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationProtectionIntentsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationProtectionIntentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationProtectionIntentsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationProtectionIntentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationProtectionIntents to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationProtectionIntentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationProtectionIntents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("skipToken") String skipToken, + @QueryParam("takeToken") String takeToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("intentObjectName") String intentObjectName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("intentObjectName") String intentObjectName, + @BodyParam("application/json") CreateProtectionIntentInput input, + @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 list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ASR replication protection intent objects in the vault along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String skipToken, String takeToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + skipToken, + takeToken, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ASR replication protection intent objects in the vault along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, String skipToken, String takeToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + skipToken, + takeToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ASR replication protection intent objects in the vault as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, String skipToken, String takeToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, skipToken, takeToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ASR replication protection intent objects in the vault as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + final String skipToken = null; + final String takeToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, skipToken, takeToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ASR replication protection intent objects in the vault as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, String skipToken, String takeToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, skipToken, takeToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ASR replication protection intent objects in the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + final String skipToken = null; + final String takeToken = null; + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, skipToken, takeToken)); + } + + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ASR replication protection intent objects in the vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, String takeToken, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, skipToken, takeToken, context)); + } + + /** + * Gets the details of a Replication protection intent item. + * + *

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

Gets the details of an ASR replication protection intent. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName Replication protection intent 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 an ASR replication protection intent along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String intentObjectName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (intentObjectName == null) { + return Mono + .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + intentObjectName, + accept, + context); + } + + /** + * Gets the details of a Replication protection intent item. + * + *

Gets the details of an ASR replication protection intent. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName Replication protection intent 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 an ASR replication protection intent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, String resourceGroupName, String intentObjectName) { + return getWithResponseAsync(resourceName, resourceGroupName, intentObjectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a Replication protection intent item. + * + *

Gets the details of an ASR replication protection intent. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName Replication protection intent 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 an ASR replication protection intent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String intentObjectName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, intentObjectName, context).block(); + } + + /** + * Gets the details of a Replication protection intent item. + * + *

Gets the details of an ASR replication protection intent. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName Replication protection intent 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 an ASR replication protection intent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectionIntentInner get( + String resourceName, String resourceGroupName, String intentObjectName) { + return getWithResponse(resourceName, resourceGroupName, intentObjectName, Context.NONE).getValue(); + } + + /** + * Create protection intent Resource. + * + *

The operation to create an ASR replication protection intent item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName A name for the replication protection item. + * @param input Create Protection Intent Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protection intent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceName, String resourceGroupName, String intentObjectName, CreateProtectionIntentInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (intentObjectName == null) { + return Mono + .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + intentObjectName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create protection intent Resource. + * + *

The operation to create an ASR replication protection intent item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName A name for the replication protection item. + * @param input Create Protection Intent Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protection intent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String intentObjectName, + CreateProtectionIntentInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (intentObjectName == null) { + return Mono + .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + intentObjectName, + input, + accept, + context); + } + + /** + * Create protection intent Resource. + * + *

The operation to create an ASR replication protection intent item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName A name for the replication protection item. + * @param input Create Protection Intent Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protection intent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, String resourceGroupName, String intentObjectName, CreateProtectionIntentInput input) { + return createWithResponseAsync(resourceName, resourceGroupName, intentObjectName, input) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create protection intent Resource. + * + *

The operation to create an ASR replication protection intent item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName A name for the replication protection item. + * @param input Create Protection Intent Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protection intent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceName, + String resourceGroupName, + String intentObjectName, + CreateProtectionIntentInput input, + Context context) { + return createWithResponseAsync(resourceName, resourceGroupName, intentObjectName, input, context).block(); + } + + /** + * Create protection intent Resource. + * + *

The operation to create an ASR replication protection intent item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName A name for the replication protection item. + * @param input Create Protection Intent Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 protection intent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectionIntentInner create( + String resourceName, String resourceGroupName, String intentObjectName, CreateProtectionIntentInput input) { + return createWithResponse(resourceName, resourceGroupName, intentObjectName, input, Context.NONE).getValue(); + } + + /** + * 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 protection intent objects 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 protection intent objects 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsImpl.java new file mode 100644 index 000000000000..a5493362490f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationProtectionIntentsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntent; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntents; + +public final class ReplicationProtectionIntentsImpl implements ReplicationProtectionIntents { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationProtectionIntentsImpl.class); + + private final ReplicationProtectionIntentsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationProtectionIntentsImpl( + ReplicationProtectionIntentsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ReplicationProtectionIntentImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, String takeToken, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, skipToken, takeToken, context); + return Utils.mapPage(inner, inner1 -> new ReplicationProtectionIntentImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String intentObjectName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, intentObjectName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicationProtectionIntentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ReplicationProtectionIntent get(String resourceName, String resourceGroupName, String intentObjectName) { + ReplicationProtectionIntentInner inner = + this.serviceClient().get(resourceName, resourceGroupName, intentObjectName); + if (inner != null) { + return new ReplicationProtectionIntentImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplicationProtectionIntent getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 intentObjectName = Utils.getValueFromIdByName(id, "replicationProtectionIntents"); + if (intentObjectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionIntents'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, intentObjectName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 intentObjectName = Utils.getValueFromIdByName(id, "replicationProtectionIntents"); + if (intentObjectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationProtectionIntents'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, intentObjectName, context); + } + + private ReplicationProtectionIntentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public ReplicationProtectionIntentImpl define(String name) { + return new ReplicationProtectionIntentImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansClientImpl.java new file mode 100644 index 000000000000..19b6e04356a5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansClientImpl.java @@ -0,0 +1,3848 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.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.recoveryservicessiterecovery.fluent.ReplicationRecoveryPlansClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInput; +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 ReplicationRecoveryPlansClient. */ +public final class ReplicationRecoveryPlansClientImpl implements ReplicationRecoveryPlansClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationRecoveryPlansService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationRecoveryPlansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationRecoveryPlansClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create(ReplicationRecoveryPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationRecoveryPlans to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationRecoveryPlansService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @BodyParam("application/json") CreateRecoveryPlanInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @BodyParam("application/json") UpdateRecoveryPlanInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failoverCancel( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failoverCommit( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> plannedFailover( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @BodyParam("application/json") RecoveryPlanPlannedFailoverInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reprotect( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> testFailover( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @BodyParam("application/json") RecoveryPlanTestFailoverInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> testFailoverCleanup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @BodyParam("application/json") RecoveryPlanTestFailoverCleanupInput input, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> unplannedFailover( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("recoveryPlanName") String recoveryPlanName, + @BodyParam("application/json") RecoveryPlanUnplannedFailoverInput input, + @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 list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan collection details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan collection details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan collection details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan collection details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan collection details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan collection details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, context)); + } + + /** + * Gets the requested recovery plan. + * + *

Gets the details of the recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Name of the recovery plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 plan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the requested recovery plan. + * + *

Gets the details of the recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Name of the recovery plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 plan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + accept, + context); + } + + /** + * Gets the requested recovery plan. + * + *

Gets the details of the recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Name of the recovery plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName, String recoveryPlanName) { + return getWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the requested recovery plan. + * + *

Gets the details of the recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Name of the recovery plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, context).block(); + } + + /** + * Gets the requested recovery plan. + * + *

Gets the details of the recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Name of the recovery plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner get(String resourceName, String resourceGroupName, String recoveryPlanName) { + return getWithResponse(resourceName, resourceGroupName, recoveryPlanName, Context.NONE).getValue(); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + CreateRecoveryPlanInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginCreateAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input) { + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryPlanInner.class, + RecoveryPlanInner.class, + this.client.getContext()); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + CreateRecoveryPlanInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RecoveryPlanInner.class, RecoveryPlanInner.class, context); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginCreate( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input) { + return beginCreateAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginCreate( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + CreateRecoveryPlanInput input, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, recoveryPlanName, input, context).getSyncPoller(); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input) { + return beginCreateAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + CreateRecoveryPlanInput input, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner create( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input) { + return createAsync(resourceName, resourceGroupName, recoveryPlanName, input).block(); + } + + /** + * Creates a recovery plan with the given details. + * + *

The operation to create a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery Plan creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner create( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + CreateRecoveryPlanInput input, + Context context) { + return createAsync(resourceName, resourceGroupName, recoveryPlanName, input, context).block(); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + context); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName) { + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName) { + return beginDeleteAsync(resourceName, resourceGroupName, recoveryPlanName).getSyncPoller(); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, recoveryPlanName, context).getSyncPoller(); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName) { + return beginDeleteAsync(resourceName, resourceGroupName, recoveryPlanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, recoveryPlanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName) { + deleteAsync(resourceName, resourceGroupName, recoveryPlanName).block(); + } + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + deleteAsync(resourceName, resourceGroupName, recoveryPlanName, context).block(); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + UpdateRecoveryPlanInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginUpdateAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input) { + Mono>> mono = + updateWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryPlanInner.class, + RecoveryPlanInner.class, + this.client.getContext()); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + UpdateRecoveryPlanInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RecoveryPlanInner.class, RecoveryPlanInner.class, context); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginUpdate( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginUpdate( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + UpdateRecoveryPlanInput input, + Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, recoveryPlanName, input, context).getSyncPoller(); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + UpdateRecoveryPlanInput input, + Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner update( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input) { + return updateAsync(resourceName, resourceGroupName, recoveryPlanName, input).block(); + } + + /** + * Updates the given recovery plan. + * + *

The operation to update a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Update recovery plan input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner update( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + UpdateRecoveryPlanInput input, + Context context) { + return updateAsync(resourceName, resourceGroupName, recoveryPlanName, input, context).block(); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverCancelWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .failoverCancel( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverCancelWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .failoverCancel( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + accept, + context); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginFailoverCancelAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + Mono>> mono = + failoverCancelWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryPlanInner.class, + RecoveryPlanInner.class, + this.client.getContext()); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginFailoverCancelAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + failoverCancelWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RecoveryPlanInner.class, RecoveryPlanInner.class, context); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginFailoverCancel( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginFailoverCancelAsync(resourceName, resourceGroupName, recoveryPlanName).getSyncPoller(); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginFailoverCancel( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginFailoverCancelAsync(resourceName, resourceGroupName, recoveryPlanName, context).getSyncPoller(); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverCancelAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginFailoverCancelAsync(resourceName, resourceGroupName, recoveryPlanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverCancelAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginFailoverCancelAsync(resourceName, resourceGroupName, recoveryPlanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner failoverCancel(String resourceName, String resourceGroupName, String recoveryPlanName) { + return failoverCancelAsync(resourceName, resourceGroupName, recoveryPlanName).block(); + } + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner failoverCancel( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return failoverCancelAsync(resourceName, resourceGroupName, recoveryPlanName, context).block(); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverCommitWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .failoverCommit( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverCommitWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .failoverCommit( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + accept, + context); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginFailoverCommitAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + Mono>> mono = + failoverCommitWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryPlanInner.class, + RecoveryPlanInner.class, + this.client.getContext()); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginFailoverCommitAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + failoverCommitWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RecoveryPlanInner.class, RecoveryPlanInner.class, context); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginFailoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginFailoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName).getSyncPoller(); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginFailoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginFailoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName, context).getSyncPoller(); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverCommitAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginFailoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverCommitAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginFailoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner failoverCommit(String resourceName, String resourceGroupName, String recoveryPlanName) { + return failoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName).block(); + } + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner failoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return failoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName, context).block(); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> plannedFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .plannedFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> plannedFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .plannedFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginPlannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input) { + Mono>> mono = + plannedFailoverWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryPlanInner.class, + RecoveryPlanInner.class, + this.client.getContext()); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginPlannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + plannedFailoverWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RecoveryPlanInner.class, RecoveryPlanInner.class, context); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input) { + return beginPlannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context) { + return beginPlannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .getSyncPoller(); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono plannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input) { + return beginPlannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono plannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context) { + return beginPlannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner plannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input) { + return plannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).block(); + } + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner plannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context) { + return plannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context).block(); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reprotectWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reprotect( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reprotectWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reprotect( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + accept, + context); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginReprotectAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + Mono>> mono = + reprotectWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryPlanInner.class, + RecoveryPlanInner.class, + this.client.getContext()); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginReprotectAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reprotectWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RecoveryPlanInner.class, RecoveryPlanInner.class, context); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginReprotect( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginReprotectAsync(resourceName, resourceGroupName, recoveryPlanName).getSyncPoller(); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginReprotect( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginReprotectAsync(resourceName, resourceGroupName, recoveryPlanName, context).getSyncPoller(); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reprotectAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginReprotectAsync(resourceName, resourceGroupName, recoveryPlanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reprotectAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginReprotectAsync(resourceName, resourceGroupName, recoveryPlanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner reprotect(String resourceName, String resourceGroupName, String recoveryPlanName) { + return reprotectAsync(resourceName, resourceGroupName, recoveryPlanName).block(); + } + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner reprotect( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return reprotectAsync(resourceName, resourceGroupName, recoveryPlanName, context).block(); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverWithResponseAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .testFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .testFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginTestFailoverAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input) { + Mono>> mono = + testFailoverWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryPlanInner.class, + RecoveryPlanInner.class, + this.client.getContext()); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginTestFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + testFailoverWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RecoveryPlanInner.class, RecoveryPlanInner.class, context); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginTestFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input) { + return beginTestFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context) { + return beginTestFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .getSyncPoller(); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input) { + return beginTestFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context) { + return beginTestFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner testFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input) { + return testFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).block(); + } + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner testFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context) { + return testFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context).block(); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverCleanupWithResponseAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .testFailoverCleanup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testFailoverCleanupWithResponseAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .testFailoverCleanup( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginTestFailoverCleanupAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input) { + Mono>> mono = + testFailoverCleanupWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryPlanInner.class, + RecoveryPlanInner.class, + this.client.getContext()); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginTestFailoverCleanupAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + testFailoverCleanupWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RecoveryPlanInner.class, RecoveryPlanInner.class, context); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input) { + return beginTestFailoverCleanupAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context) { + return beginTestFailoverCleanupAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .getSyncPoller(); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverCleanupAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input) { + return beginTestFailoverCleanupAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testFailoverCleanupAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context) { + return beginTestFailoverCleanupAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner testFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input) { + return testFailoverCleanupAsync(resourceName, resourceGroupName, recoveryPlanName, input).block(); + } + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner testFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context) { + return testFailoverCleanupAsync(resourceName, resourceGroupName, recoveryPlanName, input, context).block(); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> unplannedFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .unplannedFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> unplannedFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (recoveryPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPlanName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .unplannedFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + recoveryPlanName, + input, + accept, + context); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginUnplannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input) { + Mono>> mono = + unplannedFailoverWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryPlanInner.class, + RecoveryPlanInner.class, + this.client.getContext()); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryPlanInner> beginUnplannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + unplannedFailoverWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RecoveryPlanInner.class, RecoveryPlanInner.class, context); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input) { + return beginUnplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 recovery plan details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryPlanInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context) { + return beginUnplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .getSyncPoller(); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono unplannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input) { + return beginUnplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono unplannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context) { + return beginUnplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input) { + return unplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).block(); + } + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 plan details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPlanInner unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context) { + return unplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, 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 recovery plan collection details 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 plan collection details 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansImpl.java new file mode 100644 index 000000000000..2b33b03b7075 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansImpl.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationRecoveryPlansClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlan; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationRecoveryPlans; + +public final class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationRecoveryPlansImpl.class); + + private final ReplicationRecoveryPlansClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationRecoveryPlansImpl( + ReplicationRecoveryPlansClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RecoveryPlanImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RecoveryPlanImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, recoveryPlanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecoveryPlanImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RecoveryPlan get(String resourceName, String resourceGroupName, String recoveryPlanName) { + RecoveryPlanInner inner = this.serviceClient().get(resourceName, resourceGroupName, recoveryPlanName); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceName, String resourceGroupName, String recoveryPlanName) { + this.serviceClient().delete(resourceName, resourceGroupName, recoveryPlanName); + } + + public void delete(String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + this.serviceClient().delete(resourceName, resourceGroupName, recoveryPlanName, context); + } + + public RecoveryPlan failoverCancel(String resourceName, String resourceGroupName, String recoveryPlanName) { + RecoveryPlanInner inner = + this.serviceClient().failoverCancel(resourceName, resourceGroupName, recoveryPlanName); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan failoverCancel( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + RecoveryPlanInner inner = + this.serviceClient().failoverCancel(resourceName, resourceGroupName, recoveryPlanName, context); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan failoverCommit(String resourceName, String resourceGroupName, String recoveryPlanName) { + RecoveryPlanInner inner = + this.serviceClient().failoverCommit(resourceName, resourceGroupName, recoveryPlanName); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan failoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + RecoveryPlanInner inner = + this.serviceClient().failoverCommit(resourceName, resourceGroupName, recoveryPlanName, context); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan plannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input) { + RecoveryPlanInner inner = + this.serviceClient().plannedFailover(resourceName, resourceGroupName, recoveryPlanName, input); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan plannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context) { + RecoveryPlanInner inner = + this.serviceClient().plannedFailover(resourceName, resourceGroupName, recoveryPlanName, input, context); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan reprotect(String resourceName, String resourceGroupName, String recoveryPlanName) { + RecoveryPlanInner inner = this.serviceClient().reprotect(resourceName, resourceGroupName, recoveryPlanName); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan reprotect( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + RecoveryPlanInner inner = + this.serviceClient().reprotect(resourceName, resourceGroupName, recoveryPlanName, context); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan testFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input) { + RecoveryPlanInner inner = + this.serviceClient().testFailover(resourceName, resourceGroupName, recoveryPlanName, input); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan testFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context) { + RecoveryPlanInner inner = + this.serviceClient().testFailover(resourceName, resourceGroupName, recoveryPlanName, input, context); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan testFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input) { + RecoveryPlanInner inner = + this.serviceClient().testFailoverCleanup(resourceName, resourceGroupName, recoveryPlanName, input); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan testFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context) { + RecoveryPlanInner inner = + this.serviceClient().testFailoverCleanup(resourceName, resourceGroupName, recoveryPlanName, input, context); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input) { + RecoveryPlanInner inner = + this.serviceClient().unplannedFailover(resourceName, resourceGroupName, recoveryPlanName, input); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context) { + RecoveryPlanInner inner = + this.serviceClient().unplannedFailover(resourceName, resourceGroupName, recoveryPlanName, input, context); + if (inner != null) { + return new RecoveryPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryPlan getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 recoveryPlanName = Utils.getValueFromIdByName(id, "replicationRecoveryPlans"); + if (recoveryPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationRecoveryPlans'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, recoveryPlanName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 recoveryPlanName = Utils.getValueFromIdByName(id, "replicationRecoveryPlans"); + if (recoveryPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationRecoveryPlans'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, recoveryPlanName, context); + } + + public void deleteById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 recoveryPlanName = Utils.getValueFromIdByName(id, "replicationRecoveryPlans"); + if (recoveryPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationRecoveryPlans'.", + id))); + } + this.delete(resourceName, resourceGroupName, recoveryPlanName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 recoveryPlanName = Utils.getValueFromIdByName(id, "replicationRecoveryPlans"); + if (recoveryPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationRecoveryPlans'.", + id))); + } + this.delete(resourceName, resourceGroupName, recoveryPlanName, context); + } + + private ReplicationRecoveryPlansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public RecoveryPlanImpl define(String name) { + return new RecoveryPlanImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java new file mode 100644 index 000000000000..6d8ef9b797be --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java @@ -0,0 +1,2232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationRecoveryServicesProvidersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection; +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 + * ReplicationRecoveryServicesProvidersClient. + */ +public final class ReplicationRecoveryServicesProvidersClientImpl + implements ReplicationRecoveryServicesProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationRecoveryServicesProvidersService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationRecoveryServicesProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationRecoveryServicesProvidersClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationRecoveryServicesProvidersService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationRecoveryServicesProviders to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationRecoveryServicesProvidersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabrics( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders" + + "/{providerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders" + + "/{providerName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, + @BodyParam("application/json") AddRecoveryServicesProviderInput addProviderInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders" + + "/{providerName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders" + + "/{providerName}/refreshProvider") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refreshProvider( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders" + + "/{providerName}/remove") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("providerName") String providerName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationRecoveryServicesProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabricsNext( + @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 list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName, context), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * Gets the list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName, context)); + } + + /** + * Gets the details of a recovery services provider. + * + *

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

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

Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 registered recovery services provider on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a recovery services provider. + * + *

Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 registered recovery services provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); + } + + /** + * Gets the details of a recovery services provider. + * + *

Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 registered recovery services provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner get( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return getWithResponse(resourceName, resourceGroupName, fabricName, providerName, Context.NONE).getValue(); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (addProviderInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter addProviderInput is required and cannot be null.")); + } else { + addProviderInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + providerName, + addProviderInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (addProviderInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter addProviderInput is required and cannot be null.")); + } else { + addProviderInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + providerName, + addProviderInput, + accept, + context); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryServicesProviderInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput) { + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryServicesProviderInner.class, + RecoveryServicesProviderInner.class, + this.client.getContext()); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryServicesProviderInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryServicesProviderInner.class, + RecoveryServicesProviderInner.class, + context); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput) + .getSyncPoller(); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) + .getSyncPoller(); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput) { + return createAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput).block(); + } + + /** + * Adds a recovery services provider. + * + *

The operation to add a recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider name. + * @param addProviderInput Add provider input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput, + Context context) { + return createAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) + .block(); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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>> purgeWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .purge( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + providerName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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>> purgeWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .purge( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + providerName, + context); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurgeAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + Mono>> mono = + purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurgeAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + purgeWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurge( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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> beginPurge( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName, context).getSyncPoller(); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purgeAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purgeAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purge(String resourceName, String resourceGroupName, String fabricName, String providerName) { + purgeAsync(resourceName, resourceGroupName, fabricName, providerName).block(); + } + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purge( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + purgeAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshProviderWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .refreshProvider( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + providerName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshProviderWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .refreshProvider( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + providerName, + accept, + context); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryServicesProviderInner> + beginRefreshProviderAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + Mono>> mono = + refreshProviderWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryServicesProviderInner.class, + RecoveryServicesProviderInner.class, + this.client.getContext()); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RecoveryServicesProviderInner> + beginRefreshProviderAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + refreshProviderWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RecoveryServicesProviderInner.class, + RecoveryServicesProviderInner.class, + context); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context) + .getSyncPoller(); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshProviderAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshProviderAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner refreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return refreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName).block(); + } + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryServicesProviderInner refreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return refreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + providerName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + providerName, + context); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName) { + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName, context).getSyncPoller(); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName) { + deleteAsync(resourceName, resourceGroupName, fabricName, providerName).block(); + } + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + deleteAsync(resourceName, resourceGroupName, fabricName, providerName, context).block(); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync( + 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.listByReplicationFabricsNext(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 collection of providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync( + 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 + .listByReplicationFabricsNext(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 collection of providers 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 collection of providers 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersImpl.java new file mode 100644 index 000000000000..9f2297f02f7b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationRecoveryServicesProvidersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProvider; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationRecoveryServicesProviders; + +public final class ReplicationRecoveryServicesProvidersImpl implements ReplicationRecoveryServicesProviders { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationRecoveryServicesProvidersImpl.class); + + private final ReplicationRecoveryServicesProvidersClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationRecoveryServicesProvidersImpl( + ReplicationRecoveryServicesProvidersClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName); + return Utils.mapPage(inner, inner1 -> new RecoveryServicesProviderImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName, context); + return Utils.mapPage(inner, inner1 -> new RecoveryServicesProviderImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, fabricName, providerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecoveryServicesProviderImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RecoveryServicesProvider get( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + RecoveryServicesProviderInner inner = + this.serviceClient().get(resourceName, resourceGroupName, fabricName, providerName); + if (inner != null) { + return new RecoveryServicesProviderImpl(inner, this.manager()); + } else { + return null; + } + } + + public void purge(String resourceName, String resourceGroupName, String fabricName, String providerName) { + this.serviceClient().purge(resourceName, resourceGroupName, fabricName, providerName); + } + + public void purge( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + this.serviceClient().purge(resourceName, resourceGroupName, fabricName, providerName, context); + } + + public RecoveryServicesProvider refreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + RecoveryServicesProviderInner inner = + this.serviceClient().refreshProvider(resourceName, resourceGroupName, fabricName, providerName); + if (inner != null) { + return new RecoveryServicesProviderImpl(inner, this.manager()); + } else { + return null; + } + } + + public RecoveryServicesProvider refreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + RecoveryServicesProviderInner inner = + this.serviceClient().refreshProvider(resourceName, resourceGroupName, fabricName, providerName, context); + if (inner != null) { + return new RecoveryServicesProviderImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceName, String resourceGroupName, String fabricName, String providerName) { + this.serviceClient().delete(resourceName, resourceGroupName, fabricName, providerName); + } + + public void delete( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + this.serviceClient().delete(resourceName, resourceGroupName, fabricName, providerName, context); + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RecoveryServicesProviderImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RecoveryServicesProviderImpl(inner1, this.manager())); + } + + public RecoveryServicesProvider getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 providerName = Utils.getValueFromIdByName(id, "replicationRecoveryServicesProviders"); + if (providerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationRecoveryServicesProviders'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, fabricName, providerName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 providerName = Utils.getValueFromIdByName(id, "replicationRecoveryServicesProviders"); + if (providerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationRecoveryServicesProviders'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, fabricName, providerName, context); + } + + private ReplicationRecoveryServicesProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public RecoveryServicesProviderImpl define(String name) { + return new RecoveryServicesProviderImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsClientImpl.java new file mode 100644 index 000000000000..a2a62f031742 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsClientImpl.java @@ -0,0 +1,1922 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationStorageClassificationMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingInput; +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 + * ReplicationStorageClassificationMappingsClient. + */ +public final class ReplicationStorageClassificationMappingsClientImpl + implements ReplicationStorageClassificationMappingsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationStorageClassificationMappingsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationStorageClassificationMappingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationStorageClassificationMappingsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationStorageClassificationMappingsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationStorageClassificationMappings + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationStorageClassificationMappingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications" + + "/{storageClassificationName}/replicationStorageClassificationMappings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationStorageClassifications( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("storageClassificationName") String storageClassificationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications" + + "/{storageClassificationName}/replicationStorageClassificationMappings" + + "/{storageClassificationMappingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("storageClassificationName") String storageClassificationName, + @PathParam("storageClassificationMappingName") String storageClassificationMappingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications" + + "/{storageClassificationName}/replicationStorageClassificationMappings" + + "/{storageClassificationMappingName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("storageClassificationName") String storageClassificationName, + @PathParam("storageClassificationMappingName") String storageClassificationMappingName, + @BodyParam("application/json") StorageClassificationMappingInput pairingInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications" + + "/{storageClassificationName}/replicationStorageClassificationMappings" + + "/{storageClassificationMappingName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("storageClassificationName") String storageClassificationName, + @PathParam("storageClassificationMappingName") String storageClassificationMappingName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationStorageClassificationMappings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationStorageClassificationsNext( + @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 list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationStorageClassificationsSinglePageAsync( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (storageClassificationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByReplicationStorageClassifications( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + storageClassificationName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationStorageClassificationsSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (storageClassificationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationStorageClassifications( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + storageClassificationName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationStorageClassificationsAsync( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + return new PagedFlux<>( + () -> + listByReplicationStorageClassificationsSinglePageAsync( + resourceName, resourceGroupName, fabricName, storageClassificationName), + nextLink -> listByReplicationStorageClassificationsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationStorageClassificationsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context) { + return new PagedFlux<>( + () -> + listByReplicationStorageClassificationsSinglePageAsync( + resourceName, resourceGroupName, fabricName, storageClassificationName, context), + nextLink -> listByReplicationStorageClassificationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationStorageClassifications( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + return new PagedIterable<>( + listByReplicationStorageClassificationsAsync( + resourceName, resourceGroupName, fabricName, storageClassificationName)); + } + + /** + * Gets the list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationStorageClassifications( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context) { + return new PagedIterable<>( + listByReplicationStorageClassificationsAsync( + resourceName, resourceGroupName, fabricName, storageClassificationName, context)); + } + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 specified storage classification mapping along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (storageClassificationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationName is required and cannot be null.")); + } + if (storageClassificationMappingName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationMappingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + storageClassificationName, + storageClassificationMappingName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 specified storage classification mapping along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (storageClassificationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationName is required and cannot be null.")); + } + if (storageClassificationMappingName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationMappingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + storageClassificationName, + storageClassificationMappingName, + accept, + context); + } + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 specified storage classification mapping on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + return getWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 specified storage classification mapping along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context) { + return getWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context) + .block(); + } + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 specified storage classification mapping. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageClassificationMappingInner get( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + return getWithResponse( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + Context.NONE) + .getValue(); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (storageClassificationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationName is required and cannot be null.")); + } + if (storageClassificationMappingName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationMappingName is required and cannot be null.")); + } + if (pairingInput == null) { + return Mono.error(new IllegalArgumentException("Parameter pairingInput is required and cannot be null.")); + } else { + pairingInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage mapping object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (storageClassificationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationName is required and cannot be null.")); + } + if (storageClassificationMappingName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationMappingName is required and cannot be null.")); + } + if (pairingInput == null) { + return Mono.error(new IllegalArgumentException("Parameter pairingInput is required and cannot be null.")); + } else { + pairingInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput, + accept, + context); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageClassificationMappingInner> + beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput) { + Mono>> mono = + createWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageClassificationMappingInner.class, + StorageClassificationMappingInner.class, + this.client.getContext()); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageClassificationMappingInner> + beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageClassificationMappingInner.class, + StorageClassificationMappingInner.class, + context); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageClassificationMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput) + .getSyncPoller(); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage mapping object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageClassificationMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput, + Context context) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput, + context) + .getSyncPoller(); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage mapping object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput, + Context context) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageClassificationMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput) { + return createAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput) + .block(); + } + + /** + * Create storage classification mapping. + * + *

The operation to create a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping name. + * @param pairingInput Pairing input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage mapping object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageClassificationMappingInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput, + Context context) { + return createAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput, + context) + .block(); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (storageClassificationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationName is required and cannot be null.")); + } + if (storageClassificationMappingName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationMappingName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + storageClassificationName, + storageClassificationMappingName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (storageClassificationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationName is required and cannot be null.")); + } + if (storageClassificationMappingName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationMappingName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + storageClassificationName, + storageClassificationMappingName, + context); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + Mono>> mono = + deleteWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName) + .getSyncPoller(); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context) + .getSyncPoller(); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + deleteAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName) + .block(); + } + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context) { + deleteAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context) + .block(); + } + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage mapping details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage mapping details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage mapping details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage mapping details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 collection of storage mapping details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationStorageClassificationsNextSinglePageAsync(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 + .listByReplicationStorageClassificationsNext( + 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 collection of storage mapping details along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByReplicationStorageClassificationsNextSinglePageAsync(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 + .listByReplicationStorageClassificationsNext(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 collection of storage mapping details 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 collection of storage mapping details 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsImpl.java new file mode 100644 index 000000000000..3542b2b4d68c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsImpl.java @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationStorageClassificationMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationStorageClassificationMappings; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMapping; + +public final class ReplicationStorageClassificationMappingsImpl implements ReplicationStorageClassificationMappings { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationStorageClassificationMappingsImpl.class); + + private final ReplicationStorageClassificationMappingsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationStorageClassificationMappingsImpl( + ReplicationStorageClassificationMappingsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationStorageClassifications( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationStorageClassifications( + resourceName, resourceGroupName, fabricName, storageClassificationName); + return Utils.mapPage(inner, inner1 -> new StorageClassificationMappingImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationStorageClassifications( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationStorageClassifications( + resourceName, resourceGroupName, fabricName, storageClassificationName, context); + return Utils.mapPage(inner, inner1 -> new StorageClassificationMappingImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageClassificationMappingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageClassificationMapping get( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + StorageClassificationMappingInner inner = + this + .serviceClient() + .get( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName); + if (inner != null) { + return new StorageClassificationMappingImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + this + .serviceClient() + .delete( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName); + } + + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context) { + this + .serviceClient() + .delete( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context); + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new StorageClassificationMappingImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new StorageClassificationMappingImpl(inner1, this.manager())); + } + + public StorageClassificationMapping getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 storageClassificationName = Utils.getValueFromIdByName(id, "replicationStorageClassifications"); + if (storageClassificationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationStorageClassifications'.", + id))); + } + String storageClassificationMappingName = + Utils.getValueFromIdByName(id, "replicationStorageClassificationMappings"); + if (storageClassificationMappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationStorageClassificationMappings'.", + id))); + } + return this + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 storageClassificationName = Utils.getValueFromIdByName(id, "replicationStorageClassifications"); + if (storageClassificationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationStorageClassifications'.", + id))); + } + String storageClassificationMappingName = + Utils.getValueFromIdByName(id, "replicationStorageClassificationMappings"); + if (storageClassificationMappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationStorageClassificationMappings'.", + id))); + } + return this + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context); + } + + public void deleteById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 storageClassificationName = Utils.getValueFromIdByName(id, "replicationStorageClassifications"); + if (storageClassificationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationStorageClassifications'.", + id))); + } + String storageClassificationMappingName = + Utils.getValueFromIdByName(id, "replicationStorageClassificationMappings"); + if (storageClassificationMappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationStorageClassificationMappings'.", + id))); + } + this + .delete( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 storageClassificationName = Utils.getValueFromIdByName(id, "replicationStorageClassifications"); + if (storageClassificationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationStorageClassifications'.", + id))); + } + String storageClassificationMappingName = + Utils.getValueFromIdByName(id, "replicationStorageClassificationMappings"); + if (storageClassificationMappingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'replicationStorageClassificationMappings'.", + id))); + } + this + .delete( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context); + } + + private ReplicationStorageClassificationMappingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public StorageClassificationMappingImpl define(String name) { + return new StorageClassificationMappingImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsClientImpl.java new file mode 100644 index 000000000000..9b4f48231b20 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsClientImpl.java @@ -0,0 +1,880 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationStorageClassificationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationCollection; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ReplicationStorageClassificationsClient. + */ +public final class ReplicationStorageClassificationsClientImpl implements ReplicationStorageClassificationsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationStorageClassificationsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationStorageClassificationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationStorageClassificationsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + ReplicationStorageClassificationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationStorageClassifications to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationStorageClassificationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabrics( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications" + + "/{storageClassificationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("storageClassificationName") String storageClassificationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationStorageClassifications") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabricsNext( + @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 list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName, context), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * Gets the list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName, context)); + } + + /** + * Gets the details of a storage classification. + * + *

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

Gets the details of the specified storage classification. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 specified storage classification along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (storageClassificationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageClassificationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + storageClassificationName, + accept, + context); + } + + /** + * Gets the details of a storage classification. + * + *

Gets the details of the specified storage classification. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 specified storage classification on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, storageClassificationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a storage classification. + * + *

Gets the details of the specified storage classification. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 specified storage classification along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, storageClassificationName, context) + .block(); + } + + /** + * Gets the details of a storage classification. + * + *

Gets the details of the specified storage classification. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 specified storage classification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageClassificationInner get( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + return getWithResponse(resourceName, resourceGroupName, fabricName, storageClassificationName, Context.NONE) + .getValue(); + } + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 collection of storage details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync( + 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.listByReplicationFabricsNext(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 collection of storage details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync( + 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 + .listByReplicationFabricsNext(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 collection of storage details 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 collection of storage details 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsImpl.java new file mode 100644 index 000000000000..380e2e4687fc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsImpl.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationStorageClassificationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationStorageClassifications; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassification; + +public final class ReplicationStorageClassificationsImpl implements ReplicationStorageClassifications { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationStorageClassificationsImpl.class); + + private final ReplicationStorageClassificationsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationStorageClassificationsImpl( + ReplicationStorageClassificationsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName); + return Utils.mapPage(inner, inner1 -> new StorageClassificationImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName, context); + return Utils.mapPage(inner, inner1 -> new StorageClassificationImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceName, resourceGroupName, fabricName, storageClassificationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageClassificationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageClassification get( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + StorageClassificationInner inner = + this.serviceClient().get(resourceName, resourceGroupName, fabricName, storageClassificationName); + if (inner != null) { + return new StorageClassificationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new StorageClassificationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new StorageClassificationImpl(inner1, this.manager())); + } + + private ReplicationStorageClassificationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsClientImpl.java new file mode 100644 index 000000000000..9c408f4a9f4f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsClientImpl.java @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.recoveryservicessiterecovery.fluent.ReplicationVaultHealthsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultHealthDetailsInner; +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 ReplicationVaultHealthsClient. */ +public final class ReplicationVaultHealthsClientImpl implements ReplicationVaultHealthsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationVaultHealthsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationVaultHealthsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationVaultHealthsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create(ReplicationVaultHealthsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationVaultHealths to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationVaultHealthsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationVaultHealth") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationVaultHealth/default/refresh") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refresh( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the health summary for the vault. + * + *

Gets the health details of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the health details of the vault along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the health summary for the vault. + * + *

Gets the health details of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the health details of the vault along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the health summary for the vault. + * + *

Gets the health details of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the health details of the vault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName) { + return getWithResponseAsync(resourceName, resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the health summary for the vault. + * + *

Gets the health details of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the health details of the vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, context).block(); + } + + /** + * Gets the health summary for the vault. + * + *

Gets the health details of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the health details of the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultHealthDetailsInner get(String resourceName, String resourceGroupName) { + return getWithResponse(resourceName, resourceGroupName, Context.NONE).getValue(); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 health details definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshWithResponseAsync(String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .refresh( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 health details definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshWithResponseAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .refresh( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 health details definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultHealthDetailsInner> beginRefreshAsync( + String resourceName, String resourceGroupName) { + Mono>> mono = refreshWithResponseAsync(resourceName, resourceGroupName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VaultHealthDetailsInner.class, + VaultHealthDetailsInner.class, + this.client.getContext()); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 health details definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultHealthDetailsInner> beginRefreshAsync( + String resourceName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = refreshWithResponseAsync(resourceName, resourceGroupName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VaultHealthDetailsInner.class, + VaultHealthDetailsInner.class, + context); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 health details definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultHealthDetailsInner> beginRefresh( + String resourceName, String resourceGroupName) { + return beginRefreshAsync(resourceName, resourceGroupName).getSyncPoller(); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 health details definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultHealthDetailsInner> beginRefresh( + String resourceName, String resourceGroupName, Context context) { + return beginRefreshAsync(resourceName, resourceGroupName, context).getSyncPoller(); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 health details definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAsync(String resourceName, String resourceGroupName) { + return beginRefreshAsync(resourceName, resourceGroupName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 health details definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAsync(String resourceName, String resourceGroupName, Context context) { + return beginRefreshAsync(resourceName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 health details definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultHealthDetailsInner refresh(String resourceName, String resourceGroupName) { + return refreshAsync(resourceName, resourceGroupName).block(); + } + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 health details definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultHealthDetailsInner refresh(String resourceName, String resourceGroupName, Context context) { + return refreshAsync(resourceName, resourceGroupName, context).block(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsImpl.java new file mode 100644 index 000000000000..008c4817b936 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationVaultHealthsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultHealthDetailsInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationVaultHealths; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultHealthDetails; + +public final class ReplicationVaultHealthsImpl implements ReplicationVaultHealths { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationVaultHealthsImpl.class); + + private final ReplicationVaultHealthsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationVaultHealthsImpl( + ReplicationVaultHealthsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultHealthDetailsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VaultHealthDetails get(String resourceName, String resourceGroupName) { + VaultHealthDetailsInner inner = this.serviceClient().get(resourceName, resourceGroupName); + if (inner != null) { + return new VaultHealthDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + public VaultHealthDetails refresh(String resourceName, String resourceGroupName) { + VaultHealthDetailsInner inner = this.serviceClient().refresh(resourceName, resourceGroupName); + if (inner != null) { + return new VaultHealthDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + public VaultHealthDetails refresh(String resourceName, String resourceGroupName, Context context) { + VaultHealthDetailsInner inner = this.serviceClient().refresh(resourceName, resourceGroupName, context); + if (inner != null) { + return new VaultHealthDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + private ReplicationVaultHealthsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsClientImpl.java new file mode 100644 index 000000000000..abb497a4ee9d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsClientImpl.java @@ -0,0 +1,881 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.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.recoveryservicessiterecovery.fluent.ReplicationVaultSettingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultSettingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInput; +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 ReplicationVaultSettingsClient. */ +public final class ReplicationVaultSettingsClientImpl implements ReplicationVaultSettingsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationVaultSettingsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationVaultSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationVaultSettingsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create(ReplicationVaultSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationVaultSettings to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationVaultSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationVaultSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("vaultSettingName") String vaultSettingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("vaultSettingName") String vaultSettingName, + @BodyParam("application/json") VaultSettingCreationInput input, + @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 list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vault setting along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vault setting along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vault setting as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vault setting as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vault setting as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vault setting as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, context)); + } + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting 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 vault setting along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String vaultSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (vaultSettingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vaultSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + vaultSettingName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting 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 vault setting along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String vaultSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (vaultSettingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vaultSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + vaultSettingName, + accept, + context); + } + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting 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 vault setting on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName, String vaultSettingName) { + return getWithResponseAsync(resourceName, resourceGroupName, vaultSettingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting 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 vault setting along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String vaultSettingName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, vaultSettingName, context).block(); + } + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting 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 vault setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultSettingInner get(String resourceName, String resourceGroupName, String vaultSettingName) { + return getWithResponse(resourceName, resourceGroupName, vaultSettingName, Context.NONE).getValue(); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 setting along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, String resourceGroupName, String vaultSettingName, VaultSettingCreationInput input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (vaultSettingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vaultSettingName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + vaultSettingName, + input, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 setting along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String vaultSettingName, + VaultSettingCreationInput input, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (vaultSettingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vaultSettingName is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + vaultSettingName, + input, + accept, + context); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 setting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultSettingInner> beginCreateAsync( + String resourceName, String resourceGroupName, String vaultSettingName, VaultSettingCreationInput input) { + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, vaultSettingName, input); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VaultSettingInner.class, + VaultSettingInner.class, + this.client.getContext()); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 setting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultSettingInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String vaultSettingName, + VaultSettingCreationInput input, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, vaultSettingName, input, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VaultSettingInner.class, VaultSettingInner.class, context); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 setting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultSettingInner> beginCreate( + String resourceName, String resourceGroupName, String vaultSettingName, VaultSettingCreationInput input) { + return beginCreateAsync(resourceName, resourceGroupName, vaultSettingName, input).getSyncPoller(); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 setting. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultSettingInner> beginCreate( + String resourceName, + String resourceGroupName, + String vaultSettingName, + VaultSettingCreationInput input, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, vaultSettingName, input, context).getSyncPoller(); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 setting on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, String resourceGroupName, String vaultSettingName, VaultSettingCreationInput input) { + return beginCreateAsync(resourceName, resourceGroupName, vaultSettingName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 setting on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String vaultSettingName, + VaultSettingCreationInput input, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, vaultSettingName, input, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultSettingInner create( + String resourceName, String resourceGroupName, String vaultSettingName, VaultSettingCreationInput input) { + return createAsync(resourceName, resourceGroupName, vaultSettingName, input).block(); + } + + /** + * Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + * + *

The operation to configure vault setting. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting name. + * @param input Vault setting creation input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultSettingInner create( + String resourceName, + String resourceGroupName, + String vaultSettingName, + VaultSettingCreationInput input, + Context context) { + return createAsync(resourceName, resourceGroupName, vaultSettingName, input, 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 vault setting 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 setting 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsImpl.java new file mode 100644 index 000000000000..75baed0c7465 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationVaultSettingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultSettingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationVaultSettings; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSetting; + +public final class ReplicationVaultSettingsImpl implements ReplicationVaultSettings { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationVaultSettingsImpl.class); + + private final ReplicationVaultSettingsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationVaultSettingsImpl( + ReplicationVaultSettingsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VaultSettingImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VaultSettingImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String vaultSettingName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, vaultSettingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VaultSetting get(String resourceName, String resourceGroupName, String vaultSettingName) { + VaultSettingInner inner = this.serviceClient().get(resourceName, resourceGroupName, vaultSettingName); + if (inner != null) { + return new VaultSettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public VaultSetting getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 vaultSettingName = Utils.getValueFromIdByName(id, "replicationVaultSettings"); + if (vaultSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaultSettings'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, vaultSettingName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 vaultSettingName = Utils.getValueFromIdByName(id, "replicationVaultSettings"); + if (vaultSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaultSettings'.", + id))); + } + return this.getWithResponse(resourceName, resourceGroupName, vaultSettingName, context); + } + + private ReplicationVaultSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public VaultSettingImpl define(String name) { + return new VaultSettingImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersClientImpl.java new file mode 100644 index 000000000000..f85937c50483 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersClientImpl.java @@ -0,0 +1,1944 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationvCentersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VCenterInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenterCollection; +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 ReplicationvCentersClient. */ +public final class ReplicationvCentersClientImpl implements ReplicationvCentersClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationvCentersService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationvCentersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationvCentersClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy.create(ReplicationvCentersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientReplicationvCenters to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface ReplicationvCentersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabrics( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("vcenterName") String vcenterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("vcenterName") String vcenterName, + @BodyParam("application/json") AddVCenterRequest addVCenterRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("vcenterName") String vcenterName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("vcenterName") String vcenterName, + @BodyParam("application/json") UpdateVCenterRequest updateVCenterRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationvCenters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationFabricsNext( + @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 list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsSinglePageAsync( + String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 + .listByReplicationFabrics( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName, context), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * Gets the list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName, context)); + } + + /** + * Gets the details of a vCenter. + * + *

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

Gets the details of a registered vCenter server(Add vCenter server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 a registered vCenter server(Add vCenter server) along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (vcenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter vcenterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + vcenterName, + accept, + context); + } + + /** + * Gets the details of a vCenter. + * + *

Gets the details of a registered vCenter server(Add vCenter server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 a registered vCenter server(Add vCenter server) on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String vcenterName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, vcenterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a vCenter. + * + *

Gets the details of a registered vCenter server(Add vCenter server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 a registered vCenter server(Add vCenter server) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, vcenterName, context).block(); + } + + /** + * Gets the details of a vCenter. + * + *

Gets the details of a registered vCenter server(Add vCenter server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 a registered vCenter server(Add vCenter server). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VCenterInner get(String resourceName, String resourceGroupName, String fabricName, String vcenterName) { + return getWithResponse(resourceName, resourceGroupName, fabricName, vcenterName, Context.NONE).getValue(); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vCenter definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (vcenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter vcenterName is required and cannot be null.")); + } + if (addVCenterRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter addVCenterRequest is required and cannot be null.")); + } else { + addVCenterRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + vcenterName, + addVCenterRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter 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 vCenter definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (vcenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter vcenterName is required and cannot be null.")); + } + if (addVCenterRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter addVCenterRequest is required and cannot be null.")); + } else { + addVCenterRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + vcenterName, + addVCenterRequest, + accept, + context); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VCenterInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest) { + Mono>> mono = + createWithResponseAsync(resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VCenterInner.class, VCenterInner.class, this.client.getContext()); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter 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 the {@link PollerFlux} for polling of vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VCenterInner> beginCreateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VCenterInner.class, VCenterInner.class, context); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VCenterInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest) + .getSyncPoller(); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter 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 the {@link SyncPoller} for polling of vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VCenterInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest, context) + .getSyncPoller(); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vCenter definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter 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 vCenter definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vCenter definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VCenterInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest) { + return createAsync(resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest).block(); + } + + /** + * Add vCenter. + * + *

The operation to create a vCenter object.. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param addVCenterRequest The input to the add vCenter 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VCenterInner create( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + AddVCenterRequest addVCenterRequest, + Context context) { + return createAsync(resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest, context) + .block(); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (vcenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter vcenterName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + vcenterName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (vcenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter vcenterName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + vcenterName, + context); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName) { + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, vcenterName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceName, resourceGroupName, fabricName, vcenterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, vcenterName).getSyncPoller(); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, vcenterName, context).getSyncPoller(); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, vcenterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, vcenterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName) { + deleteAsync(resourceName, resourceGroupName, fabricName, vcenterName).block(); + } + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context) { + deleteAsync(resourceName, resourceGroupName, fabricName, vcenterName, context).block(); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vCenter definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (vcenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter vcenterName is required and cannot be null.")); + } + if (updateVCenterRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateVCenterRequest is required and cannot be null.")); + } else { + updateVCenterRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + vcenterName, + updateVCenterRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter 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 vCenter definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (vcenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter vcenterName is required and cannot be null.")); + } + if (updateVCenterRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateVCenterRequest is required and cannot be null.")); + } else { + updateVCenterRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + vcenterName, + updateVCenterRequest, + accept, + context); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VCenterInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest) { + Mono>> mono = + updateWithResponseAsync(resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VCenterInner.class, VCenterInner.class, this.client.getContext()); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter 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 the {@link PollerFlux} for polling of vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VCenterInner> beginUpdateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VCenterInner.class, VCenterInner.class, context); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VCenterInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest) + .getSyncPoller(); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter 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 the {@link SyncPoller} for polling of vCenter definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VCenterInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest, + Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest, context) + .getSyncPoller(); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vCenter definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter 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 vCenter definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest, + Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vCenter definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VCenterInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest) { + return updateAsync(resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest).block(); + } + + /** + * Update vCenter operation. + * + *

The operation to update a registered vCenter. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter name. + * @param updateVCenterRequest The input to the update vCenter 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 vCenter definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VCenterInner update( + String resourceName, + String resourceGroupName, + String fabricName, + String vcenterName, + UpdateVCenterRequest updateVCenterRequest, + Context context) { + return updateAsync(resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest, context) + .block(); + } + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of vCenter details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of vCenter details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of vCenter details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of vCenter details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of vCenter details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of vCenter details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, 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 collection of vCenter details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync(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.listByReplicationFabricsNext(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 collection of vCenter details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationFabricsNextSinglePageAsync( + 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 + .listByReplicationFabricsNext(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 collection of vCenter details 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 collection of vCenter details 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersImpl.java new file mode 100644 index 000000000000..1b9a92c2e1a8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.ReplicationvCentersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VCenterInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationvCenters; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenter; + +public final class ReplicationvCentersImpl implements ReplicationvCenters { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationvCentersImpl.class); + + private final ReplicationvCentersClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public ReplicationvCentersImpl( + ReplicationvCentersClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName); + return Utils.mapPage(inner, inner1 -> new VCenterImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context) { + PagedIterable inner = + this.serviceClient().listByReplicationFabrics(resourceName, resourceGroupName, fabricName, context); + return Utils.mapPage(inner, inner1 -> new VCenterImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, fabricName, vcenterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VCenterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VCenter get(String resourceName, String resourceGroupName, String fabricName, String vcenterName) { + VCenterInner inner = this.serviceClient().get(resourceName, resourceGroupName, fabricName, vcenterName); + if (inner != null) { + return new VCenterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceName, String resourceGroupName, String fabricName, String vcenterName) { + this.serviceClient().delete(resourceName, resourceGroupName, fabricName, vcenterName); + } + + public void delete( + String resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context) { + this.serviceClient().delete(resourceName, resourceGroupName, fabricName, vcenterName, context); + } + + public PagedIterable list(String resourceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VCenterImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VCenterImpl(inner1, this.manager())); + } + + public VCenter getById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 vcenterName = Utils.getValueFromIdByName(id, "replicationvCenters"); + if (vcenterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationvCenters'.", id))); + } + return this.getWithResponse(resourceName, resourceGroupName, fabricName, vcenterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 vcenterName = Utils.getValueFromIdByName(id, "replicationvCenters"); + if (vcenterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationvCenters'.", id))); + } + return this.getWithResponse(resourceName, resourceGroupName, fabricName, vcenterName, context); + } + + public void deleteById(String id) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 vcenterName = Utils.getValueFromIdByName(id, "replicationvCenters"); + if (vcenterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationvCenters'.", id))); + } + this.delete(resourceName, resourceGroupName, fabricName, vcenterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceName = Utils.getValueFromIdByName(id, "vaults"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 vcenterName = Utils.getValueFromIdByName(id, "replicationvCenters"); + if (vcenterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationvCenters'.", id))); + } + this.delete(resourceName, resourceGroupName, fabricName, vcenterName, context); + } + + private ReplicationvCentersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + public VCenterImpl define(String name) { + return new VCenterImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientBuilder.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientBuilder.java new file mode 100644 index 000000000000..8de5df53e087 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientBuilder.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.recoveryservicessiterecovery.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 SiteRecoveryManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {SiteRecoveryManagementClientImpl.class}) +public final class SiteRecoveryManagementClientBuilder { + /* + * The subscription Id. + */ + private String subscriptionId; + + /** + * Sets The subscription Id. + * + * @param subscriptionId the subscriptionId value. + * @return the SiteRecoveryManagementClientBuilder. + */ + public SiteRecoveryManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the SiteRecoveryManagementClientBuilder. + */ + public SiteRecoveryManagementClientBuilder 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 SiteRecoveryManagementClientBuilder. + */ + public SiteRecoveryManagementClientBuilder 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 SiteRecoveryManagementClientBuilder. + */ + public SiteRecoveryManagementClientBuilder 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 SiteRecoveryManagementClientBuilder. + */ + public SiteRecoveryManagementClientBuilder 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 SiteRecoveryManagementClientBuilder. + */ + public SiteRecoveryManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of SiteRecoveryManagementClientImpl with the provided parameters. + * + * @return an instance of SiteRecoveryManagementClientImpl. + */ + public SiteRecoveryManagementClientImpl 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(); + SiteRecoveryManagementClientImpl client = + new SiteRecoveryManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientImpl.java new file mode 100644 index 000000000000..200092a19623 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientImpl.java @@ -0,0 +1,668 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.MigrationRecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationAlertSettingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationAppliancesClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationEligibilityResultsOperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationEventsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationFabricsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationJobsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationLogicalNetworksClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationMigrationItemsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationNetworkMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationNetworksClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationPoliciesClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationProtectableItemsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationProtectionContainerMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationProtectionContainersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationProtectionIntentsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationRecoveryPlansClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationRecoveryServicesProvidersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationStorageClassificationMappingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationStorageClassificationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationVaultHealthsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationVaultSettingsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.ReplicationvCentersClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.SiteRecoveryManagementClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.SupportedOperatingSystemsOperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.TargetComputeSizesClient; +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 SiteRecoveryManagementClientImpl type. */ +@ServiceClient(builder = SiteRecoveryManagementClientBuilder.class) +public final class SiteRecoveryManagementClientImpl implements SiteRecoveryManagementClient { + /** The subscription Id. */ + private final String subscriptionId; + + /** + * Gets The subscription Id. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The ReplicationAlertSettingsClient object to access its operations. */ + private final ReplicationAlertSettingsClient replicationAlertSettings; + + /** + * Gets the ReplicationAlertSettingsClient object to access its operations. + * + * @return the ReplicationAlertSettingsClient object. + */ + public ReplicationAlertSettingsClient getReplicationAlertSettings() { + return this.replicationAlertSettings; + } + + /** The ReplicationAppliancesClient object to access its operations. */ + private final ReplicationAppliancesClient replicationAppliances; + + /** + * Gets the ReplicationAppliancesClient object to access its operations. + * + * @return the ReplicationAppliancesClient object. + */ + public ReplicationAppliancesClient getReplicationAppliances() { + return this.replicationAppliances; + } + + /** The ReplicationEligibilityResultsOperationsClient object to access its operations. */ + private final ReplicationEligibilityResultsOperationsClient replicationEligibilityResultsOperations; + + /** + * Gets the ReplicationEligibilityResultsOperationsClient object to access its operations. + * + * @return the ReplicationEligibilityResultsOperationsClient object. + */ + public ReplicationEligibilityResultsOperationsClient getReplicationEligibilityResultsOperations() { + return this.replicationEligibilityResultsOperations; + } + + /** The ReplicationEventsClient object to access its operations. */ + private final ReplicationEventsClient replicationEvents; + + /** + * Gets the ReplicationEventsClient object to access its operations. + * + * @return the ReplicationEventsClient object. + */ + public ReplicationEventsClient getReplicationEvents() { + return this.replicationEvents; + } + + /** The ReplicationFabricsClient object to access its operations. */ + private final ReplicationFabricsClient replicationFabrics; + + /** + * Gets the ReplicationFabricsClient object to access its operations. + * + * @return the ReplicationFabricsClient object. + */ + public ReplicationFabricsClient getReplicationFabrics() { + return this.replicationFabrics; + } + + /** The ReplicationLogicalNetworksClient object to access its operations. */ + private final ReplicationLogicalNetworksClient replicationLogicalNetworks; + + /** + * Gets the ReplicationLogicalNetworksClient object to access its operations. + * + * @return the ReplicationLogicalNetworksClient object. + */ + public ReplicationLogicalNetworksClient getReplicationLogicalNetworks() { + return this.replicationLogicalNetworks; + } + + /** The ReplicationNetworksClient object to access its operations. */ + private final ReplicationNetworksClient replicationNetworks; + + /** + * Gets the ReplicationNetworksClient object to access its operations. + * + * @return the ReplicationNetworksClient object. + */ + public ReplicationNetworksClient getReplicationNetworks() { + return this.replicationNetworks; + } + + /** The ReplicationNetworkMappingsClient object to access its operations. */ + private final ReplicationNetworkMappingsClient replicationNetworkMappings; + + /** + * Gets the ReplicationNetworkMappingsClient object to access its operations. + * + * @return the ReplicationNetworkMappingsClient object. + */ + public ReplicationNetworkMappingsClient getReplicationNetworkMappings() { + return this.replicationNetworkMappings; + } + + /** The ReplicationProtectionContainersClient object to access its operations. */ + private final ReplicationProtectionContainersClient replicationProtectionContainers; + + /** + * Gets the ReplicationProtectionContainersClient object to access its operations. + * + * @return the ReplicationProtectionContainersClient object. + */ + public ReplicationProtectionContainersClient getReplicationProtectionContainers() { + return this.replicationProtectionContainers; + } + + /** The ReplicationMigrationItemsClient object to access its operations. */ + private final ReplicationMigrationItemsClient replicationMigrationItems; + + /** + * Gets the ReplicationMigrationItemsClient object to access its operations. + * + * @return the ReplicationMigrationItemsClient object. + */ + public ReplicationMigrationItemsClient getReplicationMigrationItems() { + return this.replicationMigrationItems; + } + + /** The MigrationRecoveryPointsClient object to access its operations. */ + private final MigrationRecoveryPointsClient migrationRecoveryPoints; + + /** + * Gets the MigrationRecoveryPointsClient object to access its operations. + * + * @return the MigrationRecoveryPointsClient object. + */ + public MigrationRecoveryPointsClient getMigrationRecoveryPoints() { + return this.migrationRecoveryPoints; + } + + /** The ReplicationProtectableItemsClient object to access its operations. */ + private final ReplicationProtectableItemsClient replicationProtectableItems; + + /** + * Gets the ReplicationProtectableItemsClient object to access its operations. + * + * @return the ReplicationProtectableItemsClient object. + */ + public ReplicationProtectableItemsClient getReplicationProtectableItems() { + return this.replicationProtectableItems; + } + + /** The ReplicationProtectedItemsClient object to access its operations. */ + private final ReplicationProtectedItemsClient replicationProtectedItems; + + /** + * Gets the ReplicationProtectedItemsClient object to access its operations. + * + * @return the ReplicationProtectedItemsClient object. + */ + public ReplicationProtectedItemsClient getReplicationProtectedItems() { + return this.replicationProtectedItems; + } + + /** 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 TargetComputeSizesClient object to access its operations. */ + private final TargetComputeSizesClient targetComputeSizes; + + /** + * Gets the TargetComputeSizesClient object to access its operations. + * + * @return the TargetComputeSizesClient object. + */ + public TargetComputeSizesClient getTargetComputeSizes() { + return this.targetComputeSizes; + } + + /** The ReplicationProtectionContainerMappingsClient object to access its operations. */ + private final ReplicationProtectionContainerMappingsClient replicationProtectionContainerMappings; + + /** + * Gets the ReplicationProtectionContainerMappingsClient object to access its operations. + * + * @return the ReplicationProtectionContainerMappingsClient object. + */ + public ReplicationProtectionContainerMappingsClient getReplicationProtectionContainerMappings() { + return this.replicationProtectionContainerMappings; + } + + /** The ReplicationRecoveryServicesProvidersClient object to access its operations. */ + private final ReplicationRecoveryServicesProvidersClient replicationRecoveryServicesProviders; + + /** + * Gets the ReplicationRecoveryServicesProvidersClient object to access its operations. + * + * @return the ReplicationRecoveryServicesProvidersClient object. + */ + public ReplicationRecoveryServicesProvidersClient getReplicationRecoveryServicesProviders() { + return this.replicationRecoveryServicesProviders; + } + + /** The ReplicationStorageClassificationsClient object to access its operations. */ + private final ReplicationStorageClassificationsClient replicationStorageClassifications; + + /** + * Gets the ReplicationStorageClassificationsClient object to access its operations. + * + * @return the ReplicationStorageClassificationsClient object. + */ + public ReplicationStorageClassificationsClient getReplicationStorageClassifications() { + return this.replicationStorageClassifications; + } + + /** The ReplicationStorageClassificationMappingsClient object to access its operations. */ + private final ReplicationStorageClassificationMappingsClient replicationStorageClassificationMappings; + + /** + * Gets the ReplicationStorageClassificationMappingsClient object to access its operations. + * + * @return the ReplicationStorageClassificationMappingsClient object. + */ + public ReplicationStorageClassificationMappingsClient getReplicationStorageClassificationMappings() { + return this.replicationStorageClassificationMappings; + } + + /** The ReplicationvCentersClient object to access its operations. */ + private final ReplicationvCentersClient replicationvCenters; + + /** + * Gets the ReplicationvCentersClient object to access its operations. + * + * @return the ReplicationvCentersClient object. + */ + public ReplicationvCentersClient getReplicationvCenters() { + return this.replicationvCenters; + } + + /** The ReplicationJobsClient object to access its operations. */ + private final ReplicationJobsClient replicationJobs; + + /** + * Gets the ReplicationJobsClient object to access its operations. + * + * @return the ReplicationJobsClient object. + */ + public ReplicationJobsClient getReplicationJobs() { + return this.replicationJobs; + } + + /** The ReplicationPoliciesClient object to access its operations. */ + private final ReplicationPoliciesClient replicationPolicies; + + /** + * Gets the ReplicationPoliciesClient object to access its operations. + * + * @return the ReplicationPoliciesClient object. + */ + public ReplicationPoliciesClient getReplicationPolicies() { + return this.replicationPolicies; + } + + /** The ReplicationProtectionIntentsClient object to access its operations. */ + private final ReplicationProtectionIntentsClient replicationProtectionIntents; + + /** + * Gets the ReplicationProtectionIntentsClient object to access its operations. + * + * @return the ReplicationProtectionIntentsClient object. + */ + public ReplicationProtectionIntentsClient getReplicationProtectionIntents() { + return this.replicationProtectionIntents; + } + + /** The ReplicationRecoveryPlansClient object to access its operations. */ + private final ReplicationRecoveryPlansClient replicationRecoveryPlans; + + /** + * Gets the ReplicationRecoveryPlansClient object to access its operations. + * + * @return the ReplicationRecoveryPlansClient object. + */ + public ReplicationRecoveryPlansClient getReplicationRecoveryPlans() { + return this.replicationRecoveryPlans; + } + + /** The SupportedOperatingSystemsOperationsClient object to access its operations. */ + private final SupportedOperatingSystemsOperationsClient supportedOperatingSystemsOperations; + + /** + * Gets the SupportedOperatingSystemsOperationsClient object to access its operations. + * + * @return the SupportedOperatingSystemsOperationsClient object. + */ + public SupportedOperatingSystemsOperationsClient getSupportedOperatingSystemsOperations() { + return this.supportedOperatingSystemsOperations; + } + + /** The ReplicationVaultHealthsClient object to access its operations. */ + private final ReplicationVaultHealthsClient replicationVaultHealths; + + /** + * Gets the ReplicationVaultHealthsClient object to access its operations. + * + * @return the ReplicationVaultHealthsClient object. + */ + public ReplicationVaultHealthsClient getReplicationVaultHealths() { + return this.replicationVaultHealths; + } + + /** The ReplicationVaultSettingsClient object to access its operations. */ + private final ReplicationVaultSettingsClient replicationVaultSettings; + + /** + * Gets the ReplicationVaultSettingsClient object to access its operations. + * + * @return the ReplicationVaultSettingsClient object. + */ + public ReplicationVaultSettingsClient getReplicationVaultSettings() { + return this.replicationVaultSettings; + } + + /** + * Initializes an instance of SiteRecoveryManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The subscription Id. + * @param endpoint server parameter. + */ + SiteRecoveryManagementClientImpl( + 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 = "2022-10-01"; + this.operations = new OperationsClientImpl(this); + this.replicationAlertSettings = new ReplicationAlertSettingsClientImpl(this); + this.replicationAppliances = new ReplicationAppliancesClientImpl(this); + this.replicationEligibilityResultsOperations = new ReplicationEligibilityResultsOperationsClientImpl(this); + this.replicationEvents = new ReplicationEventsClientImpl(this); + this.replicationFabrics = new ReplicationFabricsClientImpl(this); + this.replicationLogicalNetworks = new ReplicationLogicalNetworksClientImpl(this); + this.replicationNetworks = new ReplicationNetworksClientImpl(this); + this.replicationNetworkMappings = new ReplicationNetworkMappingsClientImpl(this); + this.replicationProtectionContainers = new ReplicationProtectionContainersClientImpl(this); + this.replicationMigrationItems = new ReplicationMigrationItemsClientImpl(this); + this.migrationRecoveryPoints = new MigrationRecoveryPointsClientImpl(this); + this.replicationProtectableItems = new ReplicationProtectableItemsClientImpl(this); + this.replicationProtectedItems = new ReplicationProtectedItemsClientImpl(this); + this.recoveryPoints = new RecoveryPointsClientImpl(this); + this.targetComputeSizes = new TargetComputeSizesClientImpl(this); + this.replicationProtectionContainerMappings = new ReplicationProtectionContainerMappingsClientImpl(this); + this.replicationRecoveryServicesProviders = new ReplicationRecoveryServicesProvidersClientImpl(this); + this.replicationStorageClassifications = new ReplicationStorageClassificationsClientImpl(this); + this.replicationStorageClassificationMappings = new ReplicationStorageClassificationMappingsClientImpl(this); + this.replicationvCenters = new ReplicationvCentersClientImpl(this); + this.replicationJobs = new ReplicationJobsClientImpl(this); + this.replicationPolicies = new ReplicationPoliciesClientImpl(this); + this.replicationProtectionIntents = new ReplicationProtectionIntentsClientImpl(this); + this.replicationRecoveryPlans = new ReplicationRecoveryPlansClientImpl(this); + this.supportedOperatingSystemsOperations = new SupportedOperatingSystemsOperationsClientImpl(this); + this.replicationVaultHealths = new ReplicationVaultHealthsClientImpl(this); + this.replicationVaultSettings = new ReplicationVaultSettingsClientImpl(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(SiteRecoveryManagementClientImpl.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/StorageClassificationImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/StorageClassificationImpl.java new file mode 100644 index 000000000000..ac6ce7d75f8b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/StorageClassificationImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassification; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationProperties; + +public final class StorageClassificationImpl implements StorageClassification { + private StorageClassificationInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + StorageClassificationImpl( + StorageClassificationInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 StorageClassificationProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public StorageClassificationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/StorageClassificationMappingImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/StorageClassificationMappingImpl.java new file mode 100644 index 000000000000..b278e9e9c0dc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/StorageClassificationMappingImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageMappingInputProperties; + +public final class StorageClassificationMappingImpl + implements StorageClassificationMapping, StorageClassificationMapping.Definition { + private StorageClassificationMappingInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + StorageClassificationMappingImpl( + StorageClassificationMappingInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 StorageClassificationMappingProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public StorageClassificationMappingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String fabricName; + + private String storageClassificationName; + + private String storageClassificationMappingName; + + private StorageClassificationMappingInput createPairingInput; + + public StorageClassificationMappingImpl withExistingReplicationStorageClassification( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + this.storageClassificationName = storageClassificationName; + return this; + } + + public StorageClassificationMapping create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationStorageClassificationMappings() + .create( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + createPairingInput, + Context.NONE); + return this; + } + + public StorageClassificationMapping create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationStorageClassificationMappings() + .create( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + createPairingInput, + context); + return this; + } + + StorageClassificationMappingImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new StorageClassificationMappingInner(); + this.serviceManager = serviceManager; + this.storageClassificationMappingName = name; + this.createPairingInput = new StorageClassificationMappingInput(); + } + + public StorageClassificationMapping refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationStorageClassificationMappings() + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + Context.NONE) + .getValue(); + return this; + } + + public StorageClassificationMapping refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationStorageClassificationMappings() + .getWithResponse( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + context) + .getValue(); + return this; + } + + public StorageClassificationMappingImpl withProperties(StorageMappingInputProperties properties) { + this.createPairingInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsImpl.java new file mode 100644 index 000000000000..34adf492fbab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOSProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOperatingSystems; + +public final class SupportedOperatingSystemsImpl implements SupportedOperatingSystems { + private SupportedOperatingSystemsInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + SupportedOperatingSystemsImpl( + SupportedOperatingSystemsInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 SupportedOSProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public SupportedOperatingSystemsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.java new file mode 100644 index 000000000000..ba90a803f256 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsClientImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.SupportedOperatingSystemsOperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SupportedOperatingSystemsOperationsClient. + */ +public final class SupportedOperatingSystemsOperationsClientImpl implements SupportedOperatingSystemsOperationsClient { + /** The proxy service used to perform REST calls. */ + private final SupportedOperatingSystemsOperationsService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of SupportedOperatingSystemsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SupportedOperatingSystemsOperationsClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy + .create( + SupportedOperatingSystemsOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientSupportedOperatingSystemsOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface SupportedOperatingSystemsOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationSupportedOperatingSystems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("instanceType") String instanceType, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param instanceType The instance type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String instanceType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + instanceType, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param instanceType The instance type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceName, String resourceGroupName, String instanceType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + instanceType, + accept, + context); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName) { + final String instanceType = null; + return getWithResponseAsync(resourceName, resourceGroupName, instanceType) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param instanceType The instance type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String instanceType, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, instanceType, context).block(); + } + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportedOperatingSystemsInner get(String resourceName, String resourceGroupName) { + final String instanceType = null; + return getWithResponse(resourceName, resourceGroupName, instanceType, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsImpl.java new file mode 100644 index 000000000000..1a7aca5637fd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsImpl.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.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.SupportedOperatingSystemsOperationsClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOperatingSystems; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOperatingSystemsOperations; + +public final class SupportedOperatingSystemsOperationsImpl implements SupportedOperatingSystemsOperations { + private static final ClientLogger LOGGER = new ClientLogger(SupportedOperatingSystemsOperationsImpl.class); + + private final SupportedOperatingSystemsOperationsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public SupportedOperatingSystemsOperationsImpl( + SupportedOperatingSystemsOperationsClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceName, String resourceGroupName, String instanceType, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, instanceType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SupportedOperatingSystemsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SupportedOperatingSystems get(String resourceName, String resourceGroupName) { + SupportedOperatingSystemsInner inner = this.serviceClient().get(resourceName, resourceGroupName); + if (inner != null) { + return new SupportedOperatingSystemsImpl(inner, this.manager()); + } else { + return null; + } + } + + private SupportedOperatingSystemsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizeImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizeImpl.java new file mode 100644 index 000000000000..13558b689a1c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizeImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSize; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizeProperties; + +public final class TargetComputeSizeImpl implements TargetComputeSize { + private TargetComputeSizeInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + TargetComputeSizeImpl( + TargetComputeSizeInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 TargetComputeSizeProperties properties() { + return this.innerModel().properties(); + } + + public TargetComputeSizeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesClientImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesClientImpl.java new file mode 100644 index 000000000000..0cf47b7e7ced --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesClientImpl.java @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.TargetComputeSizesClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizeCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TargetComputeSizesClient. */ +public final class TargetComputeSizesClientImpl implements TargetComputeSizesClient { + /** The proxy service used to perform REST calls. */ + private final TargetComputeSizesService service; + + /** The service client containing this operation class. */ + private final SiteRecoveryManagementClientImpl client; + + /** + * Initializes an instance of TargetComputeSizesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TargetComputeSizesClientImpl(SiteRecoveryManagementClientImpl client) { + this.service = + RestProxy.create(TargetComputeSizesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SiteRecoveryManagementClientTargetComputeSizes to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SiteRecoveryManageme") + public interface TargetComputeSizesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" + + "/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" + + "/targetComputeSizes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectedItems( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("protectionContainerName") String protectionContainerName, + @PathParam("replicatedProtectedItemName") String replicatedProtectedItemName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByReplicationProtectedItemsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectedItemsSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByReplicationProtectedItems( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectedItemsSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (protectionContainerName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter protectionContainerName is required and cannot be null.")); + } + if (replicatedProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicatedProtectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByReplicationProtectedItems( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectedItemsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return new PagedFlux<>( + () -> + listByReplicationProtectedItemsSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName), + nextLink -> listByReplicationProtectedItemsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectedItemsAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return new PagedFlux<>( + () -> + listByReplicationProtectedItemsSinglePageAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context), + nextLink -> listByReplicationProtectedItemsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return new PagedIterable<>( + listByReplicationProtectedItemsAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName)); + } + + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return new PagedIterable<>( + listByReplicationProtectedItemsAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + 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 target compute size collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectedItemsNextSinglePageAsync( + 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.listByReplicationProtectedItemsNext(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 target compute size collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectedItemsNextSinglePageAsync( + 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 + .listByReplicationProtectedItemsNext(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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesImpl.java new file mode 100644 index 000000000000..85f947aebff6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.TargetComputeSizesClient; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSize; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizes; + +public final class TargetComputeSizesImpl implements TargetComputeSizes { + private static final ClientLogger LOGGER = new ClientLogger(TargetComputeSizesImpl.class); + + private final TargetComputeSizesClient innerClient; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public TargetComputeSizesImpl( + TargetComputeSizesClient innerClient, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectedItems( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName); + return Utils.mapPage(inner, inner1 -> new TargetComputeSizeImpl(inner1, this.manager())); + } + + public PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context); + return Utils.mapPage(inner, inner1 -> new TargetComputeSizeImpl(inner1, this.manager())); + } + + private TargetComputeSizesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/Utils.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/Utils.java new file mode 100644 index 000000000000..084ab42c7d5d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/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.recoveryservicessiterecovery.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VCenterImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VCenterImpl.java new file mode 100644 index 000000000000..5d8c3f4d2e2b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VCenterImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VCenterInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequestProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequestProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenter; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenterProperties; + +public final class VCenterImpl implements VCenter, VCenter.Definition, VCenter.Update { + private VCenterInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public VCenterProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VCenterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String fabricName; + + private String vcenterName; + + private AddVCenterRequest createAddVCenterRequest; + + private UpdateVCenterRequest updateUpdateVCenterRequest; + + public VCenterImpl withExistingReplicationFabric(String resourceName, String resourceGroupName, String fabricName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + return this; + } + + public VCenter create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationvCenters() + .create( + resourceName, resourceGroupName, fabricName, vcenterName, createAddVCenterRequest, Context.NONE); + return this; + } + + public VCenter create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationvCenters() + .create(resourceName, resourceGroupName, fabricName, vcenterName, createAddVCenterRequest, context); + return this; + } + + VCenterImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new VCenterInner(); + this.serviceManager = serviceManager; + this.vcenterName = name; + this.createAddVCenterRequest = new AddVCenterRequest(); + } + + public VCenterImpl update() { + this.updateUpdateVCenterRequest = new UpdateVCenterRequest(); + return this; + } + + public VCenter apply() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationvCenters() + .update( + resourceName, resourceGroupName, fabricName, vcenterName, updateUpdateVCenterRequest, Context.NONE); + return this; + } + + public VCenter apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationvCenters() + .update(resourceName, resourceGroupName, fabricName, vcenterName, updateUpdateVCenterRequest, context); + return this; + } + + VCenterImpl( + VCenterInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fabricName = Utils.getValueFromIdByName(innerObject.id(), "replicationFabrics"); + this.vcenterName = Utils.getValueFromIdByName(innerObject.id(), "replicationvCenters"); + } + + public VCenter refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationvCenters() + .getWithResponse(resourceName, resourceGroupName, fabricName, vcenterName, Context.NONE) + .getValue(); + return this; + } + + public VCenter refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationvCenters() + .getWithResponse(resourceName, resourceGroupName, fabricName, vcenterName, context) + .getValue(); + return this; + } + + public VCenterImpl withProperties(AddVCenterRequestProperties properties) { + this.createAddVCenterRequest.withProperties(properties); + return this; + } + + public VCenterImpl withProperties(UpdateVCenterRequestProperties properties) { + this.updateUpdateVCenterRequest.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VaultHealthDetailsImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VaultHealthDetailsImpl.java new file mode 100644 index 000000000000..750d20d9e60e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VaultHealthDetailsImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultHealthDetailsInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultHealthDetails; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultHealthProperties; + +public final class VaultHealthDetailsImpl implements VaultHealthDetails { + private VaultHealthDetailsInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + VaultHealthDetailsImpl( + VaultHealthDetailsInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 VaultHealthProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public VaultHealthDetailsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VaultSettingImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VaultSettingImpl.java new file mode 100644 index 000000000000..4a098ec76046 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VaultSettingImpl.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.recoveryservicessiterecovery.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultSettingInner; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSetting; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingProperties; + +public final class VaultSettingImpl implements VaultSetting, VaultSetting.Definition { + private VaultSettingInner innerObject; + + private final com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager; + + VaultSettingImpl( + VaultSettingInner innerObject, + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager 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 VaultSettingProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VaultSettingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager() { + return this.serviceManager; + } + + private String resourceName; + + private String resourceGroupName; + + private String vaultSettingName; + + private VaultSettingCreationInput createInput; + + public VaultSettingImpl withExistingVault(String resourceName, String resourceGroupName) { + this.resourceName = resourceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public VaultSetting create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationVaultSettings() + .create(resourceName, resourceGroupName, vaultSettingName, createInput, Context.NONE); + return this; + } + + public VaultSetting create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationVaultSettings() + .create(resourceName, resourceGroupName, vaultSettingName, createInput, context); + return this; + } + + VaultSettingImpl( + String name, com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager serviceManager) { + this.innerObject = new VaultSettingInner(); + this.serviceManager = serviceManager; + this.vaultSettingName = name; + this.createInput = new VaultSettingCreationInput(); + } + + public VaultSetting refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationVaultSettings() + .getWithResponse(resourceName, resourceGroupName, vaultSettingName, Context.NONE) + .getValue(); + return this; + } + + public VaultSetting refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationVaultSettings() + .getWithResponse(resourceName, resourceGroupName, vaultSettingName, context) + .getValue(); + return this; + } + + public VaultSettingImpl withProperties(VaultSettingCreationInputProperties properties) { + this.createInput.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/package-info.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/package-info.java new file mode 100644 index 000000000000..a4cea854e6d7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for SiteRecoveryManagementClient. null. */ +package com.azure.resourcemanager.recoveryservicessiterecovery.implementation; diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AAddDisksInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AAddDisksInput.java new file mode 100644 index 000000000000..21b3c718b6ae --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AAddDisksInput.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.recoveryservicessiterecovery.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; +import java.util.List; + +/** A2A add disk(s) input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AAddDisksInput extends AddDisksProviderSpecificInput { + /* + * The list of vm disk details. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /* + * The list of vm managed disk details. + */ + @JsonProperty(value = "vmManagedDisks") + private List vmManagedDisks; + + /** Creates an instance of A2AAddDisksInput class. */ + public A2AAddDisksInput() { + } + + /** + * Get the vmDisks property: The list of vm disk details. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of vm disk details. + * + * @param vmDisks the vmDisks value to set. + * @return the A2AAddDisksInput object itself. + */ + public A2AAddDisksInput withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Get the vmManagedDisks property: The list of vm managed disk details. + * + * @return the vmManagedDisks value. + */ + public List vmManagedDisks() { + return this.vmManagedDisks; + } + + /** + * Set the vmManagedDisks property: The list of vm managed disk details. + * + * @param vmManagedDisks the vmManagedDisks value to set. + * @return the A2AAddDisksInput object itself. + */ + public A2AAddDisksInput withVmManagedDisks(List vmManagedDisks) { + this.vmManagedDisks = vmManagedDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + if (vmManagedDisks() != null) { + vmManagedDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AApplyRecoveryPointInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AApplyRecoveryPointInput.java new file mode 100644 index 000000000000..ff208d91784d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AApplyRecoveryPointInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** ApplyRecoveryPoint input specific to A2A provider. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Immutable +public final class A2AApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { + /** Creates an instance of A2AApplyRecoveryPointInput class. */ + public A2AApplyRecoveryPointInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AContainerCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AContainerCreationInput.java new file mode 100644 index 000000000000..c6d9c28514e2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AContainerCreationInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** A2A cloud creation input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Immutable +public final class A2AContainerCreationInput extends ReplicationProviderSpecificContainerCreationInput { + /** Creates an instance of A2AContainerCreationInput class. */ + public A2AContainerCreationInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AContainerMappingInput.java new file mode 100644 index 000000000000..f1b67187de9b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AContainerMappingInput.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A container mapping input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AContainerMappingInput extends ReplicationProviderSpecificContainerMappingInput { + /* + * A value indicating whether the auto update is enabled. + */ + @JsonProperty(value = "agentAutoUpdateStatus") + private AgentAutoUpdateStatus agentAutoUpdateStatus; + + /* + * The automation account arm id. + */ + @JsonProperty(value = "automationAccountArmId") + private String automationAccountArmId; + + /* + * A value indicating the type authentication to use for automation Account. + */ + @JsonProperty(value = "automationAccountAuthenticationType") + private AutomationAccountAuthenticationType automationAccountAuthenticationType; + + /** Creates an instance of A2AContainerMappingInput class. */ + public A2AContainerMappingInput() { + } + + /** + * Get the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @return the agentAutoUpdateStatus value. + */ + public AgentAutoUpdateStatus agentAutoUpdateStatus() { + return this.agentAutoUpdateStatus; + } + + /** + * Set the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @param agentAutoUpdateStatus the agentAutoUpdateStatus value to set. + * @return the A2AContainerMappingInput object itself. + */ + public A2AContainerMappingInput withAgentAutoUpdateStatus(AgentAutoUpdateStatus agentAutoUpdateStatus) { + this.agentAutoUpdateStatus = agentAutoUpdateStatus; + return this; + } + + /** + * Get the automationAccountArmId property: The automation account arm id. + * + * @return the automationAccountArmId value. + */ + public String automationAccountArmId() { + return this.automationAccountArmId; + } + + /** + * Set the automationAccountArmId property: The automation account arm id. + * + * @param automationAccountArmId the automationAccountArmId value to set. + * @return the A2AContainerMappingInput object itself. + */ + public A2AContainerMappingInput withAutomationAccountArmId(String automationAccountArmId) { + this.automationAccountArmId = automationAccountArmId; + return this; + } + + /** + * Get the automationAccountAuthenticationType property: A value indicating the type authentication to use for + * automation Account. + * + * @return the automationAccountAuthenticationType value. + */ + public AutomationAccountAuthenticationType automationAccountAuthenticationType() { + return this.automationAccountAuthenticationType; + } + + /** + * Set the automationAccountAuthenticationType property: A value indicating the type authentication to use for + * automation Account. + * + * @param automationAccountAuthenticationType the automationAccountAuthenticationType value to set. + * @return the A2AContainerMappingInput object itself. + */ + public A2AContainerMappingInput withAutomationAccountAuthenticationType( + AutomationAccountAuthenticationType automationAccountAuthenticationType) { + this.automationAccountAuthenticationType = automationAccountAuthenticationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACreateProtectionIntentInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACreateProtectionIntentInput.java new file mode 100644 index 000000000000..45aecb72bed9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACreateProtectionIntentInput.java @@ -0,0 +1,681 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A create protection intent input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2ACreateProtectionIntentInput extends CreateProtectionIntentProviderSpecificDetails { + /* + * The fabric specific object Id of the virtual machine. + */ + @JsonProperty(value = "fabricObjectId", required = true) + private String fabricObjectId; + + /* + * The primary location for the virtual machine. + */ + @JsonProperty(value = "primaryLocation", required = true) + private String primaryLocation; + + /* + * The recovery location for the virtual machine. + */ + @JsonProperty(value = "recoveryLocation", required = true) + private String recoveryLocation; + + /* + * The recovery subscription Id of the virtual machine. + */ + @JsonProperty(value = "recoverySubscriptionId", required = true) + private String recoverySubscriptionId; + + /* + * The recovery availability type of the virtual machine. + */ + @JsonProperty(value = "recoveryAvailabilityType", required = true) + private A2ARecoveryAvailabilityType recoveryAvailabilityType; + + /* + * The protection profile custom inputs. + */ + @JsonProperty(value = "protectionProfileCustomInput") + private ProtectionProfileCustomDetails protectionProfileCustomInput; + + /* + * The recovery resource group Id. Valid for V2 scenarios. + */ + @JsonProperty(value = "recoveryResourceGroupId", required = true) + private String recoveryResourceGroupId; + + /* + * The primary staging storage account input. + */ + @JsonProperty(value = "primaryStagingStorageAccountCustomInput") + private StorageAccountCustomDetails primaryStagingStorageAccountCustomInput; + + /* + * The recovery availability set input. + */ + @JsonProperty(value = "recoveryAvailabilitySetCustomInput") + private RecoveryAvailabilitySetCustomDetails recoveryAvailabilitySetCustomInput; + + /* + * The recovery virtual network input. + */ + @JsonProperty(value = "recoveryVirtualNetworkCustomInput") + private RecoveryVirtualNetworkCustomDetails recoveryVirtualNetworkCustomInput; + + /* + * The recovery proximity placement group custom input. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupCustomInput") + private RecoveryProximityPlacementGroupCustomDetails recoveryProximityPlacementGroupCustomInput; + + /* + * A value indicating whether the auto protection is enabled. + */ + @JsonProperty(value = "autoProtectionOfDataDisk") + private AutoProtectionOfDataDisk autoProtectionOfDataDisk; + + /* + * The list of vm disk inputs. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /* + * The list of vm managed disk inputs. + */ + @JsonProperty(value = "vmManagedDisks") + private List vmManagedDisks; + + /* + * The multi vm group name. + */ + @JsonProperty(value = "multiVmGroupName") + private String multiVmGroupName; + + /* + * The multi vm group id. + */ + @JsonProperty(value = "multiVmGroupId") + private String multiVmGroupId; + + /* + * The boot diagnostic storage account. + */ + @JsonProperty(value = "recoveryBootDiagStorageAccount") + private StorageAccountCustomDetails recoveryBootDiagStorageAccount; + + /* + * The recovery disk encryption information (for two pass flows). + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /* + * The recovery availability zone. + */ + @JsonProperty(value = "recoveryAvailabilityZone") + private String recoveryAvailabilityZone; + + /* + * A value indicating whether the auto update is enabled. + */ + @JsonProperty(value = "agentAutoUpdateStatus") + private AgentAutoUpdateStatus agentAutoUpdateStatus; + + /* + * A value indicating the authentication type for automation account. The default value is "RunAsAccount". + */ + @JsonProperty(value = "automationAccountAuthenticationType") + private AutomationAccountAuthenticationType automationAccountAuthenticationType; + + /* + * The automation account arm id. + */ + @JsonProperty(value = "automationAccountArmId") + private String automationAccountArmId; + + /** Creates an instance of A2ACreateProtectionIntentInput class. */ + public A2ACreateProtectionIntentInput() { + } + + /** + * Get the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Set the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @param fabricObjectId the fabricObjectId value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withFabricObjectId(String fabricObjectId) { + this.fabricObjectId = fabricObjectId; + return this; + } + + /** + * Get the primaryLocation property: The primary location for the virtual machine. + * + * @return the primaryLocation value. + */ + public String primaryLocation() { + return this.primaryLocation; + } + + /** + * Set the primaryLocation property: The primary location for the virtual machine. + * + * @param primaryLocation the primaryLocation value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withPrimaryLocation(String primaryLocation) { + this.primaryLocation = primaryLocation; + return this; + } + + /** + * Get the recoveryLocation property: The recovery location for the virtual machine. + * + * @return the recoveryLocation value. + */ + public String recoveryLocation() { + return this.recoveryLocation; + } + + /** + * Set the recoveryLocation property: The recovery location for the virtual machine. + * + * @param recoveryLocation the recoveryLocation value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withRecoveryLocation(String recoveryLocation) { + this.recoveryLocation = recoveryLocation; + return this; + } + + /** + * Get the recoverySubscriptionId property: The recovery subscription Id of the virtual machine. + * + * @return the recoverySubscriptionId value. + */ + public String recoverySubscriptionId() { + return this.recoverySubscriptionId; + } + + /** + * Set the recoverySubscriptionId property: The recovery subscription Id of the virtual machine. + * + * @param recoverySubscriptionId the recoverySubscriptionId value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withRecoverySubscriptionId(String recoverySubscriptionId) { + this.recoverySubscriptionId = recoverySubscriptionId; + return this; + } + + /** + * Get the recoveryAvailabilityType property: The recovery availability type of the virtual machine. + * + * @return the recoveryAvailabilityType value. + */ + public A2ARecoveryAvailabilityType recoveryAvailabilityType() { + return this.recoveryAvailabilityType; + } + + /** + * Set the recoveryAvailabilityType property: The recovery availability type of the virtual machine. + * + * @param recoveryAvailabilityType the recoveryAvailabilityType value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withRecoveryAvailabilityType( + A2ARecoveryAvailabilityType recoveryAvailabilityType) { + this.recoveryAvailabilityType = recoveryAvailabilityType; + return this; + } + + /** + * Get the protectionProfileCustomInput property: The protection profile custom inputs. + * + * @return the protectionProfileCustomInput value. + */ + public ProtectionProfileCustomDetails protectionProfileCustomInput() { + return this.protectionProfileCustomInput; + } + + /** + * Set the protectionProfileCustomInput property: The protection profile custom inputs. + * + * @param protectionProfileCustomInput the protectionProfileCustomInput value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withProtectionProfileCustomInput( + ProtectionProfileCustomDetails protectionProfileCustomInput) { + this.protectionProfileCustomInput = protectionProfileCustomInput; + return this; + } + + /** + * Get the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @return the recoveryResourceGroupId value. + */ + public String recoveryResourceGroupId() { + return this.recoveryResourceGroupId; + } + + /** + * Set the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @param recoveryResourceGroupId the recoveryResourceGroupId value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Get the primaryStagingStorageAccountCustomInput property: The primary staging storage account input. + * + * @return the primaryStagingStorageAccountCustomInput value. + */ + public StorageAccountCustomDetails primaryStagingStorageAccountCustomInput() { + return this.primaryStagingStorageAccountCustomInput; + } + + /** + * Set the primaryStagingStorageAccountCustomInput property: The primary staging storage account input. + * + * @param primaryStagingStorageAccountCustomInput the primaryStagingStorageAccountCustomInput value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withPrimaryStagingStorageAccountCustomInput( + StorageAccountCustomDetails primaryStagingStorageAccountCustomInput) { + this.primaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput; + return this; + } + + /** + * Get the recoveryAvailabilitySetCustomInput property: The recovery availability set input. + * + * @return the recoveryAvailabilitySetCustomInput value. + */ + public RecoveryAvailabilitySetCustomDetails recoveryAvailabilitySetCustomInput() { + return this.recoveryAvailabilitySetCustomInput; + } + + /** + * Set the recoveryAvailabilitySetCustomInput property: The recovery availability set input. + * + * @param recoveryAvailabilitySetCustomInput the recoveryAvailabilitySetCustomInput value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withRecoveryAvailabilitySetCustomInput( + RecoveryAvailabilitySetCustomDetails recoveryAvailabilitySetCustomInput) { + this.recoveryAvailabilitySetCustomInput = recoveryAvailabilitySetCustomInput; + return this; + } + + /** + * Get the recoveryVirtualNetworkCustomInput property: The recovery virtual network input. + * + * @return the recoveryVirtualNetworkCustomInput value. + */ + public RecoveryVirtualNetworkCustomDetails recoveryVirtualNetworkCustomInput() { + return this.recoveryVirtualNetworkCustomInput; + } + + /** + * Set the recoveryVirtualNetworkCustomInput property: The recovery virtual network input. + * + * @param recoveryVirtualNetworkCustomInput the recoveryVirtualNetworkCustomInput value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withRecoveryVirtualNetworkCustomInput( + RecoveryVirtualNetworkCustomDetails recoveryVirtualNetworkCustomInput) { + this.recoveryVirtualNetworkCustomInput = recoveryVirtualNetworkCustomInput; + return this; + } + + /** + * Get the recoveryProximityPlacementGroupCustomInput property: The recovery proximity placement group custom input. + * + * @return the recoveryProximityPlacementGroupCustomInput value. + */ + public RecoveryProximityPlacementGroupCustomDetails recoveryProximityPlacementGroupCustomInput() { + return this.recoveryProximityPlacementGroupCustomInput; + } + + /** + * Set the recoveryProximityPlacementGroupCustomInput property: The recovery proximity placement group custom input. + * + * @param recoveryProximityPlacementGroupCustomInput the recoveryProximityPlacementGroupCustomInput value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withRecoveryProximityPlacementGroupCustomInput( + RecoveryProximityPlacementGroupCustomDetails recoveryProximityPlacementGroupCustomInput) { + this.recoveryProximityPlacementGroupCustomInput = recoveryProximityPlacementGroupCustomInput; + return this; + } + + /** + * Get the autoProtectionOfDataDisk property: A value indicating whether the auto protection is enabled. + * + * @return the autoProtectionOfDataDisk value. + */ + public AutoProtectionOfDataDisk autoProtectionOfDataDisk() { + return this.autoProtectionOfDataDisk; + } + + /** + * Set the autoProtectionOfDataDisk property: A value indicating whether the auto protection is enabled. + * + * @param autoProtectionOfDataDisk the autoProtectionOfDataDisk value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withAutoProtectionOfDataDisk( + AutoProtectionOfDataDisk autoProtectionOfDataDisk) { + this.autoProtectionOfDataDisk = autoProtectionOfDataDisk; + return this; + } + + /** + * Get the vmDisks property: The list of vm disk inputs. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of vm disk inputs. + * + * @param vmDisks the vmDisks value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Get the vmManagedDisks property: The list of vm managed disk inputs. + * + * @return the vmManagedDisks value. + */ + public List vmManagedDisks() { + return this.vmManagedDisks; + } + + /** + * Set the vmManagedDisks property: The list of vm managed disk inputs. + * + * @param vmManagedDisks the vmManagedDisks value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withVmManagedDisks( + List vmManagedDisks) { + this.vmManagedDisks = vmManagedDisks; + return this; + } + + /** + * Get the multiVmGroupName property: The multi vm group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Set the multiVmGroupName property: The multi vm group name. + * + * @param multiVmGroupName the multiVmGroupName value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withMultiVmGroupName(String multiVmGroupName) { + this.multiVmGroupName = multiVmGroupName; + return this; + } + + /** + * Get the multiVmGroupId property: The multi vm group id. + * + * @return the multiVmGroupId value. + */ + public String multiVmGroupId() { + return this.multiVmGroupId; + } + + /** + * Set the multiVmGroupId property: The multi vm group id. + * + * @param multiVmGroupId the multiVmGroupId value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withMultiVmGroupId(String multiVmGroupId) { + this.multiVmGroupId = multiVmGroupId; + return this; + } + + /** + * Get the recoveryBootDiagStorageAccount property: The boot diagnostic storage account. + * + * @return the recoveryBootDiagStorageAccount value. + */ + public StorageAccountCustomDetails recoveryBootDiagStorageAccount() { + return this.recoveryBootDiagStorageAccount; + } + + /** + * Set the recoveryBootDiagStorageAccount property: The boot diagnostic storage account. + * + * @param recoveryBootDiagStorageAccount the recoveryBootDiagStorageAccount value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withRecoveryBootDiagStorageAccount( + StorageAccountCustomDetails recoveryBootDiagStorageAccount) { + this.recoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount; + return this; + } + + /** + * Get the diskEncryptionInfo property: The recovery disk encryption information (for two pass flows). + * + * @return the diskEncryptionInfo value. + */ + public DiskEncryptionInfo diskEncryptionInfo() { + return this.diskEncryptionInfo; + } + + /** + * Set the diskEncryptionInfo property: The recovery disk encryption information (for two pass flows). + * + * @param diskEncryptionInfo the diskEncryptionInfo value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withDiskEncryptionInfo(DiskEncryptionInfo diskEncryptionInfo) { + this.diskEncryptionInfo = diskEncryptionInfo; + return this; + } + + /** + * Get the recoveryAvailabilityZone property: The recovery availability zone. + * + * @return the recoveryAvailabilityZone value. + */ + public String recoveryAvailabilityZone() { + return this.recoveryAvailabilityZone; + } + + /** + * Set the recoveryAvailabilityZone property: The recovery availability zone. + * + * @param recoveryAvailabilityZone the recoveryAvailabilityZone value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withRecoveryAvailabilityZone(String recoveryAvailabilityZone) { + this.recoveryAvailabilityZone = recoveryAvailabilityZone; + return this; + } + + /** + * Get the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @return the agentAutoUpdateStatus value. + */ + public AgentAutoUpdateStatus agentAutoUpdateStatus() { + return this.agentAutoUpdateStatus; + } + + /** + * Set the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @param agentAutoUpdateStatus the agentAutoUpdateStatus value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withAgentAutoUpdateStatus(AgentAutoUpdateStatus agentAutoUpdateStatus) { + this.agentAutoUpdateStatus = agentAutoUpdateStatus; + return this; + } + + /** + * Get the automationAccountAuthenticationType property: A value indicating the authentication type for automation + * account. The default value is "RunAsAccount". + * + * @return the automationAccountAuthenticationType value. + */ + public AutomationAccountAuthenticationType automationAccountAuthenticationType() { + return this.automationAccountAuthenticationType; + } + + /** + * Set the automationAccountAuthenticationType property: A value indicating the authentication type for automation + * account. The default value is "RunAsAccount". + * + * @param automationAccountAuthenticationType the automationAccountAuthenticationType value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withAutomationAccountAuthenticationType( + AutomationAccountAuthenticationType automationAccountAuthenticationType) { + this.automationAccountAuthenticationType = automationAccountAuthenticationType; + return this; + } + + /** + * Get the automationAccountArmId property: The automation account arm id. + * + * @return the automationAccountArmId value. + */ + public String automationAccountArmId() { + return this.automationAccountArmId; + } + + /** + * Set the automationAccountArmId property: The automation account arm id. + * + * @param automationAccountArmId the automationAccountArmId value to set. + * @return the A2ACreateProtectionIntentInput object itself. + */ + public A2ACreateProtectionIntentInput withAutomationAccountArmId(String automationAccountArmId) { + this.automationAccountArmId = automationAccountArmId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (fabricObjectId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fabricObjectId in model A2ACreateProtectionIntentInput")); + } + if (primaryLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property primaryLocation in model A2ACreateProtectionIntentInput")); + } + if (recoveryLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryLocation in model A2ACreateProtectionIntentInput")); + } + if (recoverySubscriptionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoverySubscriptionId in model A2ACreateProtectionIntentInput")); + } + if (recoveryAvailabilityType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryAvailabilityType in model A2ACreateProtectionIntentInput")); + } + if (protectionProfileCustomInput() != null) { + protectionProfileCustomInput().validate(); + } + if (recoveryResourceGroupId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryResourceGroupId in model A2ACreateProtectionIntentInput")); + } + if (primaryStagingStorageAccountCustomInput() != null) { + primaryStagingStorageAccountCustomInput().validate(); + } + if (recoveryAvailabilitySetCustomInput() != null) { + recoveryAvailabilitySetCustomInput().validate(); + } + if (recoveryVirtualNetworkCustomInput() != null) { + recoveryVirtualNetworkCustomInput().validate(); + } + if (recoveryProximityPlacementGroupCustomInput() != null) { + recoveryProximityPlacementGroupCustomInput().validate(); + } + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + if (vmManagedDisks() != null) { + vmManagedDisks().forEach(e -> e.validate()); + } + if (recoveryBootDiagStorageAccount() != null) { + recoveryBootDiagStorageAccount().validate(); + } + if (diskEncryptionInfo() != null) { + diskEncryptionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(A2ACreateProtectionIntentInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationApplyRecoveryPointInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationApplyRecoveryPointInput.java new file mode 100644 index 000000000000..b020c388017e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationApplyRecoveryPointInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** ApplyRecoveryPoint input specific to A2ACrossClusterMigration provider. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2ACrossClusterMigration") +@Immutable +public final class A2ACrossClusterMigrationApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { + /** Creates an instance of A2ACrossClusterMigrationApplyRecoveryPointInput class. */ + public A2ACrossClusterMigrationApplyRecoveryPointInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationContainerCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationContainerCreationInput.java new file mode 100644 index 000000000000..7eb16d7d1ce2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationContainerCreationInput.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** A2ACrossClusterMigration cloud creation input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2ACrossClusterMigration") +@Immutable +public final class A2ACrossClusterMigrationContainerCreationInput + extends ReplicationProviderSpecificContainerCreationInput { + /** Creates an instance of A2ACrossClusterMigrationContainerCreationInput class. */ + public A2ACrossClusterMigrationContainerCreationInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationEnableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationEnableProtectionInput.java new file mode 100644 index 000000000000..c6056cdb7370 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationEnableProtectionInput.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.recoveryservicessiterecovery.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; + +/** A2A Cross-Cluster Migration enable protection input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2ACrossClusterMigration") +@Fluent +public final class A2ACrossClusterMigrationEnableProtectionInput extends EnableProtectionProviderSpecificInput { + /* + * The fabric specific object Id of the virtual machine. + */ + @JsonProperty(value = "fabricObjectId") + private String fabricObjectId; + + /* + * The recovery container Id. + */ + @JsonProperty(value = "recoveryContainerId") + private String recoveryContainerId; + + /** Creates an instance of A2ACrossClusterMigrationEnableProtectionInput class. */ + public A2ACrossClusterMigrationEnableProtectionInput() { + } + + /** + * Get the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Set the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @param fabricObjectId the fabricObjectId value to set. + * @return the A2ACrossClusterMigrationEnableProtectionInput object itself. + */ + public A2ACrossClusterMigrationEnableProtectionInput withFabricObjectId(String fabricObjectId) { + this.fabricObjectId = fabricObjectId; + return this; + } + + /** + * Get the recoveryContainerId property: The recovery container Id. + * + * @return the recoveryContainerId value. + */ + public String recoveryContainerId() { + return this.recoveryContainerId; + } + + /** + * Set the recoveryContainerId property: The recovery container Id. + * + * @param recoveryContainerId the recoveryContainerId value to set. + * @return the A2ACrossClusterMigrationEnableProtectionInput object itself. + */ + public A2ACrossClusterMigrationEnableProtectionInput withRecoveryContainerId(String recoveryContainerId) { + this.recoveryContainerId = recoveryContainerId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationPolicyCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationPolicyCreationInput.java new file mode 100644 index 000000000000..5ccb29f1f9ec --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationPolicyCreationInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** A2A Cross-Cluster Migration Policy creation input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2ACrossClusterMigration") +@Immutable +public final class A2ACrossClusterMigrationPolicyCreationInput extends PolicyProviderSpecificInput { + /** Creates an instance of A2ACrossClusterMigrationPolicyCreationInput class. */ + public A2ACrossClusterMigrationPolicyCreationInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationReplicationDetails.java new file mode 100644 index 000000000000..f49af7b05ccc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACrossClusterMigrationReplicationDetails.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2ACrossClusterMigration") +@Fluent +public final class A2ACrossClusterMigrationReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * The fabric specific object Id of the virtual machine. + */ + @JsonProperty(value = "fabricObjectId") + private String fabricObjectId; + + /* + * Primary fabric location. + */ + @JsonProperty(value = "primaryFabricLocation") + private String primaryFabricLocation; + + /* + * The type of operating system. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The protection state for the vm. + */ + @JsonProperty(value = "vmProtectionState") + private String vmProtectionState; + + /* + * The protection state description for the vm. + */ + @JsonProperty(value = "vmProtectionStateDescription") + private String vmProtectionStateDescription; + + /* + * An id associated with the PE that survives actions like switch protection which change the backing PE/CPE + * objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id + * that denotes the "same" protected item even though other internal Ids/ARM Id might be changing. + */ + @JsonProperty(value = "lifecycleId") + private String lifecycleId; + + /** Creates an instance of A2ACrossClusterMigrationReplicationDetails class. */ + public A2ACrossClusterMigrationReplicationDetails() { + } + + /** + * Get the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Set the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @param fabricObjectId the fabricObjectId value to set. + * @return the A2ACrossClusterMigrationReplicationDetails object itself. + */ + public A2ACrossClusterMigrationReplicationDetails withFabricObjectId(String fabricObjectId) { + this.fabricObjectId = fabricObjectId; + return this; + } + + /** + * Get the primaryFabricLocation property: Primary fabric location. + * + * @return the primaryFabricLocation value. + */ + public String primaryFabricLocation() { + return this.primaryFabricLocation; + } + + /** + * Set the primaryFabricLocation property: Primary fabric location. + * + * @param primaryFabricLocation the primaryFabricLocation value to set. + * @return the A2ACrossClusterMigrationReplicationDetails object itself. + */ + public A2ACrossClusterMigrationReplicationDetails withPrimaryFabricLocation(String primaryFabricLocation) { + this.primaryFabricLocation = primaryFabricLocation; + return this; + } + + /** + * Get the osType property: The type of operating system. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The type of operating system. + * + * @param osType the osType value to set. + * @return the A2ACrossClusterMigrationReplicationDetails object itself. + */ + public A2ACrossClusterMigrationReplicationDetails withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the vmProtectionState property: The protection state for the vm. + * + * @return the vmProtectionState value. + */ + public String vmProtectionState() { + return this.vmProtectionState; + } + + /** + * Set the vmProtectionState property: The protection state for the vm. + * + * @param vmProtectionState the vmProtectionState value to set. + * @return the A2ACrossClusterMigrationReplicationDetails object itself. + */ + public A2ACrossClusterMigrationReplicationDetails withVmProtectionState(String vmProtectionState) { + this.vmProtectionState = vmProtectionState; + return this; + } + + /** + * Get the vmProtectionStateDescription property: The protection state description for the vm. + * + * @return the vmProtectionStateDescription value. + */ + public String vmProtectionStateDescription() { + return this.vmProtectionStateDescription; + } + + /** + * Set the vmProtectionStateDescription property: The protection state description for the vm. + * + * @param vmProtectionStateDescription the vmProtectionStateDescription value to set. + * @return the A2ACrossClusterMigrationReplicationDetails object itself. + */ + public A2ACrossClusterMigrationReplicationDetails withVmProtectionStateDescription( + String vmProtectionStateDescription) { + this.vmProtectionStateDescription = vmProtectionStateDescription; + return this; + } + + /** + * Get the lifecycleId property: An id associated with the PE that survives actions like switch protection which + * change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in + * being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be + * changing. + * + * @return the lifecycleId value. + */ + public String lifecycleId() { + return this.lifecycleId; + } + + /** + * Set the lifecycleId property: An id associated with the PE that survives actions like switch protection which + * change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in + * being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be + * changing. + * + * @param lifecycleId the lifecycleId value to set. + * @return the A2ACrossClusterMigrationReplicationDetails object itself. + */ + public A2ACrossClusterMigrationReplicationDetails withLifecycleId(String lifecycleId) { + this.lifecycleId = lifecycleId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEnableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEnableProtectionInput.java new file mode 100644 index 000000000000..482acb44de66 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEnableProtectionInput.java @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A enable protection input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AEnableProtectionInput extends EnableProtectionProviderSpecificInput { + /* + * The fabric specific object Id of the virtual machine. + */ + @JsonProperty(value = "fabricObjectId", required = true) + private String fabricObjectId; + + /* + * The recovery container Id. + */ + @JsonProperty(value = "recoveryContainerId") + private String recoveryContainerId; + + /* + * The recovery resource group Id. Valid for V2 scenarios. + */ + @JsonProperty(value = "recoveryResourceGroupId") + private String recoveryResourceGroupId; + + /* + * The recovery cloud service Id. Valid for V1 scenarios. + */ + @JsonProperty(value = "recoveryCloudServiceId") + private String recoveryCloudServiceId; + + /* + * The recovery availability set Id. + */ + @JsonProperty(value = "recoveryAvailabilitySetId") + private String recoveryAvailabilitySetId; + + /* + * The recovery proximity placement group Id. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /* + * The list of vm disk details. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /* + * The list of vm managed disk details. + */ + @JsonProperty(value = "vmManagedDisks") + private List vmManagedDisks; + + /* + * The multi vm group name. + */ + @JsonProperty(value = "multiVmGroupName") + private String multiVmGroupName; + + /* + * The multi vm group id. + */ + @JsonProperty(value = "multiVmGroupId") + private String multiVmGroupId; + + /* + * The boot diagnostic storage account. + */ + @JsonProperty(value = "recoveryBootDiagStorageAccountId") + private String recoveryBootDiagStorageAccountId; + + /* + * The recovery disk encryption information (for two pass flows). + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /* + * The recovery availability zone. + */ + @JsonProperty(value = "recoveryAvailabilityZone") + private String recoveryAvailabilityZone; + + /* + * The recovery extended location. + */ + @JsonProperty(value = "recoveryExtendedLocation") + private ExtendedLocation recoveryExtendedLocation; + + /* + * The recovery Azure virtual network ARM id. + */ + @JsonProperty(value = "recoveryAzureNetworkId") + private String recoveryAzureNetworkId; + + /* + * The recovery subnet name. + */ + @JsonProperty(value = "recoverySubnetName") + private String recoverySubnetName; + + /* + * The virtual machine scale set Id. + */ + @JsonProperty(value = "recoveryVirtualMachineScaleSetId") + private String recoveryVirtualMachineScaleSetId; + + /* + * The recovery capacity reservation group Id. + */ + @JsonProperty(value = "recoveryCapacityReservationGroupId") + private String recoveryCapacityReservationGroupId; + + /** Creates an instance of A2AEnableProtectionInput class. */ + public A2AEnableProtectionInput() { + } + + /** + * Get the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Set the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @param fabricObjectId the fabricObjectId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withFabricObjectId(String fabricObjectId) { + this.fabricObjectId = fabricObjectId; + return this; + } + + /** + * Get the recoveryContainerId property: The recovery container Id. + * + * @return the recoveryContainerId value. + */ + public String recoveryContainerId() { + return this.recoveryContainerId; + } + + /** + * Set the recoveryContainerId property: The recovery container Id. + * + * @param recoveryContainerId the recoveryContainerId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryContainerId(String recoveryContainerId) { + this.recoveryContainerId = recoveryContainerId; + return this; + } + + /** + * Get the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @return the recoveryResourceGroupId value. + */ + public String recoveryResourceGroupId() { + return this.recoveryResourceGroupId; + } + + /** + * Set the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @param recoveryResourceGroupId the recoveryResourceGroupId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Get the recoveryCloudServiceId property: The recovery cloud service Id. Valid for V1 scenarios. + * + * @return the recoveryCloudServiceId value. + */ + public String recoveryCloudServiceId() { + return this.recoveryCloudServiceId; + } + + /** + * Set the recoveryCloudServiceId property: The recovery cloud service Id. Valid for V1 scenarios. + * + * @param recoveryCloudServiceId the recoveryCloudServiceId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryCloudServiceId(String recoveryCloudServiceId) { + this.recoveryCloudServiceId = recoveryCloudServiceId; + return this; + } + + /** + * Get the recoveryAvailabilitySetId property: The recovery availability set Id. + * + * @return the recoveryAvailabilitySetId value. + */ + public String recoveryAvailabilitySetId() { + return this.recoveryAvailabilitySetId; + } + + /** + * Set the recoveryAvailabilitySetId property: The recovery availability set Id. + * + * @param recoveryAvailabilitySetId the recoveryAvailabilitySetId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryAvailabilitySetId(String recoveryAvailabilitySetId) { + this.recoveryAvailabilitySetId = recoveryAvailabilitySetId; + return this; + } + + /** + * Get the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. + * + * @return the recoveryProximityPlacementGroupId value. + */ + public String recoveryProximityPlacementGroupId() { + return this.recoveryProximityPlacementGroupId; + } + + /** + * Set the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. + * + * @param recoveryProximityPlacementGroupId the recoveryProximityPlacementGroupId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryProximityPlacementGroupId(String recoveryProximityPlacementGroupId) { + this.recoveryProximityPlacementGroupId = recoveryProximityPlacementGroupId; + return this; + } + + /** + * Get the vmDisks property: The list of vm disk details. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of vm disk details. + * + * @param vmDisks the vmDisks value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Get the vmManagedDisks property: The list of vm managed disk details. + * + * @return the vmManagedDisks value. + */ + public List vmManagedDisks() { + return this.vmManagedDisks; + } + + /** + * Set the vmManagedDisks property: The list of vm managed disk details. + * + * @param vmManagedDisks the vmManagedDisks value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withVmManagedDisks(List vmManagedDisks) { + this.vmManagedDisks = vmManagedDisks; + return this; + } + + /** + * Get the multiVmGroupName property: The multi vm group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Set the multiVmGroupName property: The multi vm group name. + * + * @param multiVmGroupName the multiVmGroupName value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withMultiVmGroupName(String multiVmGroupName) { + this.multiVmGroupName = multiVmGroupName; + return this; + } + + /** + * Get the multiVmGroupId property: The multi vm group id. + * + * @return the multiVmGroupId value. + */ + public String multiVmGroupId() { + return this.multiVmGroupId; + } + + /** + * Set the multiVmGroupId property: The multi vm group id. + * + * @param multiVmGroupId the multiVmGroupId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withMultiVmGroupId(String multiVmGroupId) { + this.multiVmGroupId = multiVmGroupId; + return this; + } + + /** + * Get the recoveryBootDiagStorageAccountId property: The boot diagnostic storage account. + * + * @return the recoveryBootDiagStorageAccountId value. + */ + public String recoveryBootDiagStorageAccountId() { + return this.recoveryBootDiagStorageAccountId; + } + + /** + * Set the recoveryBootDiagStorageAccountId property: The boot diagnostic storage account. + * + * @param recoveryBootDiagStorageAccountId the recoveryBootDiagStorageAccountId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryBootDiagStorageAccountId(String recoveryBootDiagStorageAccountId) { + this.recoveryBootDiagStorageAccountId = recoveryBootDiagStorageAccountId; + return this; + } + + /** + * Get the diskEncryptionInfo property: The recovery disk encryption information (for two pass flows). + * + * @return the diskEncryptionInfo value. + */ + public DiskEncryptionInfo diskEncryptionInfo() { + return this.diskEncryptionInfo; + } + + /** + * Set the diskEncryptionInfo property: The recovery disk encryption information (for two pass flows). + * + * @param diskEncryptionInfo the diskEncryptionInfo value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withDiskEncryptionInfo(DiskEncryptionInfo diskEncryptionInfo) { + this.diskEncryptionInfo = diskEncryptionInfo; + return this; + } + + /** + * Get the recoveryAvailabilityZone property: The recovery availability zone. + * + * @return the recoveryAvailabilityZone value. + */ + public String recoveryAvailabilityZone() { + return this.recoveryAvailabilityZone; + } + + /** + * Set the recoveryAvailabilityZone property: The recovery availability zone. + * + * @param recoveryAvailabilityZone the recoveryAvailabilityZone value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryAvailabilityZone(String recoveryAvailabilityZone) { + this.recoveryAvailabilityZone = recoveryAvailabilityZone; + return this; + } + + /** + * Get the recoveryExtendedLocation property: The recovery extended location. + * + * @return the recoveryExtendedLocation value. + */ + public ExtendedLocation recoveryExtendedLocation() { + return this.recoveryExtendedLocation; + } + + /** + * Set the recoveryExtendedLocation property: The recovery extended location. + * + * @param recoveryExtendedLocation the recoveryExtendedLocation value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryExtendedLocation(ExtendedLocation recoveryExtendedLocation) { + this.recoveryExtendedLocation = recoveryExtendedLocation; + return this; + } + + /** + * Get the recoveryAzureNetworkId property: The recovery Azure virtual network ARM id. + * + * @return the recoveryAzureNetworkId value. + */ + public String recoveryAzureNetworkId() { + return this.recoveryAzureNetworkId; + } + + /** + * Set the recoveryAzureNetworkId property: The recovery Azure virtual network ARM id. + * + * @param recoveryAzureNetworkId the recoveryAzureNetworkId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryAzureNetworkId(String recoveryAzureNetworkId) { + this.recoveryAzureNetworkId = recoveryAzureNetworkId; + return this; + } + + /** + * Get the recoverySubnetName property: The recovery subnet name. + * + * @return the recoverySubnetName value. + */ + public String recoverySubnetName() { + return this.recoverySubnetName; + } + + /** + * Set the recoverySubnetName property: The recovery subnet name. + * + * @param recoverySubnetName the recoverySubnetName value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoverySubnetName(String recoverySubnetName) { + this.recoverySubnetName = recoverySubnetName; + return this; + } + + /** + * Get the recoveryVirtualMachineScaleSetId property: The virtual machine scale set Id. + * + * @return the recoveryVirtualMachineScaleSetId value. + */ + public String recoveryVirtualMachineScaleSetId() { + return this.recoveryVirtualMachineScaleSetId; + } + + /** + * Set the recoveryVirtualMachineScaleSetId property: The virtual machine scale set Id. + * + * @param recoveryVirtualMachineScaleSetId the recoveryVirtualMachineScaleSetId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryVirtualMachineScaleSetId(String recoveryVirtualMachineScaleSetId) { + this.recoveryVirtualMachineScaleSetId = recoveryVirtualMachineScaleSetId; + return this; + } + + /** + * Get the recoveryCapacityReservationGroupId property: The recovery capacity reservation group Id. + * + * @return the recoveryCapacityReservationGroupId value. + */ + public String recoveryCapacityReservationGroupId() { + return this.recoveryCapacityReservationGroupId; + } + + /** + * Set the recoveryCapacityReservationGroupId property: The recovery capacity reservation group Id. + * + * @param recoveryCapacityReservationGroupId the recoveryCapacityReservationGroupId value to set. + * @return the A2AEnableProtectionInput object itself. + */ + public A2AEnableProtectionInput withRecoveryCapacityReservationGroupId(String recoveryCapacityReservationGroupId) { + this.recoveryCapacityReservationGroupId = recoveryCapacityReservationGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (fabricObjectId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fabricObjectId in model A2AEnableProtectionInput")); + } + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + if (vmManagedDisks() != null) { + vmManagedDisks().forEach(e -> e.validate()); + } + if (diskEncryptionInfo() != null) { + diskEncryptionInfo().validate(); + } + if (recoveryExtendedLocation() != null) { + recoveryExtendedLocation().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(A2AEnableProtectionInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEventDetails.java new file mode 100644 index 000000000000..527962e4af23 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEventDetails.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Model class for event details of a A2A event. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AEventDetails extends EventProviderSpecificDetails { + /* + * The protected item arm name. + */ + @JsonProperty(value = "protectedItemName") + private String protectedItemName; + + /* + * The azure vm arm id. + */ + @JsonProperty(value = "fabricObjectId") + private String fabricObjectId; + + /* + * Fabric arm name. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /* + * The fabric location. + */ + @JsonProperty(value = "fabricLocation") + private String fabricLocation; + + /* + * Remote fabric arm name. + */ + @JsonProperty(value = "remoteFabricName") + private String remoteFabricName; + + /* + * Remote fabric location. + */ + @JsonProperty(value = "remoteFabricLocation") + private String remoteFabricLocation; + + /** Creates an instance of A2AEventDetails class. */ + public A2AEventDetails() { + } + + /** + * Get the protectedItemName property: The protected item arm name. + * + * @return the protectedItemName value. + */ + public String protectedItemName() { + return this.protectedItemName; + } + + /** + * Set the protectedItemName property: The protected item arm name. + * + * @param protectedItemName the protectedItemName value to set. + * @return the A2AEventDetails object itself. + */ + public A2AEventDetails withProtectedItemName(String protectedItemName) { + this.protectedItemName = protectedItemName; + return this; + } + + /** + * Get the fabricObjectId property: The azure vm arm id. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Set the fabricObjectId property: The azure vm arm id. + * + * @param fabricObjectId the fabricObjectId value to set. + * @return the A2AEventDetails object itself. + */ + public A2AEventDetails withFabricObjectId(String fabricObjectId) { + this.fabricObjectId = fabricObjectId; + return this; + } + + /** + * Get the fabricName property: Fabric arm name. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set the fabricName property: Fabric arm name. + * + * @param fabricName the fabricName value to set. + * @return the A2AEventDetails object itself. + */ + public A2AEventDetails withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get the fabricLocation property: The fabric location. + * + * @return the fabricLocation value. + */ + public String fabricLocation() { + return this.fabricLocation; + } + + /** + * Set the fabricLocation property: The fabric location. + * + * @param fabricLocation the fabricLocation value to set. + * @return the A2AEventDetails object itself. + */ + public A2AEventDetails withFabricLocation(String fabricLocation) { + this.fabricLocation = fabricLocation; + return this; + } + + /** + * Get the remoteFabricName property: Remote fabric arm name. + * + * @return the remoteFabricName value. + */ + public String remoteFabricName() { + return this.remoteFabricName; + } + + /** + * Set the remoteFabricName property: Remote fabric arm name. + * + * @param remoteFabricName the remoteFabricName value to set. + * @return the A2AEventDetails object itself. + */ + public A2AEventDetails withRemoteFabricName(String remoteFabricName) { + this.remoteFabricName = remoteFabricName; + return this; + } + + /** + * Get the remoteFabricLocation property: Remote fabric location. + * + * @return the remoteFabricLocation value. + */ + public String remoteFabricLocation() { + return this.remoteFabricLocation; + } + + /** + * Set the remoteFabricLocation property: Remote fabric location. + * + * @param remoteFabricLocation the remoteFabricLocation value to set. + * @return the A2AEventDetails object itself. + */ + public A2AEventDetails withRemoteFabricLocation(String remoteFabricLocation) { + this.remoteFabricLocation = remoteFabricLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AExtendedLocationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AExtendedLocationDetails.java new file mode 100644 index 000000000000..2f8b3350141e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AExtendedLocationDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExtendedLocation details data. */ +@Fluent +public final class A2AExtendedLocationDetails { + /* + * The primary ExtendedLocation. + */ + @JsonProperty(value = "primaryExtendedLocation") + private ExtendedLocation primaryExtendedLocation; + + /* + * The recovery ExtendedLocation. + */ + @JsonProperty(value = "recoveryExtendedLocation") + private ExtendedLocation recoveryExtendedLocation; + + /** Creates an instance of A2AExtendedLocationDetails class. */ + public A2AExtendedLocationDetails() { + } + + /** + * Get the primaryExtendedLocation property: The primary ExtendedLocation. + * + * @return the primaryExtendedLocation value. + */ + public ExtendedLocation primaryExtendedLocation() { + return this.primaryExtendedLocation; + } + + /** + * Set the primaryExtendedLocation property: The primary ExtendedLocation. + * + * @param primaryExtendedLocation the primaryExtendedLocation value to set. + * @return the A2AExtendedLocationDetails object itself. + */ + public A2AExtendedLocationDetails withPrimaryExtendedLocation(ExtendedLocation primaryExtendedLocation) { + this.primaryExtendedLocation = primaryExtendedLocation; + return this; + } + + /** + * Get the recoveryExtendedLocation property: The recovery ExtendedLocation. + * + * @return the recoveryExtendedLocation value. + */ + public ExtendedLocation recoveryExtendedLocation() { + return this.recoveryExtendedLocation; + } + + /** + * Set the recoveryExtendedLocation property: The recovery ExtendedLocation. + * + * @param recoveryExtendedLocation the recoveryExtendedLocation value to set. + * @return the A2AExtendedLocationDetails object itself. + */ + public A2AExtendedLocationDetails withRecoveryExtendedLocation(ExtendedLocation recoveryExtendedLocation) { + this.recoveryExtendedLocation = recoveryExtendedLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (primaryExtendedLocation() != null) { + primaryExtendedLocation().validate(); + } + if (recoveryExtendedLocation() != null) { + recoveryExtendedLocation().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyCreationInput.java new file mode 100644 index 000000000000..22e78fc7ada6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyCreationInput.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.recoveryservicessiterecovery.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; + +/** A2A Policy creation input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2APolicyCreationInput extends PolicyProviderSpecificInput { + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistory") + private Integer recoveryPointHistory; + + /* + * The crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /* + * The app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. + */ + @JsonProperty(value = "multiVmSyncStatus", required = true) + private SetMultiVmSyncStatus multiVmSyncStatus; + + /** Creates an instance of A2APolicyCreationInput class. */ + public A2APolicyCreationInput() { + } + + /** + * Get the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @return the recoveryPointHistory value. + */ + public Integer recoveryPointHistory() { + return this.recoveryPointHistory; + } + + /** + * Set the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @param recoveryPointHistory the recoveryPointHistory value to set. + * @return the A2APolicyCreationInput object itself. + */ + public A2APolicyCreationInput withRecoveryPointHistory(Integer recoveryPointHistory) { + this.recoveryPointHistory = recoveryPointHistory; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the A2APolicyCreationInput object itself. + */ + public A2APolicyCreationInput withCrashConsistentFrequencyInMinutes(Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the A2APolicyCreationInput object itself. + */ + public A2APolicyCreationInput withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. Value should be + * 'Enabled' or 'Disabled'. + * + * @return the multiVmSyncStatus value. + */ + public SetMultiVmSyncStatus multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. Value should be + * 'Enabled' or 'Disabled'. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the A2APolicyCreationInput object itself. + */ + public A2APolicyCreationInput withMultiVmSyncStatus(SetMultiVmSyncStatus multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (multiVmSyncStatus() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property multiVmSyncStatus in model A2APolicyCreationInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(A2APolicyCreationInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyDetails.java new file mode 100644 index 000000000000..4d1e474894a4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyDetails.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A specific policy details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2APolicyDetails extends PolicyProviderSpecificDetails { + /* + * The recovery point threshold in minutes. + */ + @JsonProperty(value = "recoveryPointThresholdInMinutes") + private Integer recoveryPointThresholdInMinutes; + + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistory") + private Integer recoveryPointHistory; + + /* + * The app consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. + */ + @JsonProperty(value = "multiVmSyncStatus") + private String multiVmSyncStatus; + + /* + * The crash consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /** Creates an instance of A2APolicyDetails class. */ + public A2APolicyDetails() { + } + + /** + * Get the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @return the recoveryPointThresholdInMinutes value. + */ + public Integer recoveryPointThresholdInMinutes() { + return this.recoveryPointThresholdInMinutes; + } + + /** + * Set the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @param recoveryPointThresholdInMinutes the recoveryPointThresholdInMinutes value to set. + * @return the A2APolicyDetails object itself. + */ + public A2APolicyDetails withRecoveryPointThresholdInMinutes(Integer recoveryPointThresholdInMinutes) { + this.recoveryPointThresholdInMinutes = recoveryPointThresholdInMinutes; + return this; + } + + /** + * Get the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @return the recoveryPointHistory value. + */ + public Integer recoveryPointHistory() { + return this.recoveryPointHistory; + } + + /** + * Set the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @param recoveryPointHistory the recoveryPointHistory value to set. + * @return the A2APolicyDetails object itself. + */ + public A2APolicyDetails withRecoveryPointHistory(Integer recoveryPointHistory) { + this.recoveryPointHistory = recoveryPointHistory; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the A2APolicyDetails object itself. + */ + public A2APolicyDetails withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. + * + * @return the multiVmSyncStatus value. + */ + public String multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the A2APolicyDetails object itself. + */ + public A2APolicyDetails withMultiVmSyncStatus(String multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the A2APolicyDetails object itself. + */ + public A2APolicyDetails withCrashConsistentFrequencyInMinutes(Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedDiskDetails.java new file mode 100644 index 000000000000..8dec56c0a8ae --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedDiskDetails.java @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A2A protected disk details. */ +@Fluent +public final class A2AProtectedDiskDetails { + /* + * The disk uri. + */ + @JsonProperty(value = "diskUri") + private String diskUri; + + /* + * The recovery disk storage account. + */ + @JsonProperty(value = "recoveryAzureStorageAccountId") + private String recoveryAzureStorageAccountId; + + /* + * The primary disk storage account. + */ + @JsonProperty(value = "primaryDiskAzureStorageAccountId") + private String primaryDiskAzureStorageAccountId; + + /* + * Recovery disk uri. + */ + @JsonProperty(value = "recoveryDiskUri") + private String recoveryDiskUri; + + /* + * The disk name. + */ + @JsonProperty(value = "diskName") + private String diskName; + + /* + * The disk capacity in bytes. + */ + @JsonProperty(value = "diskCapacityInBytes") + private Long diskCapacityInBytes; + + /* + * The primary staging storage account. + */ + @JsonProperty(value = "primaryStagingAzureStorageAccountId") + private String primaryStagingAzureStorageAccountId; + + /* + * The type of disk. + */ + @JsonProperty(value = "diskType") + private String diskType; + + /* + * A value indicating whether resync is required for this disk. + */ + @JsonProperty(value = "resyncRequired") + private Boolean resyncRequired; + + /* + * The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + */ + @JsonProperty(value = "monitoringPercentageCompletion") + private Integer monitoringPercentageCompletion; + + /* + * The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + */ + @JsonProperty(value = "monitoringJobType") + private String monitoringJobType; + + /* + * The data pending for replication in MB at staging account. + */ + @JsonProperty(value = "dataPendingInStagingStorageAccountInMB") + private Double dataPendingInStagingStorageAccountInMB; + + /* + * The data pending at source virtual machine in MB. + */ + @JsonProperty(value = "dataPendingAtSourceAgentInMB") + private Double dataPendingAtSourceAgentInMB; + + /* + * The disk state. + */ + @JsonProperty(value = "diskState") + private String diskState; + + /* + * The disk level operations list. + */ + @JsonProperty(value = "allowedDiskLevelOperation") + private List allowedDiskLevelOperation; + + /* + * A value indicating whether vm has encrypted os disk or not. + */ + @JsonProperty(value = "isDiskEncrypted") + private Boolean isDiskEncrypted; + + /* + * The secret URL / identifier (BEK). + */ + @JsonProperty(value = "secretIdentifier") + private String secretIdentifier; + + /* + * The KeyVault resource id for secret (BEK). + */ + @JsonProperty(value = "dekKeyVaultArmId") + private String dekKeyVaultArmId; + + /* + * A value indicating whether disk key got encrypted or not. + */ + @JsonProperty(value = "isDiskKeyEncrypted") + private Boolean isDiskKeyEncrypted; + + /* + * The key URL / identifier (KEK). + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * The KeyVault resource id for key (KEK). + */ + @JsonProperty(value = "kekKeyVaultArmId") + private String kekKeyVaultArmId; + + /* + * The failover name for the managed disk. + */ + @JsonProperty(value = "failoverDiskName") + private String failoverDiskName; + + /* + * The test failover name for the managed disk. + */ + @JsonProperty(value = "tfoDiskName") + private String tfoDiskName; + + /** Creates an instance of A2AProtectedDiskDetails class. */ + public A2AProtectedDiskDetails() { + } + + /** + * Get the diskUri property: The disk uri. + * + * @return the diskUri value. + */ + public String diskUri() { + return this.diskUri; + } + + /** + * Set the diskUri property: The disk uri. + * + * @param diskUri the diskUri value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withDiskUri(String diskUri) { + this.diskUri = diskUri; + return this; + } + + /** + * Get the recoveryAzureStorageAccountId property: The recovery disk storage account. + * + * @return the recoveryAzureStorageAccountId value. + */ + public String recoveryAzureStorageAccountId() { + return this.recoveryAzureStorageAccountId; + } + + /** + * Set the recoveryAzureStorageAccountId property: The recovery disk storage account. + * + * @param recoveryAzureStorageAccountId the recoveryAzureStorageAccountId value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withRecoveryAzureStorageAccountId(String recoveryAzureStorageAccountId) { + this.recoveryAzureStorageAccountId = recoveryAzureStorageAccountId; + return this; + } + + /** + * Get the primaryDiskAzureStorageAccountId property: The primary disk storage account. + * + * @return the primaryDiskAzureStorageAccountId value. + */ + public String primaryDiskAzureStorageAccountId() { + return this.primaryDiskAzureStorageAccountId; + } + + /** + * Set the primaryDiskAzureStorageAccountId property: The primary disk storage account. + * + * @param primaryDiskAzureStorageAccountId the primaryDiskAzureStorageAccountId value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withPrimaryDiskAzureStorageAccountId(String primaryDiskAzureStorageAccountId) { + this.primaryDiskAzureStorageAccountId = primaryDiskAzureStorageAccountId; + return this; + } + + /** + * Get the recoveryDiskUri property: Recovery disk uri. + * + * @return the recoveryDiskUri value. + */ + public String recoveryDiskUri() { + return this.recoveryDiskUri; + } + + /** + * Set the recoveryDiskUri property: Recovery disk uri. + * + * @param recoveryDiskUri the recoveryDiskUri value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withRecoveryDiskUri(String recoveryDiskUri) { + this.recoveryDiskUri = recoveryDiskUri; + return this; + } + + /** + * Get the diskName property: The disk name. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Set the diskName property: The disk name. + * + * @param diskName the diskName value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withDiskName(String diskName) { + this.diskName = diskName; + return this; + } + + /** + * Get the diskCapacityInBytes property: The disk capacity in bytes. + * + * @return the diskCapacityInBytes value. + */ + public Long diskCapacityInBytes() { + return this.diskCapacityInBytes; + } + + /** + * Set the diskCapacityInBytes property: The disk capacity in bytes. + * + * @param diskCapacityInBytes the diskCapacityInBytes value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withDiskCapacityInBytes(Long diskCapacityInBytes) { + this.diskCapacityInBytes = diskCapacityInBytes; + return this; + } + + /** + * Get the primaryStagingAzureStorageAccountId property: The primary staging storage account. + * + * @return the primaryStagingAzureStorageAccountId value. + */ + public String primaryStagingAzureStorageAccountId() { + return this.primaryStagingAzureStorageAccountId; + } + + /** + * Set the primaryStagingAzureStorageAccountId property: The primary staging storage account. + * + * @param primaryStagingAzureStorageAccountId the primaryStagingAzureStorageAccountId value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withPrimaryStagingAzureStorageAccountId(String primaryStagingAzureStorageAccountId) { + this.primaryStagingAzureStorageAccountId = primaryStagingAzureStorageAccountId; + return this; + } + + /** + * Get the diskType property: The type of disk. + * + * @return the diskType value. + */ + public String diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The type of disk. + * + * @param diskType the diskType value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withDiskType(String diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the resyncRequired property: A value indicating whether resync is required for this disk. + * + * @return the resyncRequired value. + */ + public Boolean resyncRequired() { + return this.resyncRequired; + } + + /** + * Set the resyncRequired property: A value indicating whether resync is required for this disk. + * + * @param resyncRequired the resyncRequired value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withResyncRequired(Boolean resyncRequired) { + this.resyncRequired = resyncRequired; + return this; + } + + /** + * Get the monitoringPercentageCompletion property: The percentage of the monitoring job. The type of the monitoring + * job is defined by MonitoringJobType property. + * + * @return the monitoringPercentageCompletion value. + */ + public Integer monitoringPercentageCompletion() { + return this.monitoringPercentageCompletion; + } + + /** + * Set the monitoringPercentageCompletion property: The percentage of the monitoring job. The type of the monitoring + * job is defined by MonitoringJobType property. + * + * @param monitoringPercentageCompletion the monitoringPercentageCompletion value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withMonitoringPercentageCompletion(Integer monitoringPercentageCompletion) { + this.monitoringPercentageCompletion = monitoringPercentageCompletion; + return this; + } + + /** + * Get the monitoringJobType property: The type of the monitoring job. The progress is contained in + * MonitoringPercentageCompletion property. + * + * @return the monitoringJobType value. + */ + public String monitoringJobType() { + return this.monitoringJobType; + } + + /** + * Set the monitoringJobType property: The type of the monitoring job. The progress is contained in + * MonitoringPercentageCompletion property. + * + * @param monitoringJobType the monitoringJobType value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withMonitoringJobType(String monitoringJobType) { + this.monitoringJobType = monitoringJobType; + return this; + } + + /** + * Get the dataPendingInStagingStorageAccountInMB property: The data pending for replication in MB at staging + * account. + * + * @return the dataPendingInStagingStorageAccountInMB value. + */ + public Double dataPendingInStagingStorageAccountInMB() { + return this.dataPendingInStagingStorageAccountInMB; + } + + /** + * Set the dataPendingInStagingStorageAccountInMB property: The data pending for replication in MB at staging + * account. + * + * @param dataPendingInStagingStorageAccountInMB the dataPendingInStagingStorageAccountInMB value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withDataPendingInStagingStorageAccountInMB( + Double dataPendingInStagingStorageAccountInMB) { + this.dataPendingInStagingStorageAccountInMB = dataPendingInStagingStorageAccountInMB; + return this; + } + + /** + * Get the dataPendingAtSourceAgentInMB property: The data pending at source virtual machine in MB. + * + * @return the dataPendingAtSourceAgentInMB value. + */ + public Double dataPendingAtSourceAgentInMB() { + return this.dataPendingAtSourceAgentInMB; + } + + /** + * Set the dataPendingAtSourceAgentInMB property: The data pending at source virtual machine in MB. + * + * @param dataPendingAtSourceAgentInMB the dataPendingAtSourceAgentInMB value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withDataPendingAtSourceAgentInMB(Double dataPendingAtSourceAgentInMB) { + this.dataPendingAtSourceAgentInMB = dataPendingAtSourceAgentInMB; + return this; + } + + /** + * Get the diskState property: The disk state. + * + * @return the diskState value. + */ + public String diskState() { + return this.diskState; + } + + /** + * Set the diskState property: The disk state. + * + * @param diskState the diskState value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withDiskState(String diskState) { + this.diskState = diskState; + return this; + } + + /** + * Get the allowedDiskLevelOperation property: The disk level operations list. + * + * @return the allowedDiskLevelOperation value. + */ + public List allowedDiskLevelOperation() { + return this.allowedDiskLevelOperation; + } + + /** + * Set the allowedDiskLevelOperation property: The disk level operations list. + * + * @param allowedDiskLevelOperation the allowedDiskLevelOperation value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withAllowedDiskLevelOperation(List allowedDiskLevelOperation) { + this.allowedDiskLevelOperation = allowedDiskLevelOperation; + return this; + } + + /** + * Get the isDiskEncrypted property: A value indicating whether vm has encrypted os disk or not. + * + * @return the isDiskEncrypted value. + */ + public Boolean isDiskEncrypted() { + return this.isDiskEncrypted; + } + + /** + * Set the isDiskEncrypted property: A value indicating whether vm has encrypted os disk or not. + * + * @param isDiskEncrypted the isDiskEncrypted value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withIsDiskEncrypted(Boolean isDiskEncrypted) { + this.isDiskEncrypted = isDiskEncrypted; + return this; + } + + /** + * Get the secretIdentifier property: The secret URL / identifier (BEK). + * + * @return the secretIdentifier value. + */ + public String secretIdentifier() { + return this.secretIdentifier; + } + + /** + * Set the secretIdentifier property: The secret URL / identifier (BEK). + * + * @param secretIdentifier the secretIdentifier value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withSecretIdentifier(String secretIdentifier) { + this.secretIdentifier = secretIdentifier; + return this; + } + + /** + * Get the dekKeyVaultArmId property: The KeyVault resource id for secret (BEK). + * + * @return the dekKeyVaultArmId value. + */ + public String dekKeyVaultArmId() { + return this.dekKeyVaultArmId; + } + + /** + * Set the dekKeyVaultArmId property: The KeyVault resource id for secret (BEK). + * + * @param dekKeyVaultArmId the dekKeyVaultArmId value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withDekKeyVaultArmId(String dekKeyVaultArmId) { + this.dekKeyVaultArmId = dekKeyVaultArmId; + return this; + } + + /** + * Get the isDiskKeyEncrypted property: A value indicating whether disk key got encrypted or not. + * + * @return the isDiskKeyEncrypted value. + */ + public Boolean isDiskKeyEncrypted() { + return this.isDiskKeyEncrypted; + } + + /** + * Set the isDiskKeyEncrypted property: A value indicating whether disk key got encrypted or not. + * + * @param isDiskKeyEncrypted the isDiskKeyEncrypted value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withIsDiskKeyEncrypted(Boolean isDiskKeyEncrypted) { + this.isDiskKeyEncrypted = isDiskKeyEncrypted; + return this; + } + + /** + * Get the keyIdentifier property: The key URL / identifier (KEK). + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: The key URL / identifier (KEK). + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the kekKeyVaultArmId property: The KeyVault resource id for key (KEK). + * + * @return the kekKeyVaultArmId value. + */ + public String kekKeyVaultArmId() { + return this.kekKeyVaultArmId; + } + + /** + * Set the kekKeyVaultArmId property: The KeyVault resource id for key (KEK). + * + * @param kekKeyVaultArmId the kekKeyVaultArmId value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withKekKeyVaultArmId(String kekKeyVaultArmId) { + this.kekKeyVaultArmId = kekKeyVaultArmId; + return this; + } + + /** + * Get the failoverDiskName property: The failover name for the managed disk. + * + * @return the failoverDiskName value. + */ + public String failoverDiskName() { + return this.failoverDiskName; + } + + /** + * Set the failoverDiskName property: The failover name for the managed disk. + * + * @param failoverDiskName the failoverDiskName value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withFailoverDiskName(String failoverDiskName) { + this.failoverDiskName = failoverDiskName; + return this; + } + + /** + * Get the tfoDiskName property: The test failover name for the managed disk. + * + * @return the tfoDiskName value. + */ + public String tfoDiskName() { + return this.tfoDiskName; + } + + /** + * Set the tfoDiskName property: The test failover name for the managed disk. + * + * @param tfoDiskName the tfoDiskName value to set. + * @return the A2AProtectedDiskDetails object itself. + */ + public A2AProtectedDiskDetails withTfoDiskName(String tfoDiskName) { + this.tfoDiskName = tfoDiskName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedManagedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedManagedDiskDetails.java new file mode 100644 index 000000000000..aee6111ce04b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedManagedDiskDetails.java @@ -0,0 +1,766 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A2A protected managed disk details. */ +@Fluent +public final class A2AProtectedManagedDiskDetails { + /* + * The managed disk Arm id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The recovery disk resource group Arm Id. + */ + @JsonProperty(value = "recoveryResourceGroupId") + private String recoveryResourceGroupId; + + /* + * Recovery target disk Arm Id. + */ + @JsonProperty(value = "recoveryTargetDiskId") + private String recoveryTargetDiskId; + + /* + * Recovery replica disk Arm Id. + */ + @JsonProperty(value = "recoveryReplicaDiskId") + private String recoveryReplicaDiskId; + + /* + * Recovery original target disk Arm Id. + */ + @JsonProperty(value = "recoveryOrignalTargetDiskId") + private String recoveryOrignalTargetDiskId; + + /* + * The replica disk type. Its an optional value and will be same as source disk type if not user provided. + */ + @JsonProperty(value = "recoveryReplicaDiskAccountType") + private String recoveryReplicaDiskAccountType; + + /* + * The target disk type after failover. Its an optional value and will be same as source disk type if not user + * provided. + */ + @JsonProperty(value = "recoveryTargetDiskAccountType") + private String recoveryTargetDiskAccountType; + + /* + * The recovery disk encryption set Id. + */ + @JsonProperty(value = "recoveryDiskEncryptionSetId") + private String recoveryDiskEncryptionSetId; + + /* + * The primary disk encryption set Id. + */ + @JsonProperty(value = "primaryDiskEncryptionSetId") + private String primaryDiskEncryptionSetId; + + /* + * The disk name. + */ + @JsonProperty(value = "diskName") + private String diskName; + + /* + * The disk capacity in bytes. + */ + @JsonProperty(value = "diskCapacityInBytes") + private Long diskCapacityInBytes; + + /* + * The primary staging storage account. + */ + @JsonProperty(value = "primaryStagingAzureStorageAccountId") + private String primaryStagingAzureStorageAccountId; + + /* + * The type of disk. + */ + @JsonProperty(value = "diskType") + private String diskType; + + /* + * A value indicating whether resync is required for this disk. + */ + @JsonProperty(value = "resyncRequired") + private Boolean resyncRequired; + + /* + * The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + */ + @JsonProperty(value = "monitoringPercentageCompletion") + private Integer monitoringPercentageCompletion; + + /* + * The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + */ + @JsonProperty(value = "monitoringJobType") + private String monitoringJobType; + + /* + * The data pending for replication in MB at staging account. + */ + @JsonProperty(value = "dataPendingInStagingStorageAccountInMB") + private Double dataPendingInStagingStorageAccountInMB; + + /* + * The data pending at source virtual machine in MB. + */ + @JsonProperty(value = "dataPendingAtSourceAgentInMB") + private Double dataPendingAtSourceAgentInMB; + + /* + * The disk state. + */ + @JsonProperty(value = "diskState") + private String diskState; + + /* + * The disk level operations list. + */ + @JsonProperty(value = "allowedDiskLevelOperation") + private List allowedDiskLevelOperation; + + /* + * A value indicating whether vm has encrypted os disk or not. + */ + @JsonProperty(value = "isDiskEncrypted") + private Boolean isDiskEncrypted; + + /* + * The secret URL / identifier (BEK). + */ + @JsonProperty(value = "secretIdentifier") + private String secretIdentifier; + + /* + * The KeyVault resource id for secret (BEK). + */ + @JsonProperty(value = "dekKeyVaultArmId") + private String dekKeyVaultArmId; + + /* + * A value indicating whether disk key got encrypted or not. + */ + @JsonProperty(value = "isDiskKeyEncrypted") + private Boolean isDiskKeyEncrypted; + + /* + * The key URL / identifier (KEK). + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * The KeyVault resource id for key (KEK). + */ + @JsonProperty(value = "kekKeyVaultArmId") + private String kekKeyVaultArmId; + + /* + * The failover name for the managed disk. + */ + @JsonProperty(value = "failoverDiskName") + private String failoverDiskName; + + /* + * The test failover name for the managed disk. + */ + @JsonProperty(value = "tfoDiskName") + private String tfoDiskName; + + /** Creates an instance of A2AProtectedManagedDiskDetails class. */ + public A2AProtectedManagedDiskDetails() { + } + + /** + * Get the diskId property: The managed disk Arm id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The managed disk Arm id. + * + * @param diskId the diskId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the recoveryResourceGroupId property: The recovery disk resource group Arm Id. + * + * @return the recoveryResourceGroupId value. + */ + public String recoveryResourceGroupId() { + return this.recoveryResourceGroupId; + } + + /** + * Set the recoveryResourceGroupId property: The recovery disk resource group Arm Id. + * + * @param recoveryResourceGroupId the recoveryResourceGroupId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Get the recoveryTargetDiskId property: Recovery target disk Arm Id. + * + * @return the recoveryTargetDiskId value. + */ + public String recoveryTargetDiskId() { + return this.recoveryTargetDiskId; + } + + /** + * Set the recoveryTargetDiskId property: Recovery target disk Arm Id. + * + * @param recoveryTargetDiskId the recoveryTargetDiskId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withRecoveryTargetDiskId(String recoveryTargetDiskId) { + this.recoveryTargetDiskId = recoveryTargetDiskId; + return this; + } + + /** + * Get the recoveryReplicaDiskId property: Recovery replica disk Arm Id. + * + * @return the recoveryReplicaDiskId value. + */ + public String recoveryReplicaDiskId() { + return this.recoveryReplicaDiskId; + } + + /** + * Set the recoveryReplicaDiskId property: Recovery replica disk Arm Id. + * + * @param recoveryReplicaDiskId the recoveryReplicaDiskId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withRecoveryReplicaDiskId(String recoveryReplicaDiskId) { + this.recoveryReplicaDiskId = recoveryReplicaDiskId; + return this; + } + + /** + * Get the recoveryOrignalTargetDiskId property: Recovery original target disk Arm Id. + * + * @return the recoveryOrignalTargetDiskId value. + */ + public String recoveryOrignalTargetDiskId() { + return this.recoveryOrignalTargetDiskId; + } + + /** + * Set the recoveryOrignalTargetDiskId property: Recovery original target disk Arm Id. + * + * @param recoveryOrignalTargetDiskId the recoveryOrignalTargetDiskId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withRecoveryOrignalTargetDiskId(String recoveryOrignalTargetDiskId) { + this.recoveryOrignalTargetDiskId = recoveryOrignalTargetDiskId; + return this; + } + + /** + * Get the recoveryReplicaDiskAccountType property: The replica disk type. Its an optional value and will be same as + * source disk type if not user provided. + * + * @return the recoveryReplicaDiskAccountType value. + */ + public String recoveryReplicaDiskAccountType() { + return this.recoveryReplicaDiskAccountType; + } + + /** + * Set the recoveryReplicaDiskAccountType property: The replica disk type. Its an optional value and will be same as + * source disk type if not user provided. + * + * @param recoveryReplicaDiskAccountType the recoveryReplicaDiskAccountType value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withRecoveryReplicaDiskAccountType(String recoveryReplicaDiskAccountType) { + this.recoveryReplicaDiskAccountType = recoveryReplicaDiskAccountType; + return this; + } + + /** + * Get the recoveryTargetDiskAccountType property: The target disk type after failover. Its an optional value and + * will be same as source disk type if not user provided. + * + * @return the recoveryTargetDiskAccountType value. + */ + public String recoveryTargetDiskAccountType() { + return this.recoveryTargetDiskAccountType; + } + + /** + * Set the recoveryTargetDiskAccountType property: The target disk type after failover. Its an optional value and + * will be same as source disk type if not user provided. + * + * @param recoveryTargetDiskAccountType the recoveryTargetDiskAccountType value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withRecoveryTargetDiskAccountType(String recoveryTargetDiskAccountType) { + this.recoveryTargetDiskAccountType = recoveryTargetDiskAccountType; + return this; + } + + /** + * Get the recoveryDiskEncryptionSetId property: The recovery disk encryption set Id. + * + * @return the recoveryDiskEncryptionSetId value. + */ + public String recoveryDiskEncryptionSetId() { + return this.recoveryDiskEncryptionSetId; + } + + /** + * Set the recoveryDiskEncryptionSetId property: The recovery disk encryption set Id. + * + * @param recoveryDiskEncryptionSetId the recoveryDiskEncryptionSetId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withRecoveryDiskEncryptionSetId(String recoveryDiskEncryptionSetId) { + this.recoveryDiskEncryptionSetId = recoveryDiskEncryptionSetId; + return this; + } + + /** + * Get the primaryDiskEncryptionSetId property: The primary disk encryption set Id. + * + * @return the primaryDiskEncryptionSetId value. + */ + public String primaryDiskEncryptionSetId() { + return this.primaryDiskEncryptionSetId; + } + + /** + * Set the primaryDiskEncryptionSetId property: The primary disk encryption set Id. + * + * @param primaryDiskEncryptionSetId the primaryDiskEncryptionSetId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withPrimaryDiskEncryptionSetId(String primaryDiskEncryptionSetId) { + this.primaryDiskEncryptionSetId = primaryDiskEncryptionSetId; + return this; + } + + /** + * Get the diskName property: The disk name. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Set the diskName property: The disk name. + * + * @param diskName the diskName value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withDiskName(String diskName) { + this.diskName = diskName; + return this; + } + + /** + * Get the diskCapacityInBytes property: The disk capacity in bytes. + * + * @return the diskCapacityInBytes value. + */ + public Long diskCapacityInBytes() { + return this.diskCapacityInBytes; + } + + /** + * Set the diskCapacityInBytes property: The disk capacity in bytes. + * + * @param diskCapacityInBytes the diskCapacityInBytes value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withDiskCapacityInBytes(Long diskCapacityInBytes) { + this.diskCapacityInBytes = diskCapacityInBytes; + return this; + } + + /** + * Get the primaryStagingAzureStorageAccountId property: The primary staging storage account. + * + * @return the primaryStagingAzureStorageAccountId value. + */ + public String primaryStagingAzureStorageAccountId() { + return this.primaryStagingAzureStorageAccountId; + } + + /** + * Set the primaryStagingAzureStorageAccountId property: The primary staging storage account. + * + * @param primaryStagingAzureStorageAccountId the primaryStagingAzureStorageAccountId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withPrimaryStagingAzureStorageAccountId( + String primaryStagingAzureStorageAccountId) { + this.primaryStagingAzureStorageAccountId = primaryStagingAzureStorageAccountId; + return this; + } + + /** + * Get the diskType property: The type of disk. + * + * @return the diskType value. + */ + public String diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The type of disk. + * + * @param diskType the diskType value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withDiskType(String diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the resyncRequired property: A value indicating whether resync is required for this disk. + * + * @return the resyncRequired value. + */ + public Boolean resyncRequired() { + return this.resyncRequired; + } + + /** + * Set the resyncRequired property: A value indicating whether resync is required for this disk. + * + * @param resyncRequired the resyncRequired value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withResyncRequired(Boolean resyncRequired) { + this.resyncRequired = resyncRequired; + return this; + } + + /** + * Get the monitoringPercentageCompletion property: The percentage of the monitoring job. The type of the monitoring + * job is defined by MonitoringJobType property. + * + * @return the monitoringPercentageCompletion value. + */ + public Integer monitoringPercentageCompletion() { + return this.monitoringPercentageCompletion; + } + + /** + * Set the monitoringPercentageCompletion property: The percentage of the monitoring job. The type of the monitoring + * job is defined by MonitoringJobType property. + * + * @param monitoringPercentageCompletion the monitoringPercentageCompletion value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withMonitoringPercentageCompletion(Integer monitoringPercentageCompletion) { + this.monitoringPercentageCompletion = monitoringPercentageCompletion; + return this; + } + + /** + * Get the monitoringJobType property: The type of the monitoring job. The progress is contained in + * MonitoringPercentageCompletion property. + * + * @return the monitoringJobType value. + */ + public String monitoringJobType() { + return this.monitoringJobType; + } + + /** + * Set the monitoringJobType property: The type of the monitoring job. The progress is contained in + * MonitoringPercentageCompletion property. + * + * @param monitoringJobType the monitoringJobType value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withMonitoringJobType(String monitoringJobType) { + this.monitoringJobType = monitoringJobType; + return this; + } + + /** + * Get the dataPendingInStagingStorageAccountInMB property: The data pending for replication in MB at staging + * account. + * + * @return the dataPendingInStagingStorageAccountInMB value. + */ + public Double dataPendingInStagingStorageAccountInMB() { + return this.dataPendingInStagingStorageAccountInMB; + } + + /** + * Set the dataPendingInStagingStorageAccountInMB property: The data pending for replication in MB at staging + * account. + * + * @param dataPendingInStagingStorageAccountInMB the dataPendingInStagingStorageAccountInMB value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withDataPendingInStagingStorageAccountInMB( + Double dataPendingInStagingStorageAccountInMB) { + this.dataPendingInStagingStorageAccountInMB = dataPendingInStagingStorageAccountInMB; + return this; + } + + /** + * Get the dataPendingAtSourceAgentInMB property: The data pending at source virtual machine in MB. + * + * @return the dataPendingAtSourceAgentInMB value. + */ + public Double dataPendingAtSourceAgentInMB() { + return this.dataPendingAtSourceAgentInMB; + } + + /** + * Set the dataPendingAtSourceAgentInMB property: The data pending at source virtual machine in MB. + * + * @param dataPendingAtSourceAgentInMB the dataPendingAtSourceAgentInMB value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withDataPendingAtSourceAgentInMB(Double dataPendingAtSourceAgentInMB) { + this.dataPendingAtSourceAgentInMB = dataPendingAtSourceAgentInMB; + return this; + } + + /** + * Get the diskState property: The disk state. + * + * @return the diskState value. + */ + public String diskState() { + return this.diskState; + } + + /** + * Set the diskState property: The disk state. + * + * @param diskState the diskState value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withDiskState(String diskState) { + this.diskState = diskState; + return this; + } + + /** + * Get the allowedDiskLevelOperation property: The disk level operations list. + * + * @return the allowedDiskLevelOperation value. + */ + public List allowedDiskLevelOperation() { + return this.allowedDiskLevelOperation; + } + + /** + * Set the allowedDiskLevelOperation property: The disk level operations list. + * + * @param allowedDiskLevelOperation the allowedDiskLevelOperation value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withAllowedDiskLevelOperation(List allowedDiskLevelOperation) { + this.allowedDiskLevelOperation = allowedDiskLevelOperation; + return this; + } + + /** + * Get the isDiskEncrypted property: A value indicating whether vm has encrypted os disk or not. + * + * @return the isDiskEncrypted value. + */ + public Boolean isDiskEncrypted() { + return this.isDiskEncrypted; + } + + /** + * Set the isDiskEncrypted property: A value indicating whether vm has encrypted os disk or not. + * + * @param isDiskEncrypted the isDiskEncrypted value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withIsDiskEncrypted(Boolean isDiskEncrypted) { + this.isDiskEncrypted = isDiskEncrypted; + return this; + } + + /** + * Get the secretIdentifier property: The secret URL / identifier (BEK). + * + * @return the secretIdentifier value. + */ + public String secretIdentifier() { + return this.secretIdentifier; + } + + /** + * Set the secretIdentifier property: The secret URL / identifier (BEK). + * + * @param secretIdentifier the secretIdentifier value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withSecretIdentifier(String secretIdentifier) { + this.secretIdentifier = secretIdentifier; + return this; + } + + /** + * Get the dekKeyVaultArmId property: The KeyVault resource id for secret (BEK). + * + * @return the dekKeyVaultArmId value. + */ + public String dekKeyVaultArmId() { + return this.dekKeyVaultArmId; + } + + /** + * Set the dekKeyVaultArmId property: The KeyVault resource id for secret (BEK). + * + * @param dekKeyVaultArmId the dekKeyVaultArmId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withDekKeyVaultArmId(String dekKeyVaultArmId) { + this.dekKeyVaultArmId = dekKeyVaultArmId; + return this; + } + + /** + * Get the isDiskKeyEncrypted property: A value indicating whether disk key got encrypted or not. + * + * @return the isDiskKeyEncrypted value. + */ + public Boolean isDiskKeyEncrypted() { + return this.isDiskKeyEncrypted; + } + + /** + * Set the isDiskKeyEncrypted property: A value indicating whether disk key got encrypted or not. + * + * @param isDiskKeyEncrypted the isDiskKeyEncrypted value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withIsDiskKeyEncrypted(Boolean isDiskKeyEncrypted) { + this.isDiskKeyEncrypted = isDiskKeyEncrypted; + return this; + } + + /** + * Get the keyIdentifier property: The key URL / identifier (KEK). + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: The key URL / identifier (KEK). + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the kekKeyVaultArmId property: The KeyVault resource id for key (KEK). + * + * @return the kekKeyVaultArmId value. + */ + public String kekKeyVaultArmId() { + return this.kekKeyVaultArmId; + } + + /** + * Set the kekKeyVaultArmId property: The KeyVault resource id for key (KEK). + * + * @param kekKeyVaultArmId the kekKeyVaultArmId value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withKekKeyVaultArmId(String kekKeyVaultArmId) { + this.kekKeyVaultArmId = kekKeyVaultArmId; + return this; + } + + /** + * Get the failoverDiskName property: The failover name for the managed disk. + * + * @return the failoverDiskName value. + */ + public String failoverDiskName() { + return this.failoverDiskName; + } + + /** + * Set the failoverDiskName property: The failover name for the managed disk. + * + * @param failoverDiskName the failoverDiskName value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withFailoverDiskName(String failoverDiskName) { + this.failoverDiskName = failoverDiskName; + return this; + } + + /** + * Get the tfoDiskName property: The test failover name for the managed disk. + * + * @return the tfoDiskName value. + */ + public String tfoDiskName() { + return this.tfoDiskName; + } + + /** + * Set the tfoDiskName property: The test failover name for the managed disk. + * + * @param tfoDiskName the tfoDiskName value to set. + * @return the A2AProtectedManagedDiskDetails object itself. + */ + public A2AProtectedManagedDiskDetails withTfoDiskName(String tfoDiskName) { + this.tfoDiskName = tfoDiskName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionContainerMappingDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionContainerMappingDetails.java new file mode 100644 index 000000000000..fd952537c7a5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionContainerMappingDetails.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AProtectionContainerMappingDetails extends ProtectionContainerMappingProviderSpecificDetails { + /* + * A value indicating whether the auto update is enabled. + */ + @JsonProperty(value = "agentAutoUpdateStatus") + private AgentAutoUpdateStatus agentAutoUpdateStatus; + + /* + * The automation account arm id. + */ + @JsonProperty(value = "automationAccountArmId") + private String automationAccountArmId; + + /* + * A value indicating the type authentication to use for automation Account. + */ + @JsonProperty(value = "automationAccountAuthenticationType") + private AutomationAccountAuthenticationType automationAccountAuthenticationType; + + /* + * The schedule arm name. + */ + @JsonProperty(value = "scheduleName") + private String scheduleName; + + /* + * The job schedule arm name. + */ + @JsonProperty(value = "jobScheduleName") + private String jobScheduleName; + + /** Creates an instance of A2AProtectionContainerMappingDetails class. */ + public A2AProtectionContainerMappingDetails() { + } + + /** + * Get the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @return the agentAutoUpdateStatus value. + */ + public AgentAutoUpdateStatus agentAutoUpdateStatus() { + return this.agentAutoUpdateStatus; + } + + /** + * Set the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @param agentAutoUpdateStatus the agentAutoUpdateStatus value to set. + * @return the A2AProtectionContainerMappingDetails object itself. + */ + public A2AProtectionContainerMappingDetails withAgentAutoUpdateStatus(AgentAutoUpdateStatus agentAutoUpdateStatus) { + this.agentAutoUpdateStatus = agentAutoUpdateStatus; + return this; + } + + /** + * Get the automationAccountArmId property: The automation account arm id. + * + * @return the automationAccountArmId value. + */ + public String automationAccountArmId() { + return this.automationAccountArmId; + } + + /** + * Set the automationAccountArmId property: The automation account arm id. + * + * @param automationAccountArmId the automationAccountArmId value to set. + * @return the A2AProtectionContainerMappingDetails object itself. + */ + public A2AProtectionContainerMappingDetails withAutomationAccountArmId(String automationAccountArmId) { + this.automationAccountArmId = automationAccountArmId; + return this; + } + + /** + * Get the automationAccountAuthenticationType property: A value indicating the type authentication to use for + * automation Account. + * + * @return the automationAccountAuthenticationType value. + */ + public AutomationAccountAuthenticationType automationAccountAuthenticationType() { + return this.automationAccountAuthenticationType; + } + + /** + * Set the automationAccountAuthenticationType property: A value indicating the type authentication to use for + * automation Account. + * + * @param automationAccountAuthenticationType the automationAccountAuthenticationType value to set. + * @return the A2AProtectionContainerMappingDetails object itself. + */ + public A2AProtectionContainerMappingDetails withAutomationAccountAuthenticationType( + AutomationAccountAuthenticationType automationAccountAuthenticationType) { + this.automationAccountAuthenticationType = automationAccountAuthenticationType; + return this; + } + + /** + * Get the scheduleName property: The schedule arm name. + * + * @return the scheduleName value. + */ + public String scheduleName() { + return this.scheduleName; + } + + /** + * Set the scheduleName property: The schedule arm name. + * + * @param scheduleName the scheduleName value to set. + * @return the A2AProtectionContainerMappingDetails object itself. + */ + public A2AProtectionContainerMappingDetails withScheduleName(String scheduleName) { + this.scheduleName = scheduleName; + return this; + } + + /** + * Get the jobScheduleName property: The job schedule arm name. + * + * @return the jobScheduleName value. + */ + public String jobScheduleName() { + return this.jobScheduleName; + } + + /** + * Set the jobScheduleName property: The job schedule arm name. + * + * @param jobScheduleName the jobScheduleName value to set. + * @return the A2AProtectionContainerMappingDetails object itself. + */ + public A2AProtectionContainerMappingDetails withJobScheduleName(String jobScheduleName) { + this.jobScheduleName = jobScheduleName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentDiskInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentDiskInputDetails.java new file mode 100644 index 000000000000..2e3e9da638a7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentDiskInputDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM unmanaged disk input details. */ +@Fluent +public final class A2AProtectionIntentDiskInputDetails { + /* + * The disk Uri. + */ + @JsonProperty(value = "diskUri", required = true) + private String diskUri; + + /* + * The recovery VHD storage account input. + */ + @JsonProperty(value = "recoveryAzureStorageAccountCustomInput") + private StorageAccountCustomDetails recoveryAzureStorageAccountCustomInput; + + /* + * The primary staging storage account input. + */ + @JsonProperty(value = "primaryStagingStorageAccountCustomInput") + private StorageAccountCustomDetails primaryStagingStorageAccountCustomInput; + + /** Creates an instance of A2AProtectionIntentDiskInputDetails class. */ + public A2AProtectionIntentDiskInputDetails() { + } + + /** + * Get the diskUri property: The disk Uri. + * + * @return the diskUri value. + */ + public String diskUri() { + return this.diskUri; + } + + /** + * Set the diskUri property: The disk Uri. + * + * @param diskUri the diskUri value to set. + * @return the A2AProtectionIntentDiskInputDetails object itself. + */ + public A2AProtectionIntentDiskInputDetails withDiskUri(String diskUri) { + this.diskUri = diskUri; + return this; + } + + /** + * Get the recoveryAzureStorageAccountCustomInput property: The recovery VHD storage account input. + * + * @return the recoveryAzureStorageAccountCustomInput value. + */ + public StorageAccountCustomDetails recoveryAzureStorageAccountCustomInput() { + return this.recoveryAzureStorageAccountCustomInput; + } + + /** + * Set the recoveryAzureStorageAccountCustomInput property: The recovery VHD storage account input. + * + * @param recoveryAzureStorageAccountCustomInput the recoveryAzureStorageAccountCustomInput value to set. + * @return the A2AProtectionIntentDiskInputDetails object itself. + */ + public A2AProtectionIntentDiskInputDetails withRecoveryAzureStorageAccountCustomInput( + StorageAccountCustomDetails recoveryAzureStorageAccountCustomInput) { + this.recoveryAzureStorageAccountCustomInput = recoveryAzureStorageAccountCustomInput; + return this; + } + + /** + * Get the primaryStagingStorageAccountCustomInput property: The primary staging storage account input. + * + * @return the primaryStagingStorageAccountCustomInput value. + */ + public StorageAccountCustomDetails primaryStagingStorageAccountCustomInput() { + return this.primaryStagingStorageAccountCustomInput; + } + + /** + * Set the primaryStagingStorageAccountCustomInput property: The primary staging storage account input. + * + * @param primaryStagingStorageAccountCustomInput the primaryStagingStorageAccountCustomInput value to set. + * @return the A2AProtectionIntentDiskInputDetails object itself. + */ + public A2AProtectionIntentDiskInputDetails withPrimaryStagingStorageAccountCustomInput( + StorageAccountCustomDetails primaryStagingStorageAccountCustomInput) { + this.primaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskUri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property diskUri in model A2AProtectionIntentDiskInputDetails")); + } + if (recoveryAzureStorageAccountCustomInput() != null) { + recoveryAzureStorageAccountCustomInput().validate(); + } + if (primaryStagingStorageAccountCustomInput() != null) { + primaryStagingStorageAccountCustomInput().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(A2AProtectionIntentDiskInputDetails.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentManagedDiskInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentManagedDiskInputDetails.java new file mode 100644 index 000000000000..d566eb8c6a4d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentManagedDiskInputDetails.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM managed disk input details. */ +@Fluent +public final class A2AProtectionIntentManagedDiskInputDetails { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId", required = true) + private String diskId; + + /* + * The primary staging storage account input. + */ + @JsonProperty(value = "primaryStagingStorageAccountCustomInput") + private StorageAccountCustomDetails primaryStagingStorageAccountCustomInput; + + /* + * The recovery resource group input. + */ + @JsonProperty(value = "recoveryResourceGroupCustomInput") + private RecoveryResourceGroupCustomDetails recoveryResourceGroupCustomInput; + + /* + * The replica disk type. Its an optional value and will be same as source disk type if not user provided. + */ + @JsonProperty(value = "recoveryReplicaDiskAccountType") + private String recoveryReplicaDiskAccountType; + + /* + * The target disk type after failover. Its an optional value and will be same as source disk type if not user + * provided. + */ + @JsonProperty(value = "recoveryTargetDiskAccountType") + private String recoveryTargetDiskAccountType; + + /* + * The recovery disk encryption set Id. + */ + @JsonProperty(value = "recoveryDiskEncryptionSetId") + private String recoveryDiskEncryptionSetId; + + /* + * The recovery disk encryption information (for one / single pass flows). + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /** Creates an instance of A2AProtectionIntentManagedDiskInputDetails class. */ + public A2AProtectionIntentManagedDiskInputDetails() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk Id. + * + * @param diskId the diskId value to set. + * @return the A2AProtectionIntentManagedDiskInputDetails object itself. + */ + public A2AProtectionIntentManagedDiskInputDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the primaryStagingStorageAccountCustomInput property: The primary staging storage account input. + * + * @return the primaryStagingStorageAccountCustomInput value. + */ + public StorageAccountCustomDetails primaryStagingStorageAccountCustomInput() { + return this.primaryStagingStorageAccountCustomInput; + } + + /** + * Set the primaryStagingStorageAccountCustomInput property: The primary staging storage account input. + * + * @param primaryStagingStorageAccountCustomInput the primaryStagingStorageAccountCustomInput value to set. + * @return the A2AProtectionIntentManagedDiskInputDetails object itself. + */ + public A2AProtectionIntentManagedDiskInputDetails withPrimaryStagingStorageAccountCustomInput( + StorageAccountCustomDetails primaryStagingStorageAccountCustomInput) { + this.primaryStagingStorageAccountCustomInput = primaryStagingStorageAccountCustomInput; + return this; + } + + /** + * Get the recoveryResourceGroupCustomInput property: The recovery resource group input. + * + * @return the recoveryResourceGroupCustomInput value. + */ + public RecoveryResourceGroupCustomDetails recoveryResourceGroupCustomInput() { + return this.recoveryResourceGroupCustomInput; + } + + /** + * Set the recoveryResourceGroupCustomInput property: The recovery resource group input. + * + * @param recoveryResourceGroupCustomInput the recoveryResourceGroupCustomInput value to set. + * @return the A2AProtectionIntentManagedDiskInputDetails object itself. + */ + public A2AProtectionIntentManagedDiskInputDetails withRecoveryResourceGroupCustomInput( + RecoveryResourceGroupCustomDetails recoveryResourceGroupCustomInput) { + this.recoveryResourceGroupCustomInput = recoveryResourceGroupCustomInput; + return this; + } + + /** + * Get the recoveryReplicaDiskAccountType property: The replica disk type. Its an optional value and will be same as + * source disk type if not user provided. + * + * @return the recoveryReplicaDiskAccountType value. + */ + public String recoveryReplicaDiskAccountType() { + return this.recoveryReplicaDiskAccountType; + } + + /** + * Set the recoveryReplicaDiskAccountType property: The replica disk type. Its an optional value and will be same as + * source disk type if not user provided. + * + * @param recoveryReplicaDiskAccountType the recoveryReplicaDiskAccountType value to set. + * @return the A2AProtectionIntentManagedDiskInputDetails object itself. + */ + public A2AProtectionIntentManagedDiskInputDetails withRecoveryReplicaDiskAccountType( + String recoveryReplicaDiskAccountType) { + this.recoveryReplicaDiskAccountType = recoveryReplicaDiskAccountType; + return this; + } + + /** + * Get the recoveryTargetDiskAccountType property: The target disk type after failover. Its an optional value and + * will be same as source disk type if not user provided. + * + * @return the recoveryTargetDiskAccountType value. + */ + public String recoveryTargetDiskAccountType() { + return this.recoveryTargetDiskAccountType; + } + + /** + * Set the recoveryTargetDiskAccountType property: The target disk type after failover. Its an optional value and + * will be same as source disk type if not user provided. + * + * @param recoveryTargetDiskAccountType the recoveryTargetDiskAccountType value to set. + * @return the A2AProtectionIntentManagedDiskInputDetails object itself. + */ + public A2AProtectionIntentManagedDiskInputDetails withRecoveryTargetDiskAccountType( + String recoveryTargetDiskAccountType) { + this.recoveryTargetDiskAccountType = recoveryTargetDiskAccountType; + return this; + } + + /** + * Get the recoveryDiskEncryptionSetId property: The recovery disk encryption set Id. + * + * @return the recoveryDiskEncryptionSetId value. + */ + public String recoveryDiskEncryptionSetId() { + return this.recoveryDiskEncryptionSetId; + } + + /** + * Set the recoveryDiskEncryptionSetId property: The recovery disk encryption set Id. + * + * @param recoveryDiskEncryptionSetId the recoveryDiskEncryptionSetId value to set. + * @return the A2AProtectionIntentManagedDiskInputDetails object itself. + */ + public A2AProtectionIntentManagedDiskInputDetails withRecoveryDiskEncryptionSetId( + String recoveryDiskEncryptionSetId) { + this.recoveryDiskEncryptionSetId = recoveryDiskEncryptionSetId; + return this; + } + + /** + * Get the diskEncryptionInfo property: The recovery disk encryption information (for one / single pass flows). + * + * @return the diskEncryptionInfo value. + */ + public DiskEncryptionInfo diskEncryptionInfo() { + return this.diskEncryptionInfo; + } + + /** + * Set the diskEncryptionInfo property: The recovery disk encryption information (for one / single pass flows). + * + * @param diskEncryptionInfo the diskEncryptionInfo value to set. + * @return the A2AProtectionIntentManagedDiskInputDetails object itself. + */ + public A2AProtectionIntentManagedDiskInputDetails withDiskEncryptionInfo(DiskEncryptionInfo diskEncryptionInfo) { + this.diskEncryptionInfo = diskEncryptionInfo; + 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 A2AProtectionIntentManagedDiskInputDetails")); + } + if (primaryStagingStorageAccountCustomInput() != null) { + primaryStagingStorageAccountCustomInput().validate(); + } + if (recoveryResourceGroupCustomInput() != null) { + recoveryResourceGroupCustomInput().validate(); + } + if (diskEncryptionInfo() != null) { + diskEncryptionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(A2AProtectionIntentManagedDiskInputDetails.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARecoveryAvailabilityType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARecoveryAvailabilityType.java new file mode 100644 index 000000000000..77fb6a8d013d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARecoveryAvailabilityType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recovery availability type of the virtual machine. */ +public final class A2ARecoveryAvailabilityType extends ExpandableStringEnum { + /** Static value Single for A2ARecoveryAvailabilityType. */ + public static final A2ARecoveryAvailabilityType SINGLE = fromString("Single"); + + /** Static value AvailabilitySet for A2ARecoveryAvailabilityType. */ + public static final A2ARecoveryAvailabilityType AVAILABILITY_SET = fromString("AvailabilitySet"); + + /** Static value AvailabilityZone for A2ARecoveryAvailabilityType. */ + public static final A2ARecoveryAvailabilityType AVAILABILITY_ZONE = fromString("AvailabilityZone"); + + /** + * Creates or finds a A2ARecoveryAvailabilityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding A2ARecoveryAvailabilityType. + */ + @JsonCreator + public static A2ARecoveryAvailabilityType fromString(String name) { + return fromString(name, A2ARecoveryAvailabilityType.class); + } + + /** + * Gets known A2ARecoveryAvailabilityType values. + * + * @return known A2ARecoveryAvailabilityType values. + */ + public static Collection values() { + return values(A2ARecoveryAvailabilityType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARecoveryPointDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARecoveryPointDetails.java new file mode 100644 index 000000000000..f35c582dda27 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARecoveryPointDetails.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.recoveryservicessiterecovery.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; +import java.util.List; + +/** A2A provider specific recovery point details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2ARecoveryPointDetails extends ProviderSpecificRecoveryPointDetails { + /* + * A value indicating whether the recovery point is multi VM consistent. + */ + @JsonProperty(value = "recoveryPointSyncType") + private RecoveryPointSyncType recoveryPointSyncType; + + /* + * List of disk ids representing a recovery point. + */ + @JsonProperty(value = "disks") + private List disks; + + /** Creates an instance of A2ARecoveryPointDetails class. */ + public A2ARecoveryPointDetails() { + } + + /** + * Get the recoveryPointSyncType property: A value indicating whether the recovery point is multi VM consistent. + * + * @return the recoveryPointSyncType value. + */ + public RecoveryPointSyncType recoveryPointSyncType() { + return this.recoveryPointSyncType; + } + + /** + * Set the recoveryPointSyncType property: A value indicating whether the recovery point is multi VM consistent. + * + * @param recoveryPointSyncType the recoveryPointSyncType value to set. + * @return the A2ARecoveryPointDetails object itself. + */ + public A2ARecoveryPointDetails withRecoveryPointSyncType(RecoveryPointSyncType recoveryPointSyncType) { + this.recoveryPointSyncType = recoveryPointSyncType; + return this; + } + + /** + * Get the disks property: List of disk ids representing a recovery point. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Set the disks property: List of disk ids representing a recovery point. + * + * @param disks the disks value to set. + * @return the A2ARecoveryPointDetails object itself. + */ + public A2ARecoveryPointDetails withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARemoveDisksInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARemoveDisksInput.java new file mode 100644 index 000000000000..8a73a82ff017 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARemoveDisksInput.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.recoveryservicessiterecovery.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; +import java.util.List; + +/** A2A remove disk(s) input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2ARemoveDisksInput extends RemoveDisksProviderSpecificInput { + /* + * The list of vm disk vhd URIs. + */ + @JsonProperty(value = "vmDisksUris") + private List vmDisksUris; + + /* + * The list of vm managed disk Ids. + */ + @JsonProperty(value = "vmManagedDisksIds") + private List vmManagedDisksIds; + + /** Creates an instance of A2ARemoveDisksInput class. */ + public A2ARemoveDisksInput() { + } + + /** + * Get the vmDisksUris property: The list of vm disk vhd URIs. + * + * @return the vmDisksUris value. + */ + public List vmDisksUris() { + return this.vmDisksUris; + } + + /** + * Set the vmDisksUris property: The list of vm disk vhd URIs. + * + * @param vmDisksUris the vmDisksUris value to set. + * @return the A2ARemoveDisksInput object itself. + */ + public A2ARemoveDisksInput withVmDisksUris(List vmDisksUris) { + this.vmDisksUris = vmDisksUris; + return this; + } + + /** + * Get the vmManagedDisksIds property: The list of vm managed disk Ids. + * + * @return the vmManagedDisksIds value. + */ + public List vmManagedDisksIds() { + return this.vmManagedDisksIds; + } + + /** + * Set the vmManagedDisksIds property: The list of vm managed disk Ids. + * + * @param vmManagedDisksIds the vmManagedDisksIds value to set. + * @return the A2ARemoveDisksInput object itself. + */ + public A2ARemoveDisksInput withVmManagedDisksIds(List vmManagedDisksIds) { + this.vmManagedDisksIds = vmManagedDisksIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationDetails.java new file mode 100644 index 000000000000..16b771c299af --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationDetails.java @@ -0,0 +1,1379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.time.OffsetDateTime; +import java.util.List; + +/** A2A provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * The fabric specific object Id of the virtual machine. + */ + @JsonProperty(value = "fabricObjectId") + private String fabricObjectId; + + /* + * The initial primary availability zone. + */ + @JsonProperty(value = "initialPrimaryZone", access = JsonProperty.Access.WRITE_ONLY) + private String initialPrimaryZone; + + /* + * The initial primary fabric location. + */ + @JsonProperty(value = "initialPrimaryFabricLocation", access = JsonProperty.Access.WRITE_ONLY) + private String initialPrimaryFabricLocation; + + /* + * The initial recovery availability zone. + */ + @JsonProperty(value = "initialRecoveryZone", access = JsonProperty.Access.WRITE_ONLY) + private String initialRecoveryZone; + + /* + * The initial primary extended location. + */ + @JsonProperty(value = "initialPrimaryExtendedLocation") + private ExtendedLocation initialPrimaryExtendedLocation; + + /* + * The initial recovery extended location. + */ + @JsonProperty(value = "initialRecoveryExtendedLocation") + private ExtendedLocation initialRecoveryExtendedLocation; + + /* + * The initial recovery fabric location. + */ + @JsonProperty(value = "initialRecoveryFabricLocation", access = JsonProperty.Access.WRITE_ONLY) + private String initialRecoveryFabricLocation; + + /* + * The multi vm group Id. + */ + @JsonProperty(value = "multiVmGroupId") + private String multiVmGroupId; + + /* + * The multi vm group name. + */ + @JsonProperty(value = "multiVmGroupName") + private String multiVmGroupName; + + /* + * Whether Multi VM group is auto created or specified by user. + */ + @JsonProperty(value = "multiVmGroupCreateOption") + private MultiVmGroupCreateOption multiVmGroupCreateOption; + + /* + * The management Id. + */ + @JsonProperty(value = "managementId") + private String managementId; + + /* + * The list of protected disks. + */ + @JsonProperty(value = "protectedDisks") + private List protectedDisks; + + /* + * The list of unprotected disks. + */ + @JsonProperty(value = "unprotectedDisks") + private List unprotectedDisks; + + /* + * The list of protected managed disks. + */ + @JsonProperty(value = "protectedManagedDisks") + private List protectedManagedDisks; + + /* + * The recovery boot diagnostic storage account Arm Id. + */ + @JsonProperty(value = "recoveryBootDiagStorageAccountId") + private String recoveryBootDiagStorageAccountId; + + /* + * Primary fabric location. + */ + @JsonProperty(value = "primaryFabricLocation") + private String primaryFabricLocation; + + /* + * The recovery fabric location. + */ + @JsonProperty(value = "recoveryFabricLocation") + private String recoveryFabricLocation; + + /* + * The type of operating system. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The size of recovery virtual machine. + */ + @JsonProperty(value = "recoveryAzureVMSize") + private String recoveryAzureVMSize; + + /* + * The name of recovery virtual machine. + */ + @JsonProperty(value = "recoveryAzureVMName") + private String recoveryAzureVMName; + + /* + * The recovery resource group. + */ + @JsonProperty(value = "recoveryAzureResourceGroupId") + private String recoveryAzureResourceGroupId; + + /* + * The recovery cloud service. + */ + @JsonProperty(value = "recoveryCloudService") + private String recoveryCloudService; + + /* + * The recovery availability set. + */ + @JsonProperty(value = "recoveryAvailabilitySet") + private String recoveryAvailabilitySet; + + /* + * The recovery virtual network. + */ + @JsonProperty(value = "selectedRecoveryAzureNetworkId") + private String selectedRecoveryAzureNetworkId; + + /* + * The test failover virtual network. + */ + @JsonProperty(value = "selectedTfoAzureNetworkId") + private String selectedTfoAzureNetworkId; + + /* + * The virtual machine nic details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The synced configuration details. + */ + @JsonProperty(value = "vmSyncedConfigDetails") + private AzureToAzureVmSyncedConfigDetails vmSyncedConfigDetails; + + /* + * The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + */ + @JsonProperty(value = "monitoringPercentageCompletion") + private Integer monitoringPercentageCompletion; + + /* + * The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + */ + @JsonProperty(value = "monitoringJobType") + private String monitoringJobType; + + /* + * The last heartbeat received from the source server. + */ + @JsonProperty(value = "lastHeartbeat") + private OffsetDateTime lastHeartbeat; + + /* + * The agent version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * Agent expiry date. + */ + @JsonProperty(value = "agentExpiryDate") + private OffsetDateTime agentExpiryDate; + + /* + * A value indicating whether replication agent update is required. + */ + @JsonProperty(value = "isReplicationAgentUpdateRequired") + private Boolean isReplicationAgentUpdateRequired; + + /* + * Agent certificate expiry date. + */ + @JsonProperty(value = "agentCertificateExpiryDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime agentCertificateExpiryDate; + + /* + * A value indicating whether agent certificate update is required. + */ + @JsonProperty(value = "isReplicationAgentCertificateUpdateRequired") + private Boolean isReplicationAgentCertificateUpdateRequired; + + /* + * The recovery fabric object Id. + */ + @JsonProperty(value = "recoveryFabricObjectId") + private String recoveryFabricObjectId; + + /* + * The protection state for the vm. + */ + @JsonProperty(value = "vmProtectionState") + private String vmProtectionState; + + /* + * The protection state description for the vm. + */ + @JsonProperty(value = "vmProtectionStateDescription") + private String vmProtectionStateDescription; + + /* + * An id associated with the PE that survives actions like switch protection which change the backing PE/CPE + * objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id + * that denotes the "same" protected item even though other internal Ids/ARM Id might be changing. + */ + @JsonProperty(value = "lifecycleId") + private String lifecycleId; + + /* + * The test failover fabric object Id. + */ + @JsonProperty(value = "testFailoverRecoveryFabricObjectId") + private String testFailoverRecoveryFabricObjectId; + + /* + * The last RPO value in seconds. + */ + @JsonProperty(value = "rpoInSeconds") + private Long rpoInSeconds; + + /* + * The time (in UTC) when the last RPO value was calculated by Protection Service. + */ + @JsonProperty(value = "lastRpoCalculatedTime") + private OffsetDateTime lastRpoCalculatedTime; + + /* + * The primary availability zone. + */ + @JsonProperty(value = "primaryAvailabilityZone") + private String primaryAvailabilityZone; + + /* + * The recovery availability zone. + */ + @JsonProperty(value = "recoveryAvailabilityZone") + private String recoveryAvailabilityZone; + + /* + * The primary Extended Location. + */ + @JsonProperty(value = "primaryExtendedLocation") + private ExtendedLocation primaryExtendedLocation; + + /* + * The recovery Extended Location. + */ + @JsonProperty(value = "recoveryExtendedLocation") + private ExtendedLocation recoveryExtendedLocation; + + /* + * The encryption type of the VM. + */ + @JsonProperty(value = "vmEncryptionType", access = JsonProperty.Access.WRITE_ONLY) + private VmEncryptionType vmEncryptionType; + + /* + * The test failover vm name. + */ + @JsonProperty(value = "tfoAzureVMName") + private String tfoAzureVMName; + + /* + * The recovery azure generation. + */ + @JsonProperty(value = "recoveryAzureGeneration", access = JsonProperty.Access.WRITE_ONLY) + private String recoveryAzureGeneration; + + /* + * The recovery proximity placement group Id. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /* + * A value indicating whether the auto protection is enabled. + */ + @JsonProperty(value = "autoProtectionOfDataDisk") + private AutoProtectionOfDataDisk autoProtectionOfDataDisk; + + /* + * The recovery virtual machine scale set id. + */ + @JsonProperty(value = "recoveryVirtualMachineScaleSetId") + private String recoveryVirtualMachineScaleSetId; + + /* + * The recovery capacity reservation group Id. + */ + @JsonProperty(value = "recoveryCapacityReservationGroupId") + private String recoveryCapacityReservationGroupId; + + /** Creates an instance of A2AReplicationDetails class. */ + public A2AReplicationDetails() { + } + + /** + * Get the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Set the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @param fabricObjectId the fabricObjectId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withFabricObjectId(String fabricObjectId) { + this.fabricObjectId = fabricObjectId; + return this; + } + + /** + * Get the initialPrimaryZone property: The initial primary availability zone. + * + * @return the initialPrimaryZone value. + */ + public String initialPrimaryZone() { + return this.initialPrimaryZone; + } + + /** + * Get the initialPrimaryFabricLocation property: The initial primary fabric location. + * + * @return the initialPrimaryFabricLocation value. + */ + public String initialPrimaryFabricLocation() { + return this.initialPrimaryFabricLocation; + } + + /** + * Get the initialRecoveryZone property: The initial recovery availability zone. + * + * @return the initialRecoveryZone value. + */ + public String initialRecoveryZone() { + return this.initialRecoveryZone; + } + + /** + * Get the initialPrimaryExtendedLocation property: The initial primary extended location. + * + * @return the initialPrimaryExtendedLocation value. + */ + public ExtendedLocation initialPrimaryExtendedLocation() { + return this.initialPrimaryExtendedLocation; + } + + /** + * Set the initialPrimaryExtendedLocation property: The initial primary extended location. + * + * @param initialPrimaryExtendedLocation the initialPrimaryExtendedLocation value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withInitialPrimaryExtendedLocation(ExtendedLocation initialPrimaryExtendedLocation) { + this.initialPrimaryExtendedLocation = initialPrimaryExtendedLocation; + return this; + } + + /** + * Get the initialRecoveryExtendedLocation property: The initial recovery extended location. + * + * @return the initialRecoveryExtendedLocation value. + */ + public ExtendedLocation initialRecoveryExtendedLocation() { + return this.initialRecoveryExtendedLocation; + } + + /** + * Set the initialRecoveryExtendedLocation property: The initial recovery extended location. + * + * @param initialRecoveryExtendedLocation the initialRecoveryExtendedLocation value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withInitialRecoveryExtendedLocation(ExtendedLocation initialRecoveryExtendedLocation) { + this.initialRecoveryExtendedLocation = initialRecoveryExtendedLocation; + return this; + } + + /** + * Get the initialRecoveryFabricLocation property: The initial recovery fabric location. + * + * @return the initialRecoveryFabricLocation value. + */ + public String initialRecoveryFabricLocation() { + return this.initialRecoveryFabricLocation; + } + + /** + * Get the multiVmGroupId property: The multi vm group Id. + * + * @return the multiVmGroupId value. + */ + public String multiVmGroupId() { + return this.multiVmGroupId; + } + + /** + * Set the multiVmGroupId property: The multi vm group Id. + * + * @param multiVmGroupId the multiVmGroupId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withMultiVmGroupId(String multiVmGroupId) { + this.multiVmGroupId = multiVmGroupId; + return this; + } + + /** + * Get the multiVmGroupName property: The multi vm group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Set the multiVmGroupName property: The multi vm group name. + * + * @param multiVmGroupName the multiVmGroupName value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withMultiVmGroupName(String multiVmGroupName) { + this.multiVmGroupName = multiVmGroupName; + return this; + } + + /** + * Get the multiVmGroupCreateOption property: Whether Multi VM group is auto created or specified by user. + * + * @return the multiVmGroupCreateOption value. + */ + public MultiVmGroupCreateOption multiVmGroupCreateOption() { + return this.multiVmGroupCreateOption; + } + + /** + * Set the multiVmGroupCreateOption property: Whether Multi VM group is auto created or specified by user. + * + * @param multiVmGroupCreateOption the multiVmGroupCreateOption value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withMultiVmGroupCreateOption(MultiVmGroupCreateOption multiVmGroupCreateOption) { + this.multiVmGroupCreateOption = multiVmGroupCreateOption; + return this; + } + + /** + * Get the managementId property: The management Id. + * + * @return the managementId value. + */ + public String managementId() { + return this.managementId; + } + + /** + * Set the managementId property: The management Id. + * + * @param managementId the managementId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withManagementId(String managementId) { + this.managementId = managementId; + return this; + } + + /** + * Get the protectedDisks property: The list of protected disks. + * + * @return the protectedDisks value. + */ + public List protectedDisks() { + return this.protectedDisks; + } + + /** + * Set the protectedDisks property: The list of protected disks. + * + * @param protectedDisks the protectedDisks value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withProtectedDisks(List protectedDisks) { + this.protectedDisks = protectedDisks; + return this; + } + + /** + * Get the unprotectedDisks property: The list of unprotected disks. + * + * @return the unprotectedDisks value. + */ + public List unprotectedDisks() { + return this.unprotectedDisks; + } + + /** + * Set the unprotectedDisks property: The list of unprotected disks. + * + * @param unprotectedDisks the unprotectedDisks value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withUnprotectedDisks(List unprotectedDisks) { + this.unprotectedDisks = unprotectedDisks; + return this; + } + + /** + * Get the protectedManagedDisks property: The list of protected managed disks. + * + * @return the protectedManagedDisks value. + */ + public List protectedManagedDisks() { + return this.protectedManagedDisks; + } + + /** + * Set the protectedManagedDisks property: The list of protected managed disks. + * + * @param protectedManagedDisks the protectedManagedDisks value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withProtectedManagedDisks(List protectedManagedDisks) { + this.protectedManagedDisks = protectedManagedDisks; + return this; + } + + /** + * Get the recoveryBootDiagStorageAccountId property: The recovery boot diagnostic storage account Arm Id. + * + * @return the recoveryBootDiagStorageAccountId value. + */ + public String recoveryBootDiagStorageAccountId() { + return this.recoveryBootDiagStorageAccountId; + } + + /** + * Set the recoveryBootDiagStorageAccountId property: The recovery boot diagnostic storage account Arm Id. + * + * @param recoveryBootDiagStorageAccountId the recoveryBootDiagStorageAccountId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryBootDiagStorageAccountId(String recoveryBootDiagStorageAccountId) { + this.recoveryBootDiagStorageAccountId = recoveryBootDiagStorageAccountId; + return this; + } + + /** + * Get the primaryFabricLocation property: Primary fabric location. + * + * @return the primaryFabricLocation value. + */ + public String primaryFabricLocation() { + return this.primaryFabricLocation; + } + + /** + * Set the primaryFabricLocation property: Primary fabric location. + * + * @param primaryFabricLocation the primaryFabricLocation value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withPrimaryFabricLocation(String primaryFabricLocation) { + this.primaryFabricLocation = primaryFabricLocation; + return this; + } + + /** + * Get the recoveryFabricLocation property: The recovery fabric location. + * + * @return the recoveryFabricLocation value. + */ + public String recoveryFabricLocation() { + return this.recoveryFabricLocation; + } + + /** + * Set the recoveryFabricLocation property: The recovery fabric location. + * + * @param recoveryFabricLocation the recoveryFabricLocation value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryFabricLocation(String recoveryFabricLocation) { + this.recoveryFabricLocation = recoveryFabricLocation; + return this; + } + + /** + * Get the osType property: The type of operating system. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The type of operating system. + * + * @param osType the osType value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the recoveryAzureVMSize property: The size of recovery virtual machine. + * + * @return the recoveryAzureVMSize value. + */ + public String recoveryAzureVMSize() { + return this.recoveryAzureVMSize; + } + + /** + * Set the recoveryAzureVMSize property: The size of recovery virtual machine. + * + * @param recoveryAzureVMSize the recoveryAzureVMSize value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryAzureVMSize(String recoveryAzureVMSize) { + this.recoveryAzureVMSize = recoveryAzureVMSize; + return this; + } + + /** + * Get the recoveryAzureVMName property: The name of recovery virtual machine. + * + * @return the recoveryAzureVMName value. + */ + public String recoveryAzureVMName() { + return this.recoveryAzureVMName; + } + + /** + * Set the recoveryAzureVMName property: The name of recovery virtual machine. + * + * @param recoveryAzureVMName the recoveryAzureVMName value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryAzureVMName(String recoveryAzureVMName) { + this.recoveryAzureVMName = recoveryAzureVMName; + return this; + } + + /** + * Get the recoveryAzureResourceGroupId property: The recovery resource group. + * + * @return the recoveryAzureResourceGroupId value. + */ + public String recoveryAzureResourceGroupId() { + return this.recoveryAzureResourceGroupId; + } + + /** + * Set the recoveryAzureResourceGroupId property: The recovery resource group. + * + * @param recoveryAzureResourceGroupId the recoveryAzureResourceGroupId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryAzureResourceGroupId(String recoveryAzureResourceGroupId) { + this.recoveryAzureResourceGroupId = recoveryAzureResourceGroupId; + return this; + } + + /** + * Get the recoveryCloudService property: The recovery cloud service. + * + * @return the recoveryCloudService value. + */ + public String recoveryCloudService() { + return this.recoveryCloudService; + } + + /** + * Set the recoveryCloudService property: The recovery cloud service. + * + * @param recoveryCloudService the recoveryCloudService value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryCloudService(String recoveryCloudService) { + this.recoveryCloudService = recoveryCloudService; + return this; + } + + /** + * Get the recoveryAvailabilitySet property: The recovery availability set. + * + * @return the recoveryAvailabilitySet value. + */ + public String recoveryAvailabilitySet() { + return this.recoveryAvailabilitySet; + } + + /** + * Set the recoveryAvailabilitySet property: The recovery availability set. + * + * @param recoveryAvailabilitySet the recoveryAvailabilitySet value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryAvailabilitySet(String recoveryAvailabilitySet) { + this.recoveryAvailabilitySet = recoveryAvailabilitySet; + return this; + } + + /** + * Get the selectedRecoveryAzureNetworkId property: The recovery virtual network. + * + * @return the selectedRecoveryAzureNetworkId value. + */ + public String selectedRecoveryAzureNetworkId() { + return this.selectedRecoveryAzureNetworkId; + } + + /** + * Set the selectedRecoveryAzureNetworkId property: The recovery virtual network. + * + * @param selectedRecoveryAzureNetworkId the selectedRecoveryAzureNetworkId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withSelectedRecoveryAzureNetworkId(String selectedRecoveryAzureNetworkId) { + this.selectedRecoveryAzureNetworkId = selectedRecoveryAzureNetworkId; + return this; + } + + /** + * Get the selectedTfoAzureNetworkId property: The test failover virtual network. + * + * @return the selectedTfoAzureNetworkId value. + */ + public String selectedTfoAzureNetworkId() { + return this.selectedTfoAzureNetworkId; + } + + /** + * Set the selectedTfoAzureNetworkId property: The test failover virtual network. + * + * @param selectedTfoAzureNetworkId the selectedTfoAzureNetworkId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withSelectedTfoAzureNetworkId(String selectedTfoAzureNetworkId) { + this.selectedTfoAzureNetworkId = selectedTfoAzureNetworkId; + return this; + } + + /** + * Get the vmNics property: The virtual machine nic details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The virtual machine nic details. + * + * @param vmNics the vmNics value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the vmSyncedConfigDetails property: The synced configuration details. + * + * @return the vmSyncedConfigDetails value. + */ + public AzureToAzureVmSyncedConfigDetails vmSyncedConfigDetails() { + return this.vmSyncedConfigDetails; + } + + /** + * Set the vmSyncedConfigDetails property: The synced configuration details. + * + * @param vmSyncedConfigDetails the vmSyncedConfigDetails value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withVmSyncedConfigDetails(AzureToAzureVmSyncedConfigDetails vmSyncedConfigDetails) { + this.vmSyncedConfigDetails = vmSyncedConfigDetails; + return this; + } + + /** + * Get the monitoringPercentageCompletion property: The percentage of the monitoring job. The type of the monitoring + * job is defined by MonitoringJobType property. + * + * @return the monitoringPercentageCompletion value. + */ + public Integer monitoringPercentageCompletion() { + return this.monitoringPercentageCompletion; + } + + /** + * Set the monitoringPercentageCompletion property: The percentage of the monitoring job. The type of the monitoring + * job is defined by MonitoringJobType property. + * + * @param monitoringPercentageCompletion the monitoringPercentageCompletion value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withMonitoringPercentageCompletion(Integer monitoringPercentageCompletion) { + this.monitoringPercentageCompletion = monitoringPercentageCompletion; + return this; + } + + /** + * Get the monitoringJobType property: The type of the monitoring job. The progress is contained in + * MonitoringPercentageCompletion property. + * + * @return the monitoringJobType value. + */ + public String monitoringJobType() { + return this.monitoringJobType; + } + + /** + * Set the monitoringJobType property: The type of the monitoring job. The progress is contained in + * MonitoringPercentageCompletion property. + * + * @param monitoringJobType the monitoringJobType value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withMonitoringJobType(String monitoringJobType) { + this.monitoringJobType = monitoringJobType; + return this; + } + + /** + * Get the lastHeartbeat property: The last heartbeat received from the source server. + * + * @return the lastHeartbeat value. + */ + public OffsetDateTime lastHeartbeat() { + return this.lastHeartbeat; + } + + /** + * Set the lastHeartbeat property: The last heartbeat received from the source server. + * + * @param lastHeartbeat the lastHeartbeat value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withLastHeartbeat(OffsetDateTime lastHeartbeat) { + this.lastHeartbeat = lastHeartbeat; + return this; + } + + /** + * Get the agentVersion property: The agent version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The agent version. + * + * @param agentVersion the agentVersion value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the agentExpiryDate property: Agent expiry date. + * + * @return the agentExpiryDate value. + */ + public OffsetDateTime agentExpiryDate() { + return this.agentExpiryDate; + } + + /** + * Set the agentExpiryDate property: Agent expiry date. + * + * @param agentExpiryDate the agentExpiryDate value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withAgentExpiryDate(OffsetDateTime agentExpiryDate) { + this.agentExpiryDate = agentExpiryDate; + return this; + } + + /** + * Get the isReplicationAgentUpdateRequired property: A value indicating whether replication agent update is + * required. + * + * @return the isReplicationAgentUpdateRequired value. + */ + public Boolean isReplicationAgentUpdateRequired() { + return this.isReplicationAgentUpdateRequired; + } + + /** + * Set the isReplicationAgentUpdateRequired property: A value indicating whether replication agent update is + * required. + * + * @param isReplicationAgentUpdateRequired the isReplicationAgentUpdateRequired value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withIsReplicationAgentUpdateRequired(Boolean isReplicationAgentUpdateRequired) { + this.isReplicationAgentUpdateRequired = isReplicationAgentUpdateRequired; + return this; + } + + /** + * Get the agentCertificateExpiryDate property: Agent certificate expiry date. + * + * @return the agentCertificateExpiryDate value. + */ + public OffsetDateTime agentCertificateExpiryDate() { + return this.agentCertificateExpiryDate; + } + + /** + * Get the isReplicationAgentCertificateUpdateRequired property: A value indicating whether agent certificate update + * is required. + * + * @return the isReplicationAgentCertificateUpdateRequired value. + */ + public Boolean isReplicationAgentCertificateUpdateRequired() { + return this.isReplicationAgentCertificateUpdateRequired; + } + + /** + * Set the isReplicationAgentCertificateUpdateRequired property: A value indicating whether agent certificate update + * is required. + * + * @param isReplicationAgentCertificateUpdateRequired the isReplicationAgentCertificateUpdateRequired value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withIsReplicationAgentCertificateUpdateRequired( + Boolean isReplicationAgentCertificateUpdateRequired) { + this.isReplicationAgentCertificateUpdateRequired = isReplicationAgentCertificateUpdateRequired; + return this; + } + + /** + * Get the recoveryFabricObjectId property: The recovery fabric object Id. + * + * @return the recoveryFabricObjectId value. + */ + public String recoveryFabricObjectId() { + return this.recoveryFabricObjectId; + } + + /** + * Set the recoveryFabricObjectId property: The recovery fabric object Id. + * + * @param recoveryFabricObjectId the recoveryFabricObjectId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryFabricObjectId(String recoveryFabricObjectId) { + this.recoveryFabricObjectId = recoveryFabricObjectId; + return this; + } + + /** + * Get the vmProtectionState property: The protection state for the vm. + * + * @return the vmProtectionState value. + */ + public String vmProtectionState() { + return this.vmProtectionState; + } + + /** + * Set the vmProtectionState property: The protection state for the vm. + * + * @param vmProtectionState the vmProtectionState value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withVmProtectionState(String vmProtectionState) { + this.vmProtectionState = vmProtectionState; + return this; + } + + /** + * Get the vmProtectionStateDescription property: The protection state description for the vm. + * + * @return the vmProtectionStateDescription value. + */ + public String vmProtectionStateDescription() { + return this.vmProtectionStateDescription; + } + + /** + * Set the vmProtectionStateDescription property: The protection state description for the vm. + * + * @param vmProtectionStateDescription the vmProtectionStateDescription value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withVmProtectionStateDescription(String vmProtectionStateDescription) { + this.vmProtectionStateDescription = vmProtectionStateDescription; + return this; + } + + /** + * Get the lifecycleId property: An id associated with the PE that survives actions like switch protection which + * change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in + * being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be + * changing. + * + * @return the lifecycleId value. + */ + public String lifecycleId() { + return this.lifecycleId; + } + + /** + * Set the lifecycleId property: An id associated with the PE that survives actions like switch protection which + * change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in + * being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be + * changing. + * + * @param lifecycleId the lifecycleId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withLifecycleId(String lifecycleId) { + this.lifecycleId = lifecycleId; + return this; + } + + /** + * Get the testFailoverRecoveryFabricObjectId property: The test failover fabric object Id. + * + * @return the testFailoverRecoveryFabricObjectId value. + */ + public String testFailoverRecoveryFabricObjectId() { + return this.testFailoverRecoveryFabricObjectId; + } + + /** + * Set the testFailoverRecoveryFabricObjectId property: The test failover fabric object Id. + * + * @param testFailoverRecoveryFabricObjectId the testFailoverRecoveryFabricObjectId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withTestFailoverRecoveryFabricObjectId(String testFailoverRecoveryFabricObjectId) { + this.testFailoverRecoveryFabricObjectId = testFailoverRecoveryFabricObjectId; + return this; + } + + /** + * Get the rpoInSeconds property: The last RPO value in seconds. + * + * @return the rpoInSeconds value. + */ + public Long rpoInSeconds() { + return this.rpoInSeconds; + } + + /** + * Set the rpoInSeconds property: The last RPO value in seconds. + * + * @param rpoInSeconds the rpoInSeconds value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRpoInSeconds(Long rpoInSeconds) { + this.rpoInSeconds = rpoInSeconds; + return this; + } + + /** + * Get the lastRpoCalculatedTime property: The time (in UTC) when the last RPO value was calculated by Protection + * Service. + * + * @return the lastRpoCalculatedTime value. + */ + public OffsetDateTime lastRpoCalculatedTime() { + return this.lastRpoCalculatedTime; + } + + /** + * Set the lastRpoCalculatedTime property: The time (in UTC) when the last RPO value was calculated by Protection + * Service. + * + * @param lastRpoCalculatedTime the lastRpoCalculatedTime value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withLastRpoCalculatedTime(OffsetDateTime lastRpoCalculatedTime) { + this.lastRpoCalculatedTime = lastRpoCalculatedTime; + return this; + } + + /** + * Get the primaryAvailabilityZone property: The primary availability zone. + * + * @return the primaryAvailabilityZone value. + */ + public String primaryAvailabilityZone() { + return this.primaryAvailabilityZone; + } + + /** + * Set the primaryAvailabilityZone property: The primary availability zone. + * + * @param primaryAvailabilityZone the primaryAvailabilityZone value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withPrimaryAvailabilityZone(String primaryAvailabilityZone) { + this.primaryAvailabilityZone = primaryAvailabilityZone; + return this; + } + + /** + * Get the recoveryAvailabilityZone property: The recovery availability zone. + * + * @return the recoveryAvailabilityZone value. + */ + public String recoveryAvailabilityZone() { + return this.recoveryAvailabilityZone; + } + + /** + * Set the recoveryAvailabilityZone property: The recovery availability zone. + * + * @param recoveryAvailabilityZone the recoveryAvailabilityZone value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryAvailabilityZone(String recoveryAvailabilityZone) { + this.recoveryAvailabilityZone = recoveryAvailabilityZone; + return this; + } + + /** + * Get the primaryExtendedLocation property: The primary Extended Location. + * + * @return the primaryExtendedLocation value. + */ + public ExtendedLocation primaryExtendedLocation() { + return this.primaryExtendedLocation; + } + + /** + * Set the primaryExtendedLocation property: The primary Extended Location. + * + * @param primaryExtendedLocation the primaryExtendedLocation value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withPrimaryExtendedLocation(ExtendedLocation primaryExtendedLocation) { + this.primaryExtendedLocation = primaryExtendedLocation; + return this; + } + + /** + * Get the recoveryExtendedLocation property: The recovery Extended Location. + * + * @return the recoveryExtendedLocation value. + */ + public ExtendedLocation recoveryExtendedLocation() { + return this.recoveryExtendedLocation; + } + + /** + * Set the recoveryExtendedLocation property: The recovery Extended Location. + * + * @param recoveryExtendedLocation the recoveryExtendedLocation value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryExtendedLocation(ExtendedLocation recoveryExtendedLocation) { + this.recoveryExtendedLocation = recoveryExtendedLocation; + return this; + } + + /** + * Get the vmEncryptionType property: The encryption type of the VM. + * + * @return the vmEncryptionType value. + */ + public VmEncryptionType vmEncryptionType() { + return this.vmEncryptionType; + } + + /** + * Get the tfoAzureVMName property: The test failover vm name. + * + * @return the tfoAzureVMName value. + */ + public String tfoAzureVMName() { + return this.tfoAzureVMName; + } + + /** + * Set the tfoAzureVMName property: The test failover vm name. + * + * @param tfoAzureVMName the tfoAzureVMName value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withTfoAzureVMName(String tfoAzureVMName) { + this.tfoAzureVMName = tfoAzureVMName; + return this; + } + + /** + * Get the recoveryAzureGeneration property: The recovery azure generation. + * + * @return the recoveryAzureGeneration value. + */ + public String recoveryAzureGeneration() { + return this.recoveryAzureGeneration; + } + + /** + * Get the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. + * + * @return the recoveryProximityPlacementGroupId value. + */ + public String recoveryProximityPlacementGroupId() { + return this.recoveryProximityPlacementGroupId; + } + + /** + * Set the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. + * + * @param recoveryProximityPlacementGroupId the recoveryProximityPlacementGroupId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryProximityPlacementGroupId(String recoveryProximityPlacementGroupId) { + this.recoveryProximityPlacementGroupId = recoveryProximityPlacementGroupId; + return this; + } + + /** + * Get the autoProtectionOfDataDisk property: A value indicating whether the auto protection is enabled. + * + * @return the autoProtectionOfDataDisk value. + */ + public AutoProtectionOfDataDisk autoProtectionOfDataDisk() { + return this.autoProtectionOfDataDisk; + } + + /** + * Set the autoProtectionOfDataDisk property: A value indicating whether the auto protection is enabled. + * + * @param autoProtectionOfDataDisk the autoProtectionOfDataDisk value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withAutoProtectionOfDataDisk(AutoProtectionOfDataDisk autoProtectionOfDataDisk) { + this.autoProtectionOfDataDisk = autoProtectionOfDataDisk; + return this; + } + + /** + * Get the recoveryVirtualMachineScaleSetId property: The recovery virtual machine scale set id. + * + * @return the recoveryVirtualMachineScaleSetId value. + */ + public String recoveryVirtualMachineScaleSetId() { + return this.recoveryVirtualMachineScaleSetId; + } + + /** + * Set the recoveryVirtualMachineScaleSetId property: The recovery virtual machine scale set id. + * + * @param recoveryVirtualMachineScaleSetId the recoveryVirtualMachineScaleSetId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryVirtualMachineScaleSetId(String recoveryVirtualMachineScaleSetId) { + this.recoveryVirtualMachineScaleSetId = recoveryVirtualMachineScaleSetId; + return this; + } + + /** + * Get the recoveryCapacityReservationGroupId property: The recovery capacity reservation group Id. + * + * @return the recoveryCapacityReservationGroupId value. + */ + public String recoveryCapacityReservationGroupId() { + return this.recoveryCapacityReservationGroupId; + } + + /** + * Set the recoveryCapacityReservationGroupId property: The recovery capacity reservation group Id. + * + * @param recoveryCapacityReservationGroupId the recoveryCapacityReservationGroupId value to set. + * @return the A2AReplicationDetails object itself. + */ + public A2AReplicationDetails withRecoveryCapacityReservationGroupId(String recoveryCapacityReservationGroupId) { + this.recoveryCapacityReservationGroupId = recoveryCapacityReservationGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (initialPrimaryExtendedLocation() != null) { + initialPrimaryExtendedLocation().validate(); + } + if (initialRecoveryExtendedLocation() != null) { + initialRecoveryExtendedLocation().validate(); + } + if (protectedDisks() != null) { + protectedDisks().forEach(e -> e.validate()); + } + if (unprotectedDisks() != null) { + unprotectedDisks().forEach(e -> e.validate()); + } + if (protectedManagedDisks() != null) { + protectedManagedDisks().forEach(e -> e.validate()); + } + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (vmSyncedConfigDetails() != null) { + vmSyncedConfigDetails().validate(); + } + if (primaryExtendedLocation() != null) { + primaryExtendedLocation().validate(); + } + if (recoveryExtendedLocation() != null) { + recoveryExtendedLocation().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationIntentDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationIntentDetails.java new file mode 100644 index 000000000000..9a141ee3d6a2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationIntentDetails.java @@ -0,0 +1,648 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AReplicationIntentDetails extends ReplicationProtectionIntentProviderSpecificSettings { + /* + * The fabric specific object Id of the virtual machine. + */ + @JsonProperty(value = "fabricObjectId") + private String fabricObjectId; + + /* + * The primary location for the virtual machine. + */ + @JsonProperty(value = "primaryLocation") + private String primaryLocation; + + /* + * The recovery location for the virtual machine. + */ + @JsonProperty(value = "recoveryLocation") + private String recoveryLocation; + + /* + * The recovery subscription Id of the virtual machine. + */ + @JsonProperty(value = "recoverySubscriptionId") + private String recoverySubscriptionId; + + /* + * The list of vm disk details. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /* + * The list of vm managed disk details. + */ + @JsonProperty(value = "vmManagedDisks") + private List vmManagedDisks; + + /* + * The recovery resource group id. + */ + @JsonProperty(value = "recoveryResourceGroupId") + private String recoveryResourceGroupId; + + /* + * The protection profile custom details. + */ + @JsonProperty(value = "protectionProfile") + private ProtectionProfileCustomDetails protectionProfile; + + /* + * The primary staging storage account details. + */ + @JsonProperty(value = "primaryStagingStorageAccount") + private StorageAccountCustomDetails primaryStagingStorageAccount; + + /* + * The recovery availability set details. + */ + @JsonProperty(value = "recoveryAvailabilitySet") + private RecoveryAvailabilitySetCustomDetails recoveryAvailabilitySet; + + /* + * The recovery virtual network details. + */ + @JsonProperty(value = "recoveryVirtualNetwork") + private RecoveryVirtualNetworkCustomDetails recoveryVirtualNetwork; + + /* + * The recovery proximity placement group custom details. + */ + @JsonProperty(value = "recoveryProximityPlacementGroup") + private RecoveryProximityPlacementGroupCustomDetails recoveryProximityPlacementGroup; + + /* + * A value indicating whether the auto protection is enabled. + */ + @JsonProperty(value = "autoProtectionOfDataDisk") + private AutoProtectionOfDataDisk autoProtectionOfDataDisk; + + /* + * The multi vm group name. + */ + @JsonProperty(value = "multiVmGroupName") + private String multiVmGroupName; + + /* + * The multi vm group id. + */ + @JsonProperty(value = "multiVmGroupId") + private String multiVmGroupId; + + /* + * The boot diagnostic storage account. + */ + @JsonProperty(value = "recoveryBootDiagStorageAccount") + private StorageAccountCustomDetails recoveryBootDiagStorageAccount; + + /* + * The recovery disk encryption information (for two pass flows). + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /* + * The recovery availability zone. + */ + @JsonProperty(value = "recoveryAvailabilityZone") + private String recoveryAvailabilityZone; + + /* + * The recovery availability type of the virtual machine. + */ + @JsonProperty(value = "recoveryAvailabilityType", required = true) + private String recoveryAvailabilityType; + + /* + * A value indicating whether the auto update is enabled. + */ + @JsonProperty(value = "agentAutoUpdateStatus") + private AgentAutoUpdateStatus agentAutoUpdateStatus; + + /* + * The automation account arm id. + */ + @JsonProperty(value = "automationAccountArmId") + private String automationAccountArmId; + + /* + * A value indicating the type authentication to use for automation Account. + */ + @JsonProperty(value = "automationAccountAuthenticationType") + private AutomationAccountAuthenticationType automationAccountAuthenticationType; + + /** Creates an instance of A2AReplicationIntentDetails class. */ + public A2AReplicationIntentDetails() { + } + + /** + * Get the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Set the fabricObjectId property: The fabric specific object Id of the virtual machine. + * + * @param fabricObjectId the fabricObjectId value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withFabricObjectId(String fabricObjectId) { + this.fabricObjectId = fabricObjectId; + return this; + } + + /** + * Get the primaryLocation property: The primary location for the virtual machine. + * + * @return the primaryLocation value. + */ + public String primaryLocation() { + return this.primaryLocation; + } + + /** + * Set the primaryLocation property: The primary location for the virtual machine. + * + * @param primaryLocation the primaryLocation value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withPrimaryLocation(String primaryLocation) { + this.primaryLocation = primaryLocation; + return this; + } + + /** + * Get the recoveryLocation property: The recovery location for the virtual machine. + * + * @return the recoveryLocation value. + */ + public String recoveryLocation() { + return this.recoveryLocation; + } + + /** + * Set the recoveryLocation property: The recovery location for the virtual machine. + * + * @param recoveryLocation the recoveryLocation value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryLocation(String recoveryLocation) { + this.recoveryLocation = recoveryLocation; + return this; + } + + /** + * Get the recoverySubscriptionId property: The recovery subscription Id of the virtual machine. + * + * @return the recoverySubscriptionId value. + */ + public String recoverySubscriptionId() { + return this.recoverySubscriptionId; + } + + /** + * Set the recoverySubscriptionId property: The recovery subscription Id of the virtual machine. + * + * @param recoverySubscriptionId the recoverySubscriptionId value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoverySubscriptionId(String recoverySubscriptionId) { + this.recoverySubscriptionId = recoverySubscriptionId; + return this; + } + + /** + * Get the vmDisks property: The list of vm disk details. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of vm disk details. + * + * @param vmDisks the vmDisks value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Get the vmManagedDisks property: The list of vm managed disk details. + * + * @return the vmManagedDisks value. + */ + public List vmManagedDisks() { + return this.vmManagedDisks; + } + + /** + * Set the vmManagedDisks property: The list of vm managed disk details. + * + * @param vmManagedDisks the vmManagedDisks value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withVmManagedDisks( + List vmManagedDisks) { + this.vmManagedDisks = vmManagedDisks; + return this; + } + + /** + * Get the recoveryResourceGroupId property: The recovery resource group id. + * + * @return the recoveryResourceGroupId value. + */ + public String recoveryResourceGroupId() { + return this.recoveryResourceGroupId; + } + + /** + * Set the recoveryResourceGroupId property: The recovery resource group id. + * + * @param recoveryResourceGroupId the recoveryResourceGroupId value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Get the protectionProfile property: The protection profile custom details. + * + * @return the protectionProfile value. + */ + public ProtectionProfileCustomDetails protectionProfile() { + return this.protectionProfile; + } + + /** + * Set the protectionProfile property: The protection profile custom details. + * + * @param protectionProfile the protectionProfile value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withProtectionProfile(ProtectionProfileCustomDetails protectionProfile) { + this.protectionProfile = protectionProfile; + return this; + } + + /** + * Get the primaryStagingStorageAccount property: The primary staging storage account details. + * + * @return the primaryStagingStorageAccount value. + */ + public StorageAccountCustomDetails primaryStagingStorageAccount() { + return this.primaryStagingStorageAccount; + } + + /** + * Set the primaryStagingStorageAccount property: The primary staging storage account details. + * + * @param primaryStagingStorageAccount the primaryStagingStorageAccount value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withPrimaryStagingStorageAccount( + StorageAccountCustomDetails primaryStagingStorageAccount) { + this.primaryStagingStorageAccount = primaryStagingStorageAccount; + return this; + } + + /** + * Get the recoveryAvailabilitySet property: The recovery availability set details. + * + * @return the recoveryAvailabilitySet value. + */ + public RecoveryAvailabilitySetCustomDetails recoveryAvailabilitySet() { + return this.recoveryAvailabilitySet; + } + + /** + * Set the recoveryAvailabilitySet property: The recovery availability set details. + * + * @param recoveryAvailabilitySet the recoveryAvailabilitySet value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryAvailabilitySet( + RecoveryAvailabilitySetCustomDetails recoveryAvailabilitySet) { + this.recoveryAvailabilitySet = recoveryAvailabilitySet; + return this; + } + + /** + * Get the recoveryVirtualNetwork property: The recovery virtual network details. + * + * @return the recoveryVirtualNetwork value. + */ + public RecoveryVirtualNetworkCustomDetails recoveryVirtualNetwork() { + return this.recoveryVirtualNetwork; + } + + /** + * Set the recoveryVirtualNetwork property: The recovery virtual network details. + * + * @param recoveryVirtualNetwork the recoveryVirtualNetwork value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryVirtualNetwork( + RecoveryVirtualNetworkCustomDetails recoveryVirtualNetwork) { + this.recoveryVirtualNetwork = recoveryVirtualNetwork; + return this; + } + + /** + * Get the recoveryProximityPlacementGroup property: The recovery proximity placement group custom details. + * + * @return the recoveryProximityPlacementGroup value. + */ + public RecoveryProximityPlacementGroupCustomDetails recoveryProximityPlacementGroup() { + return this.recoveryProximityPlacementGroup; + } + + /** + * Set the recoveryProximityPlacementGroup property: The recovery proximity placement group custom details. + * + * @param recoveryProximityPlacementGroup the recoveryProximityPlacementGroup value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryProximityPlacementGroup( + RecoveryProximityPlacementGroupCustomDetails recoveryProximityPlacementGroup) { + this.recoveryProximityPlacementGroup = recoveryProximityPlacementGroup; + return this; + } + + /** + * Get the autoProtectionOfDataDisk property: A value indicating whether the auto protection is enabled. + * + * @return the autoProtectionOfDataDisk value. + */ + public AutoProtectionOfDataDisk autoProtectionOfDataDisk() { + return this.autoProtectionOfDataDisk; + } + + /** + * Set the autoProtectionOfDataDisk property: A value indicating whether the auto protection is enabled. + * + * @param autoProtectionOfDataDisk the autoProtectionOfDataDisk value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withAutoProtectionOfDataDisk(AutoProtectionOfDataDisk autoProtectionOfDataDisk) { + this.autoProtectionOfDataDisk = autoProtectionOfDataDisk; + return this; + } + + /** + * Get the multiVmGroupName property: The multi vm group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Set the multiVmGroupName property: The multi vm group name. + * + * @param multiVmGroupName the multiVmGroupName value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withMultiVmGroupName(String multiVmGroupName) { + this.multiVmGroupName = multiVmGroupName; + return this; + } + + /** + * Get the multiVmGroupId property: The multi vm group id. + * + * @return the multiVmGroupId value. + */ + public String multiVmGroupId() { + return this.multiVmGroupId; + } + + /** + * Set the multiVmGroupId property: The multi vm group id. + * + * @param multiVmGroupId the multiVmGroupId value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withMultiVmGroupId(String multiVmGroupId) { + this.multiVmGroupId = multiVmGroupId; + return this; + } + + /** + * Get the recoveryBootDiagStorageAccount property: The boot diagnostic storage account. + * + * @return the recoveryBootDiagStorageAccount value. + */ + public StorageAccountCustomDetails recoveryBootDiagStorageAccount() { + return this.recoveryBootDiagStorageAccount; + } + + /** + * Set the recoveryBootDiagStorageAccount property: The boot diagnostic storage account. + * + * @param recoveryBootDiagStorageAccount the recoveryBootDiagStorageAccount value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryBootDiagStorageAccount( + StorageAccountCustomDetails recoveryBootDiagStorageAccount) { + this.recoveryBootDiagStorageAccount = recoveryBootDiagStorageAccount; + return this; + } + + /** + * Get the diskEncryptionInfo property: The recovery disk encryption information (for two pass flows). + * + * @return the diskEncryptionInfo value. + */ + public DiskEncryptionInfo diskEncryptionInfo() { + return this.diskEncryptionInfo; + } + + /** + * Set the diskEncryptionInfo property: The recovery disk encryption information (for two pass flows). + * + * @param diskEncryptionInfo the diskEncryptionInfo value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withDiskEncryptionInfo(DiskEncryptionInfo diskEncryptionInfo) { + this.diskEncryptionInfo = diskEncryptionInfo; + return this; + } + + /** + * Get the recoveryAvailabilityZone property: The recovery availability zone. + * + * @return the recoveryAvailabilityZone value. + */ + public String recoveryAvailabilityZone() { + return this.recoveryAvailabilityZone; + } + + /** + * Set the recoveryAvailabilityZone property: The recovery availability zone. + * + * @param recoveryAvailabilityZone the recoveryAvailabilityZone value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryAvailabilityZone(String recoveryAvailabilityZone) { + this.recoveryAvailabilityZone = recoveryAvailabilityZone; + return this; + } + + /** + * Get the recoveryAvailabilityType property: The recovery availability type of the virtual machine. + * + * @return the recoveryAvailabilityType value. + */ + public String recoveryAvailabilityType() { + return this.recoveryAvailabilityType; + } + + /** + * Set the recoveryAvailabilityType property: The recovery availability type of the virtual machine. + * + * @param recoveryAvailabilityType the recoveryAvailabilityType value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryAvailabilityType(String recoveryAvailabilityType) { + this.recoveryAvailabilityType = recoveryAvailabilityType; + return this; + } + + /** + * Get the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @return the agentAutoUpdateStatus value. + */ + public AgentAutoUpdateStatus agentAutoUpdateStatus() { + return this.agentAutoUpdateStatus; + } + + /** + * Set the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @param agentAutoUpdateStatus the agentAutoUpdateStatus value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withAgentAutoUpdateStatus(AgentAutoUpdateStatus agentAutoUpdateStatus) { + this.agentAutoUpdateStatus = agentAutoUpdateStatus; + return this; + } + + /** + * Get the automationAccountArmId property: The automation account arm id. + * + * @return the automationAccountArmId value. + */ + public String automationAccountArmId() { + return this.automationAccountArmId; + } + + /** + * Set the automationAccountArmId property: The automation account arm id. + * + * @param automationAccountArmId the automationAccountArmId value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withAutomationAccountArmId(String automationAccountArmId) { + this.automationAccountArmId = automationAccountArmId; + return this; + } + + /** + * Get the automationAccountAuthenticationType property: A value indicating the type authentication to use for + * automation Account. + * + * @return the automationAccountAuthenticationType value. + */ + public AutomationAccountAuthenticationType automationAccountAuthenticationType() { + return this.automationAccountAuthenticationType; + } + + /** + * Set the automationAccountAuthenticationType property: A value indicating the type authentication to use for + * automation Account. + * + * @param automationAccountAuthenticationType the automationAccountAuthenticationType value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withAutomationAccountAuthenticationType( + AutomationAccountAuthenticationType automationAccountAuthenticationType) { + this.automationAccountAuthenticationType = automationAccountAuthenticationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + if (vmManagedDisks() != null) { + vmManagedDisks().forEach(e -> e.validate()); + } + if (protectionProfile() != null) { + protectionProfile().validate(); + } + if (primaryStagingStorageAccount() != null) { + primaryStagingStorageAccount().validate(); + } + if (recoveryAvailabilitySet() != null) { + recoveryAvailabilitySet().validate(); + } + if (recoveryVirtualNetwork() != null) { + recoveryVirtualNetwork().validate(); + } + if (recoveryProximityPlacementGroup() != null) { + recoveryProximityPlacementGroup().validate(); + } + if (recoveryBootDiagStorageAccount() != null) { + recoveryBootDiagStorageAccount().validate(); + } + if (diskEncryptionInfo() != null) { + diskEncryptionInfo().validate(); + } + if (recoveryAvailabilityType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryAvailabilityType in model A2AReplicationIntentDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(A2AReplicationIntentDetails.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReprotectInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReprotectInput.java new file mode 100644 index 000000000000..2aa64d4af62d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReprotectInput.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.recoveryservicessiterecovery.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; +import java.util.List; + +/** Azure specific reprotect input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AReprotectInput extends ReverseReplicationProviderSpecificInput { + /* + * The recovery container Id. + */ + @JsonProperty(value = "recoveryContainerId") + private String recoveryContainerId; + + /* + * The list of vm disk details. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /* + * The recovery resource group Id. Valid for V2 scenarios. + */ + @JsonProperty(value = "recoveryResourceGroupId") + private String recoveryResourceGroupId; + + /* + * The recovery cloud service Id. Valid for V1 scenarios. + */ + @JsonProperty(value = "recoveryCloudServiceId") + private String recoveryCloudServiceId; + + /* + * The recovery availability set. + */ + @JsonProperty(value = "recoveryAvailabilitySetId") + private String recoveryAvailabilitySetId; + + /* + * The Policy Id. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /** Creates an instance of A2AReprotectInput class. */ + public A2AReprotectInput() { + } + + /** + * Get the recoveryContainerId property: The recovery container Id. + * + * @return the recoveryContainerId value. + */ + public String recoveryContainerId() { + return this.recoveryContainerId; + } + + /** + * Set the recoveryContainerId property: The recovery container Id. + * + * @param recoveryContainerId the recoveryContainerId value to set. + * @return the A2AReprotectInput object itself. + */ + public A2AReprotectInput withRecoveryContainerId(String recoveryContainerId) { + this.recoveryContainerId = recoveryContainerId; + return this; + } + + /** + * Get the vmDisks property: The list of vm disk details. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of vm disk details. + * + * @param vmDisks the vmDisks value to set. + * @return the A2AReprotectInput object itself. + */ + public A2AReprotectInput withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Get the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @return the recoveryResourceGroupId value. + */ + public String recoveryResourceGroupId() { + return this.recoveryResourceGroupId; + } + + /** + * Set the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @param recoveryResourceGroupId the recoveryResourceGroupId value to set. + * @return the A2AReprotectInput object itself. + */ + public A2AReprotectInput withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Get the recoveryCloudServiceId property: The recovery cloud service Id. Valid for V1 scenarios. + * + * @return the recoveryCloudServiceId value. + */ + public String recoveryCloudServiceId() { + return this.recoveryCloudServiceId; + } + + /** + * Set the recoveryCloudServiceId property: The recovery cloud service Id. Valid for V1 scenarios. + * + * @param recoveryCloudServiceId the recoveryCloudServiceId value to set. + * @return the A2AReprotectInput object itself. + */ + public A2AReprotectInput withRecoveryCloudServiceId(String recoveryCloudServiceId) { + this.recoveryCloudServiceId = recoveryCloudServiceId; + return this; + } + + /** + * Get the recoveryAvailabilitySetId property: The recovery availability set. + * + * @return the recoveryAvailabilitySetId value. + */ + public String recoveryAvailabilitySetId() { + return this.recoveryAvailabilitySetId; + } + + /** + * Set the recoveryAvailabilitySetId property: The recovery availability set. + * + * @param recoveryAvailabilitySetId the recoveryAvailabilitySetId value to set. + * @return the A2AReprotectInput object itself. + */ + public A2AReprotectInput withRecoveryAvailabilitySetId(String recoveryAvailabilitySetId) { + this.recoveryAvailabilitySetId = recoveryAvailabilitySetId; + return this; + } + + /** + * Get the policyId property: The Policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: The Policy Id. + * + * @param policyId the policyId value to set. + * @return the A2AReprotectInput object itself. + */ + public A2AReprotectInput withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARpRecoveryPointType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARpRecoveryPointType.java new file mode 100644 index 000000000000..14048127470a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARpRecoveryPointType.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recovery point type. */ +public final class A2ARpRecoveryPointType extends ExpandableStringEnum { + /** Static value Latest for A2ARpRecoveryPointType. */ + public static final A2ARpRecoveryPointType LATEST = fromString("Latest"); + + /** Static value LatestApplicationConsistent for A2ARpRecoveryPointType. */ + public static final A2ARpRecoveryPointType LATEST_APPLICATION_CONSISTENT = + fromString("LatestApplicationConsistent"); + + /** Static value LatestCrashConsistent for A2ARpRecoveryPointType. */ + public static final A2ARpRecoveryPointType LATEST_CRASH_CONSISTENT = fromString("LatestCrashConsistent"); + + /** Static value LatestProcessed for A2ARpRecoveryPointType. */ + public static final A2ARpRecoveryPointType LATEST_PROCESSED = fromString("LatestProcessed"); + + /** + * Creates or finds a A2ARpRecoveryPointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding A2ARpRecoveryPointType. + */ + @JsonCreator + public static A2ARpRecoveryPointType fromString(String name) { + return fromString(name, A2ARpRecoveryPointType.class); + } + + /** + * Gets known A2ARpRecoveryPointType values. + * + * @return known A2ARpRecoveryPointType values. + */ + public static Collection values() { + return values(A2ARpRecoveryPointType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ASwitchProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ASwitchProtectionInput.java new file mode 100644 index 000000000000..a25c8eb3568d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ASwitchProtectionInput.java @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; + +/** A2A specific switch protection input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2ASwitchProtectionInput extends SwitchProtectionProviderSpecificInput { + /* + * The recovery container Id. + */ + @JsonProperty(value = "recoveryContainerId") + private String recoveryContainerId; + + /* + * The list of vm disk details. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /* + * The list of vm managed disk details. + */ + @JsonProperty(value = "vmManagedDisks") + private List vmManagedDisks; + + /* + * The recovery resource group Id. Valid for V2 scenarios. + */ + @JsonProperty(value = "recoveryResourceGroupId") + private String recoveryResourceGroupId; + + /* + * The recovery cloud service Id. Valid for V1 scenarios. + */ + @JsonProperty(value = "recoveryCloudServiceId") + private String recoveryCloudServiceId; + + /* + * The recovery availability set. + */ + @JsonProperty(value = "recoveryAvailabilitySetId") + private String recoveryAvailabilitySetId; + + /* + * The Policy Id. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * The boot diagnostic storage account. + */ + @JsonProperty(value = "recoveryBootDiagStorageAccountId") + private String recoveryBootDiagStorageAccountId; + + /* + * The recovery availability zone. + */ + @JsonProperty(value = "recoveryAvailabilityZone") + private String recoveryAvailabilityZone; + + /* + * The recovery proximity placement group Id. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /* + * The virtual machine scale set id. + */ + @JsonProperty(value = "recoveryVirtualMachineScaleSetId") + private String recoveryVirtualMachineScaleSetId; + + /* + * The recovery capacity reservation group Id. + */ + @JsonProperty(value = "recoveryCapacityReservationGroupId") + private String recoveryCapacityReservationGroupId; + + /* + * The recovery disk encryption information. + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /** Creates an instance of A2ASwitchProtectionInput class. */ + public A2ASwitchProtectionInput() { + } + + /** + * Get the recoveryContainerId property: The recovery container Id. + * + * @return the recoveryContainerId value. + */ + public String recoveryContainerId() { + return this.recoveryContainerId; + } + + /** + * Set the recoveryContainerId property: The recovery container Id. + * + * @param recoveryContainerId the recoveryContainerId value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withRecoveryContainerId(String recoveryContainerId) { + this.recoveryContainerId = recoveryContainerId; + return this; + } + + /** + * Get the vmDisks property: The list of vm disk details. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of vm disk details. + * + * @param vmDisks the vmDisks value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Get the vmManagedDisks property: The list of vm managed disk details. + * + * @return the vmManagedDisks value. + */ + public List vmManagedDisks() { + return this.vmManagedDisks; + } + + /** + * Set the vmManagedDisks property: The list of vm managed disk details. + * + * @param vmManagedDisks the vmManagedDisks value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withVmManagedDisks(List vmManagedDisks) { + this.vmManagedDisks = vmManagedDisks; + return this; + } + + /** + * Get the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @return the recoveryResourceGroupId value. + */ + public String recoveryResourceGroupId() { + return this.recoveryResourceGroupId; + } + + /** + * Set the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @param recoveryResourceGroupId the recoveryResourceGroupId value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Get the recoveryCloudServiceId property: The recovery cloud service Id. Valid for V1 scenarios. + * + * @return the recoveryCloudServiceId value. + */ + public String recoveryCloudServiceId() { + return this.recoveryCloudServiceId; + } + + /** + * Set the recoveryCloudServiceId property: The recovery cloud service Id. Valid for V1 scenarios. + * + * @param recoveryCloudServiceId the recoveryCloudServiceId value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withRecoveryCloudServiceId(String recoveryCloudServiceId) { + this.recoveryCloudServiceId = recoveryCloudServiceId; + return this; + } + + /** + * Get the recoveryAvailabilitySetId property: The recovery availability set. + * + * @return the recoveryAvailabilitySetId value. + */ + public String recoveryAvailabilitySetId() { + return this.recoveryAvailabilitySetId; + } + + /** + * Set the recoveryAvailabilitySetId property: The recovery availability set. + * + * @param recoveryAvailabilitySetId the recoveryAvailabilitySetId value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withRecoveryAvailabilitySetId(String recoveryAvailabilitySetId) { + this.recoveryAvailabilitySetId = recoveryAvailabilitySetId; + return this; + } + + /** + * Get the policyId property: The Policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: The Policy Id. + * + * @param policyId the policyId value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the recoveryBootDiagStorageAccountId property: The boot diagnostic storage account. + * + * @return the recoveryBootDiagStorageAccountId value. + */ + public String recoveryBootDiagStorageAccountId() { + return this.recoveryBootDiagStorageAccountId; + } + + /** + * Set the recoveryBootDiagStorageAccountId property: The boot diagnostic storage account. + * + * @param recoveryBootDiagStorageAccountId the recoveryBootDiagStorageAccountId value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withRecoveryBootDiagStorageAccountId(String recoveryBootDiagStorageAccountId) { + this.recoveryBootDiagStorageAccountId = recoveryBootDiagStorageAccountId; + return this; + } + + /** + * Get the recoveryAvailabilityZone property: The recovery availability zone. + * + * @return the recoveryAvailabilityZone value. + */ + public String recoveryAvailabilityZone() { + return this.recoveryAvailabilityZone; + } + + /** + * Set the recoveryAvailabilityZone property: The recovery availability zone. + * + * @param recoveryAvailabilityZone the recoveryAvailabilityZone value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withRecoveryAvailabilityZone(String recoveryAvailabilityZone) { + this.recoveryAvailabilityZone = recoveryAvailabilityZone; + return this; + } + + /** + * Get the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. + * + * @return the recoveryProximityPlacementGroupId value. + */ + public String recoveryProximityPlacementGroupId() { + return this.recoveryProximityPlacementGroupId; + } + + /** + * Set the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. + * + * @param recoveryProximityPlacementGroupId the recoveryProximityPlacementGroupId value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withRecoveryProximityPlacementGroupId(String recoveryProximityPlacementGroupId) { + this.recoveryProximityPlacementGroupId = recoveryProximityPlacementGroupId; + return this; + } + + /** + * Get the recoveryVirtualMachineScaleSetId property: The virtual machine scale set id. + * + * @return the recoveryVirtualMachineScaleSetId value. + */ + public String recoveryVirtualMachineScaleSetId() { + return this.recoveryVirtualMachineScaleSetId; + } + + /** + * Set the recoveryVirtualMachineScaleSetId property: The virtual machine scale set id. + * + * @param recoveryVirtualMachineScaleSetId the recoveryVirtualMachineScaleSetId value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withRecoveryVirtualMachineScaleSetId(String recoveryVirtualMachineScaleSetId) { + this.recoveryVirtualMachineScaleSetId = recoveryVirtualMachineScaleSetId; + return this; + } + + /** + * Get the recoveryCapacityReservationGroupId property: The recovery capacity reservation group Id. + * + * @return the recoveryCapacityReservationGroupId value. + */ + public String recoveryCapacityReservationGroupId() { + return this.recoveryCapacityReservationGroupId; + } + + /** + * Set the recoveryCapacityReservationGroupId property: The recovery capacity reservation group Id. + * + * @param recoveryCapacityReservationGroupId the recoveryCapacityReservationGroupId value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withRecoveryCapacityReservationGroupId(String recoveryCapacityReservationGroupId) { + this.recoveryCapacityReservationGroupId = recoveryCapacityReservationGroupId; + return this; + } + + /** + * Get the diskEncryptionInfo property: The recovery disk encryption information. + * + * @return the diskEncryptionInfo value. + */ + public DiskEncryptionInfo diskEncryptionInfo() { + return this.diskEncryptionInfo; + } + + /** + * Set the diskEncryptionInfo property: The recovery disk encryption information. + * + * @param diskEncryptionInfo the diskEncryptionInfo value to set. + * @return the A2ASwitchProtectionInput object itself. + */ + public A2ASwitchProtectionInput withDiskEncryptionInfo(DiskEncryptionInfo diskEncryptionInfo) { + this.diskEncryptionInfo = diskEncryptionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + if (vmManagedDisks() != null) { + vmManagedDisks().forEach(e -> e.validate()); + } + if (diskEncryptionInfo() != null) { + diskEncryptionInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ATestFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ATestFailoverInput.java new file mode 100644 index 000000000000..45bcc7f67dda --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ATestFailoverInput.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A provider specific input for test failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2ATestFailoverInput extends TestFailoverProviderSpecificInput { + /* + * The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery + * point, null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /* + * A value indicating whether to use recovery cloud service for TFO or not. + */ + @JsonProperty(value = "cloudServiceCreationOption") + private String cloudServiceCreationOption; + + /** Creates an instance of A2ATestFailoverInput class. */ + public A2ATestFailoverInput() { + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the A2ATestFailoverInput object itself. + */ + public A2ATestFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the cloudServiceCreationOption property: A value indicating whether to use recovery cloud service for TFO or + * not. + * + * @return the cloudServiceCreationOption value. + */ + public String cloudServiceCreationOption() { + return this.cloudServiceCreationOption; + } + + /** + * Set the cloudServiceCreationOption property: A value indicating whether to use recovery cloud service for TFO or + * not. + * + * @param cloudServiceCreationOption the cloudServiceCreationOption value to set. + * @return the A2ATestFailoverInput object itself. + */ + public A2ATestFailoverInput withCloudServiceCreationOption(String cloudServiceCreationOption) { + this.cloudServiceCreationOption = cloudServiceCreationOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnplannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnplannedFailoverInput.java new file mode 100644 index 000000000000..29a6f4e086f9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnplannedFailoverInput.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A provider specific input for unplanned failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AUnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { + /* + * The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, + * null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /* + * A value indicating whether to use recovery cloud service for failover or not. + */ + @JsonProperty(value = "cloudServiceCreationOption") + private String cloudServiceCreationOption; + + /** Creates an instance of A2AUnplannedFailoverInput class. */ + public A2AUnplannedFailoverInput() { + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the A2AUnplannedFailoverInput object itself. + */ + public A2AUnplannedFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the cloudServiceCreationOption property: A value indicating whether to use recovery cloud service for + * failover or not. + * + * @return the cloudServiceCreationOption value. + */ + public String cloudServiceCreationOption() { + return this.cloudServiceCreationOption; + } + + /** + * Set the cloudServiceCreationOption property: A value indicating whether to use recovery cloud service for + * failover or not. + * + * @param cloudServiceCreationOption the cloudServiceCreationOption value to set. + * @return the A2AUnplannedFailoverInput object itself. + */ + public A2AUnplannedFailoverInput withCloudServiceCreationOption(String cloudServiceCreationOption) { + this.cloudServiceCreationOption = cloudServiceCreationOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnprotectedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnprotectedDiskDetails.java new file mode 100644 index 000000000000..638ff666b381 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnprotectedDiskDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A2A unprotected disk details. */ +@Fluent +public final class A2AUnprotectedDiskDetails { + /* + * The source lun Id for the data disk. + */ + @JsonProperty(value = "diskLunId") + private Integer diskLunId; + + /* + * A value indicating whether the disk auto protection is enabled. + */ + @JsonProperty(value = "diskAutoProtectionStatus") + private AutoProtectionOfDataDisk diskAutoProtectionStatus; + + /** Creates an instance of A2AUnprotectedDiskDetails class. */ + public A2AUnprotectedDiskDetails() { + } + + /** + * Get the diskLunId property: The source lun Id for the data disk. + * + * @return the diskLunId value. + */ + public Integer diskLunId() { + return this.diskLunId; + } + + /** + * Set the diskLunId property: The source lun Id for the data disk. + * + * @param diskLunId the diskLunId value to set. + * @return the A2AUnprotectedDiskDetails object itself. + */ + public A2AUnprotectedDiskDetails withDiskLunId(Integer diskLunId) { + this.diskLunId = diskLunId; + return this; + } + + /** + * Get the diskAutoProtectionStatus property: A value indicating whether the disk auto protection is enabled. + * + * @return the diskAutoProtectionStatus value. + */ + public AutoProtectionOfDataDisk diskAutoProtectionStatus() { + return this.diskAutoProtectionStatus; + } + + /** + * Set the diskAutoProtectionStatus property: A value indicating whether the disk auto protection is enabled. + * + * @param diskAutoProtectionStatus the diskAutoProtectionStatus value to set. + * @return the A2AUnprotectedDiskDetails object itself. + */ + public A2AUnprotectedDiskDetails withDiskAutoProtectionStatus(AutoProtectionOfDataDisk diskAutoProtectionStatus) { + this.diskAutoProtectionStatus = diskAutoProtectionStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateContainerMappingInput.java new file mode 100644 index 000000000000..ebf65a0b60f6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateContainerMappingInput.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** A2A update protection container mapping. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AUpdateContainerMappingInput extends ReplicationProviderSpecificUpdateContainerMappingInput { + /* + * A value indicating whether the auto update is enabled. + */ + @JsonProperty(value = "agentAutoUpdateStatus") + private AgentAutoUpdateStatus agentAutoUpdateStatus; + + /* + * The automation account arm id. + */ + @JsonProperty(value = "automationAccountArmId") + private String automationAccountArmId; + + /* + * A value indicating the type authentication to use for automation Account. + */ + @JsonProperty(value = "automationAccountAuthenticationType") + private AutomationAccountAuthenticationType automationAccountAuthenticationType; + + /** Creates an instance of A2AUpdateContainerMappingInput class. */ + public A2AUpdateContainerMappingInput() { + } + + /** + * Get the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @return the agentAutoUpdateStatus value. + */ + public AgentAutoUpdateStatus agentAutoUpdateStatus() { + return this.agentAutoUpdateStatus; + } + + /** + * Set the agentAutoUpdateStatus property: A value indicating whether the auto update is enabled. + * + * @param agentAutoUpdateStatus the agentAutoUpdateStatus value to set. + * @return the A2AUpdateContainerMappingInput object itself. + */ + public A2AUpdateContainerMappingInput withAgentAutoUpdateStatus(AgentAutoUpdateStatus agentAutoUpdateStatus) { + this.agentAutoUpdateStatus = agentAutoUpdateStatus; + return this; + } + + /** + * Get the automationAccountArmId property: The automation account arm id. + * + * @return the automationAccountArmId value. + */ + public String automationAccountArmId() { + return this.automationAccountArmId; + } + + /** + * Set the automationAccountArmId property: The automation account arm id. + * + * @param automationAccountArmId the automationAccountArmId value to set. + * @return the A2AUpdateContainerMappingInput object itself. + */ + public A2AUpdateContainerMappingInput withAutomationAccountArmId(String automationAccountArmId) { + this.automationAccountArmId = automationAccountArmId; + return this; + } + + /** + * Get the automationAccountAuthenticationType property: A value indicating the type authentication to use for + * automation Account. + * + * @return the automationAccountAuthenticationType value. + */ + public AutomationAccountAuthenticationType automationAccountAuthenticationType() { + return this.automationAccountAuthenticationType; + } + + /** + * Set the automationAccountAuthenticationType property: A value indicating the type authentication to use for + * automation Account. + * + * @param automationAccountAuthenticationType the automationAccountAuthenticationType value to set. + * @return the A2AUpdateContainerMappingInput object itself. + */ + public A2AUpdateContainerMappingInput withAutomationAccountAuthenticationType( + AutomationAccountAuthenticationType automationAccountAuthenticationType) { + this.automationAccountAuthenticationType = automationAccountAuthenticationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateReplicationProtectedItemInput.java new file mode 100644 index 000000000000..12fb8f0e9938 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateReplicationProtectedItemInput.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; + +/** InMage Azure V2 input to update replication protected item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AUpdateReplicationProtectedItemInput extends UpdateReplicationProtectedItemProviderInput { + /* + * The target cloud service ARM Id (for V1). + */ + @JsonProperty(value = "recoveryCloudServiceId") + private String recoveryCloudServiceId; + + /* + * The target resource group ARM Id (for V2). + */ + @JsonProperty(value = "recoveryResourceGroupId") + private String recoveryResourceGroupId; + + /* + * Managed disk update details. + */ + @JsonProperty(value = "managedDiskUpdateDetails") + private List managedDiskUpdateDetails; + + /* + * The boot diagnostic storage account. + */ + @JsonProperty(value = "recoveryBootDiagStorageAccountId") + private String recoveryBootDiagStorageAccountId; + + /* + * The recovery os disk encryption information. + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /* + * The user given name for Test Failover VM. + */ + @JsonProperty(value = "tfoAzureVMName") + private String tfoAzureVMName; + + /* + * The recovery proximity placement group Id. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /* + * The recovery virtual machine scale set Id. + */ + @JsonProperty(value = "recoveryVirtualMachineScaleSetId") + private String recoveryVirtualMachineScaleSetId; + + /* + * The recovery capacity reservation group Id. + */ + @JsonProperty(value = "recoveryCapacityReservationGroupId") + private String recoveryCapacityReservationGroupId; + + /** Creates an instance of A2AUpdateReplicationProtectedItemInput class. */ + public A2AUpdateReplicationProtectedItemInput() { + } + + /** + * Get the recoveryCloudServiceId property: The target cloud service ARM Id (for V1). + * + * @return the recoveryCloudServiceId value. + */ + public String recoveryCloudServiceId() { + return this.recoveryCloudServiceId; + } + + /** + * Set the recoveryCloudServiceId property: The target cloud service ARM Id (for V1). + * + * @param recoveryCloudServiceId the recoveryCloudServiceId value to set. + * @return the A2AUpdateReplicationProtectedItemInput object itself. + */ + public A2AUpdateReplicationProtectedItemInput withRecoveryCloudServiceId(String recoveryCloudServiceId) { + this.recoveryCloudServiceId = recoveryCloudServiceId; + return this; + } + + /** + * Get the recoveryResourceGroupId property: The target resource group ARM Id (for V2). + * + * @return the recoveryResourceGroupId value. + */ + public String recoveryResourceGroupId() { + return this.recoveryResourceGroupId; + } + + /** + * Set the recoveryResourceGroupId property: The target resource group ARM Id (for V2). + * + * @param recoveryResourceGroupId the recoveryResourceGroupId value to set. + * @return the A2AUpdateReplicationProtectedItemInput object itself. + */ + public A2AUpdateReplicationProtectedItemInput withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Get the managedDiskUpdateDetails property: Managed disk update details. + * + * @return the managedDiskUpdateDetails value. + */ + public List managedDiskUpdateDetails() { + return this.managedDiskUpdateDetails; + } + + /** + * Set the managedDiskUpdateDetails property: Managed disk update details. + * + * @param managedDiskUpdateDetails the managedDiskUpdateDetails value to set. + * @return the A2AUpdateReplicationProtectedItemInput object itself. + */ + public A2AUpdateReplicationProtectedItemInput withManagedDiskUpdateDetails( + List managedDiskUpdateDetails) { + this.managedDiskUpdateDetails = managedDiskUpdateDetails; + return this; + } + + /** + * Get the recoveryBootDiagStorageAccountId property: The boot diagnostic storage account. + * + * @return the recoveryBootDiagStorageAccountId value. + */ + public String recoveryBootDiagStorageAccountId() { + return this.recoveryBootDiagStorageAccountId; + } + + /** + * Set the recoveryBootDiagStorageAccountId property: The boot diagnostic storage account. + * + * @param recoveryBootDiagStorageAccountId the recoveryBootDiagStorageAccountId value to set. + * @return the A2AUpdateReplicationProtectedItemInput object itself. + */ + public A2AUpdateReplicationProtectedItemInput withRecoveryBootDiagStorageAccountId( + String recoveryBootDiagStorageAccountId) { + this.recoveryBootDiagStorageAccountId = recoveryBootDiagStorageAccountId; + return this; + } + + /** + * Get the diskEncryptionInfo property: The recovery os disk encryption information. + * + * @return the diskEncryptionInfo value. + */ + public DiskEncryptionInfo diskEncryptionInfo() { + return this.diskEncryptionInfo; + } + + /** + * Set the diskEncryptionInfo property: The recovery os disk encryption information. + * + * @param diskEncryptionInfo the diskEncryptionInfo value to set. + * @return the A2AUpdateReplicationProtectedItemInput object itself. + */ + public A2AUpdateReplicationProtectedItemInput withDiskEncryptionInfo(DiskEncryptionInfo diskEncryptionInfo) { + this.diskEncryptionInfo = diskEncryptionInfo; + return this; + } + + /** + * Get the tfoAzureVMName property: The user given name for Test Failover VM. + * + * @return the tfoAzureVMName value. + */ + public String tfoAzureVMName() { + return this.tfoAzureVMName; + } + + /** + * Set the tfoAzureVMName property: The user given name for Test Failover VM. + * + * @param tfoAzureVMName the tfoAzureVMName value to set. + * @return the A2AUpdateReplicationProtectedItemInput object itself. + */ + public A2AUpdateReplicationProtectedItemInput withTfoAzureVMName(String tfoAzureVMName) { + this.tfoAzureVMName = tfoAzureVMName; + return this; + } + + /** + * Get the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. + * + * @return the recoveryProximityPlacementGroupId value. + */ + public String recoveryProximityPlacementGroupId() { + return this.recoveryProximityPlacementGroupId; + } + + /** + * Set the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. + * + * @param recoveryProximityPlacementGroupId the recoveryProximityPlacementGroupId value to set. + * @return the A2AUpdateReplicationProtectedItemInput object itself. + */ + public A2AUpdateReplicationProtectedItemInput withRecoveryProximityPlacementGroupId( + String recoveryProximityPlacementGroupId) { + this.recoveryProximityPlacementGroupId = recoveryProximityPlacementGroupId; + return this; + } + + /** + * Get the recoveryVirtualMachineScaleSetId property: The recovery virtual machine scale set Id. + * + * @return the recoveryVirtualMachineScaleSetId value. + */ + public String recoveryVirtualMachineScaleSetId() { + return this.recoveryVirtualMachineScaleSetId; + } + + /** + * Set the recoveryVirtualMachineScaleSetId property: The recovery virtual machine scale set Id. + * + * @param recoveryVirtualMachineScaleSetId the recoveryVirtualMachineScaleSetId value to set. + * @return the A2AUpdateReplicationProtectedItemInput object itself. + */ + public A2AUpdateReplicationProtectedItemInput withRecoveryVirtualMachineScaleSetId( + String recoveryVirtualMachineScaleSetId) { + this.recoveryVirtualMachineScaleSetId = recoveryVirtualMachineScaleSetId; + return this; + } + + /** + * Get the recoveryCapacityReservationGroupId property: The recovery capacity reservation group Id. + * + * @return the recoveryCapacityReservationGroupId value. + */ + public String recoveryCapacityReservationGroupId() { + return this.recoveryCapacityReservationGroupId; + } + + /** + * Set the recoveryCapacityReservationGroupId property: The recovery capacity reservation group Id. + * + * @param recoveryCapacityReservationGroupId the recoveryCapacityReservationGroupId value to set. + * @return the A2AUpdateReplicationProtectedItemInput object itself. + */ + public A2AUpdateReplicationProtectedItemInput withRecoveryCapacityReservationGroupId( + String recoveryCapacityReservationGroupId) { + this.recoveryCapacityReservationGroupId = recoveryCapacityReservationGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (managedDiskUpdateDetails() != null) { + managedDiskUpdateDetails().forEach(e -> e.validate()); + } + if (diskEncryptionInfo() != null) { + diskEncryptionInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmDiskInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmDiskInputDetails.java new file mode 100644 index 000000000000..17e4213c947f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmDiskInputDetails.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A2A disk input details. */ +@Fluent +public final class A2AVmDiskInputDetails { + /* + * The disk Uri. + */ + @JsonProperty(value = "diskUri", required = true) + private String diskUri; + + /* + * The recovery VHD storage account Id. + */ + @JsonProperty(value = "recoveryAzureStorageAccountId", required = true) + private String recoveryAzureStorageAccountId; + + /* + * The primary staging storage account Id. + */ + @JsonProperty(value = "primaryStagingAzureStorageAccountId", required = true) + private String primaryStagingAzureStorageAccountId; + + /** Creates an instance of A2AVmDiskInputDetails class. */ + public A2AVmDiskInputDetails() { + } + + /** + * Get the diskUri property: The disk Uri. + * + * @return the diskUri value. + */ + public String diskUri() { + return this.diskUri; + } + + /** + * Set the diskUri property: The disk Uri. + * + * @param diskUri the diskUri value to set. + * @return the A2AVmDiskInputDetails object itself. + */ + public A2AVmDiskInputDetails withDiskUri(String diskUri) { + this.diskUri = diskUri; + return this; + } + + /** + * Get the recoveryAzureStorageAccountId property: The recovery VHD storage account Id. + * + * @return the recoveryAzureStorageAccountId value. + */ + public String recoveryAzureStorageAccountId() { + return this.recoveryAzureStorageAccountId; + } + + /** + * Set the recoveryAzureStorageAccountId property: The recovery VHD storage account Id. + * + * @param recoveryAzureStorageAccountId the recoveryAzureStorageAccountId value to set. + * @return the A2AVmDiskInputDetails object itself. + */ + public A2AVmDiskInputDetails withRecoveryAzureStorageAccountId(String recoveryAzureStorageAccountId) { + this.recoveryAzureStorageAccountId = recoveryAzureStorageAccountId; + return this; + } + + /** + * Get the primaryStagingAzureStorageAccountId property: The primary staging storage account Id. + * + * @return the primaryStagingAzureStorageAccountId value. + */ + public String primaryStagingAzureStorageAccountId() { + return this.primaryStagingAzureStorageAccountId; + } + + /** + * Set the primaryStagingAzureStorageAccountId property: The primary staging storage account Id. + * + * @param primaryStagingAzureStorageAccountId the primaryStagingAzureStorageAccountId value to set. + * @return the A2AVmDiskInputDetails object itself. + */ + public A2AVmDiskInputDetails withPrimaryStagingAzureStorageAccountId(String primaryStagingAzureStorageAccountId) { + this.primaryStagingAzureStorageAccountId = primaryStagingAzureStorageAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskUri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property diskUri in model A2AVmDiskInputDetails")); + } + if (recoveryAzureStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryAzureStorageAccountId in model A2AVmDiskInputDetails")); + } + if (primaryStagingAzureStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property primaryStagingAzureStorageAccountId in model" + + " A2AVmDiskInputDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(A2AVmDiskInputDetails.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskInputDetails.java new file mode 100644 index 000000000000..9697ffb042d5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskInputDetails.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A2A managed disk input details. */ +@Fluent +public final class A2AVmManagedDiskInputDetails { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId", required = true) + private String diskId; + + /* + * The primary staging storage account Arm Id. + */ + @JsonProperty(value = "primaryStagingAzureStorageAccountId", required = true) + private String primaryStagingAzureStorageAccountId; + + /* + * The target resource group Arm Id. + */ + @JsonProperty(value = "recoveryResourceGroupId", required = true) + private String recoveryResourceGroupId; + + /* + * The replica disk type. Its an optional value and will be same as source disk type if not user provided. + */ + @JsonProperty(value = "recoveryReplicaDiskAccountType") + private String recoveryReplicaDiskAccountType; + + /* + * The target disk type after failover. Its an optional value and will be same as source disk type if not user + * provided. + */ + @JsonProperty(value = "recoveryTargetDiskAccountType") + private String recoveryTargetDiskAccountType; + + /* + * The recovery disk encryption set Id. + */ + @JsonProperty(value = "recoveryDiskEncryptionSetId") + private String recoveryDiskEncryptionSetId; + + /* + * The recovery disk encryption information (for one / single pass flows). + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /** Creates an instance of A2AVmManagedDiskInputDetails class. */ + public A2AVmManagedDiskInputDetails() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk Id. + * + * @param diskId the diskId value to set. + * @return the A2AVmManagedDiskInputDetails object itself. + */ + public A2AVmManagedDiskInputDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the primaryStagingAzureStorageAccountId property: The primary staging storage account Arm Id. + * + * @return the primaryStagingAzureStorageAccountId value. + */ + public String primaryStagingAzureStorageAccountId() { + return this.primaryStagingAzureStorageAccountId; + } + + /** + * Set the primaryStagingAzureStorageAccountId property: The primary staging storage account Arm Id. + * + * @param primaryStagingAzureStorageAccountId the primaryStagingAzureStorageAccountId value to set. + * @return the A2AVmManagedDiskInputDetails object itself. + */ + public A2AVmManagedDiskInputDetails withPrimaryStagingAzureStorageAccountId( + String primaryStagingAzureStorageAccountId) { + this.primaryStagingAzureStorageAccountId = primaryStagingAzureStorageAccountId; + return this; + } + + /** + * Get the recoveryResourceGroupId property: The target resource group Arm Id. + * + * @return the recoveryResourceGroupId value. + */ + public String recoveryResourceGroupId() { + return this.recoveryResourceGroupId; + } + + /** + * Set the recoveryResourceGroupId property: The target resource group Arm Id. + * + * @param recoveryResourceGroupId the recoveryResourceGroupId value to set. + * @return the A2AVmManagedDiskInputDetails object itself. + */ + public A2AVmManagedDiskInputDetails withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Get the recoveryReplicaDiskAccountType property: The replica disk type. Its an optional value and will be same as + * source disk type if not user provided. + * + * @return the recoveryReplicaDiskAccountType value. + */ + public String recoveryReplicaDiskAccountType() { + return this.recoveryReplicaDiskAccountType; + } + + /** + * Set the recoveryReplicaDiskAccountType property: The replica disk type. Its an optional value and will be same as + * source disk type if not user provided. + * + * @param recoveryReplicaDiskAccountType the recoveryReplicaDiskAccountType value to set. + * @return the A2AVmManagedDiskInputDetails object itself. + */ + public A2AVmManagedDiskInputDetails withRecoveryReplicaDiskAccountType(String recoveryReplicaDiskAccountType) { + this.recoveryReplicaDiskAccountType = recoveryReplicaDiskAccountType; + return this; + } + + /** + * Get the recoveryTargetDiskAccountType property: The target disk type after failover. Its an optional value and + * will be same as source disk type if not user provided. + * + * @return the recoveryTargetDiskAccountType value. + */ + public String recoveryTargetDiskAccountType() { + return this.recoveryTargetDiskAccountType; + } + + /** + * Set the recoveryTargetDiskAccountType property: The target disk type after failover. Its an optional value and + * will be same as source disk type if not user provided. + * + * @param recoveryTargetDiskAccountType the recoveryTargetDiskAccountType value to set. + * @return the A2AVmManagedDiskInputDetails object itself. + */ + public A2AVmManagedDiskInputDetails withRecoveryTargetDiskAccountType(String recoveryTargetDiskAccountType) { + this.recoveryTargetDiskAccountType = recoveryTargetDiskAccountType; + return this; + } + + /** + * Get the recoveryDiskEncryptionSetId property: The recovery disk encryption set Id. + * + * @return the recoveryDiskEncryptionSetId value. + */ + public String recoveryDiskEncryptionSetId() { + return this.recoveryDiskEncryptionSetId; + } + + /** + * Set the recoveryDiskEncryptionSetId property: The recovery disk encryption set Id. + * + * @param recoveryDiskEncryptionSetId the recoveryDiskEncryptionSetId value to set. + * @return the A2AVmManagedDiskInputDetails object itself. + */ + public A2AVmManagedDiskInputDetails withRecoveryDiskEncryptionSetId(String recoveryDiskEncryptionSetId) { + this.recoveryDiskEncryptionSetId = recoveryDiskEncryptionSetId; + return this; + } + + /** + * Get the diskEncryptionInfo property: The recovery disk encryption information (for one / single pass flows). + * + * @return the diskEncryptionInfo value. + */ + public DiskEncryptionInfo diskEncryptionInfo() { + return this.diskEncryptionInfo; + } + + /** + * Set the diskEncryptionInfo property: The recovery disk encryption information (for one / single pass flows). + * + * @param diskEncryptionInfo the diskEncryptionInfo value to set. + * @return the A2AVmManagedDiskInputDetails object itself. + */ + public A2AVmManagedDiskInputDetails withDiskEncryptionInfo(DiskEncryptionInfo diskEncryptionInfo) { + this.diskEncryptionInfo = diskEncryptionInfo; + 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 A2AVmManagedDiskInputDetails")); + } + if (primaryStagingAzureStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property primaryStagingAzureStorageAccountId in model" + + " A2AVmManagedDiskInputDetails")); + } + if (recoveryResourceGroupId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryResourceGroupId in model A2AVmManagedDiskInputDetails")); + } + if (diskEncryptionInfo() != null) { + diskEncryptionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(A2AVmManagedDiskInputDetails.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskUpdateDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskUpdateDetails.java new file mode 100644 index 000000000000..fd7342538cd5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskUpdateDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A2A Vm managed disk update details. */ +@Fluent +public final class A2AVmManagedDiskUpdateDetails { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The target disk type before failover. + */ + @JsonProperty(value = "recoveryTargetDiskAccountType") + private String recoveryTargetDiskAccountType; + + /* + * The replica disk type before failover. + */ + @JsonProperty(value = "recoveryReplicaDiskAccountType") + private String recoveryReplicaDiskAccountType; + + /* + * The recovery os disk encryption information. + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /* + * The target disk name for unplanned failover operation. + */ + @JsonProperty(value = "failoverDiskName") + private String failoverDiskName; + + /* + * The target disk name for test failover operation. + */ + @JsonProperty(value = "tfoDiskName") + private String tfoDiskName; + + /** Creates an instance of A2AVmManagedDiskUpdateDetails class. */ + public A2AVmManagedDiskUpdateDetails() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk Id. + * + * @param diskId the diskId value to set. + * @return the A2AVmManagedDiskUpdateDetails object itself. + */ + public A2AVmManagedDiskUpdateDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the recoveryTargetDiskAccountType property: The target disk type before failover. + * + * @return the recoveryTargetDiskAccountType value. + */ + public String recoveryTargetDiskAccountType() { + return this.recoveryTargetDiskAccountType; + } + + /** + * Set the recoveryTargetDiskAccountType property: The target disk type before failover. + * + * @param recoveryTargetDiskAccountType the recoveryTargetDiskAccountType value to set. + * @return the A2AVmManagedDiskUpdateDetails object itself. + */ + public A2AVmManagedDiskUpdateDetails withRecoveryTargetDiskAccountType(String recoveryTargetDiskAccountType) { + this.recoveryTargetDiskAccountType = recoveryTargetDiskAccountType; + return this; + } + + /** + * Get the recoveryReplicaDiskAccountType property: The replica disk type before failover. + * + * @return the recoveryReplicaDiskAccountType value. + */ + public String recoveryReplicaDiskAccountType() { + return this.recoveryReplicaDiskAccountType; + } + + /** + * Set the recoveryReplicaDiskAccountType property: The replica disk type before failover. + * + * @param recoveryReplicaDiskAccountType the recoveryReplicaDiskAccountType value to set. + * @return the A2AVmManagedDiskUpdateDetails object itself. + */ + public A2AVmManagedDiskUpdateDetails withRecoveryReplicaDiskAccountType(String recoveryReplicaDiskAccountType) { + this.recoveryReplicaDiskAccountType = recoveryReplicaDiskAccountType; + return this; + } + + /** + * Get the diskEncryptionInfo property: The recovery os disk encryption information. + * + * @return the diskEncryptionInfo value. + */ + public DiskEncryptionInfo diskEncryptionInfo() { + return this.diskEncryptionInfo; + } + + /** + * Set the diskEncryptionInfo property: The recovery os disk encryption information. + * + * @param diskEncryptionInfo the diskEncryptionInfo value to set. + * @return the A2AVmManagedDiskUpdateDetails object itself. + */ + public A2AVmManagedDiskUpdateDetails withDiskEncryptionInfo(DiskEncryptionInfo diskEncryptionInfo) { + this.diskEncryptionInfo = diskEncryptionInfo; + return this; + } + + /** + * Get the failoverDiskName property: The target disk name for unplanned failover operation. + * + * @return the failoverDiskName value. + */ + public String failoverDiskName() { + return this.failoverDiskName; + } + + /** + * Set the failoverDiskName property: The target disk name for unplanned failover operation. + * + * @param failoverDiskName the failoverDiskName value to set. + * @return the A2AVmManagedDiskUpdateDetails object itself. + */ + public A2AVmManagedDiskUpdateDetails withFailoverDiskName(String failoverDiskName) { + this.failoverDiskName = failoverDiskName; + return this; + } + + /** + * Get the tfoDiskName property: The target disk name for test failover operation. + * + * @return the tfoDiskName value. + */ + public String tfoDiskName() { + return this.tfoDiskName; + } + + /** + * Set the tfoDiskName property: The target disk name for test failover operation. + * + * @param tfoDiskName the tfoDiskName value to set. + * @return the A2AVmManagedDiskUpdateDetails object itself. + */ + public A2AVmManagedDiskUpdateDetails withTfoDiskName(String tfoDiskName) { + this.tfoDiskName = tfoDiskName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionInfo() != null) { + diskEncryptionInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AZoneDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AZoneDetails.java new file mode 100644 index 000000000000..7c3970da6cce --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AZoneDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Zone details data. */ +@Fluent +public final class A2AZoneDetails { + /* + * Source zone info. + */ + @JsonProperty(value = "source") + private String source; + + /* + * The target zone info. + */ + @JsonProperty(value = "target") + private String target; + + /** Creates an instance of A2AZoneDetails class. */ + public A2AZoneDetails() { + } + + /** + * Get the source property: Source zone info. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Source zone info. + * + * @param source the source value to set. + * @return the A2AZoneDetails object itself. + */ + public A2AZoneDetails withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the target property: The target zone info. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target zone info. + * + * @param target the target value to set. + * @return the A2AZoneDetails object itself. + */ + public A2AZoneDetails withTarget(String target) { + this.target = target; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInput.java new file mode 100644 index 000000000000..b263dc35aff0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for add disk(s) operation. */ +@Fluent +public final class AddDisksInput { + /* + * Add disks input properties. + */ + @JsonProperty(value = "properties") + private AddDisksInputProperties properties; + + /** Creates an instance of AddDisksInput class. */ + public AddDisksInput() { + } + + /** + * Get the properties property: Add disks input properties. + * + * @return the properties value. + */ + public AddDisksInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Add disks input properties. + * + * @param properties the properties value to set. + * @return the AddDisksInput object itself. + */ + public AddDisksInput withProperties(AddDisksInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInputProperties.java new file mode 100644 index 000000000000..b4165fb0b6f6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInputProperties.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Add Disks input properties. */ +@Fluent +public final class AddDisksInputProperties { + /* + * The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For + * San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private AddDisksProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of AddDisksInputProperties class. */ + public AddDisksInputProperties() { + } + + /** + * Get the providerSpecificDetails property: The ReplicationProviderInput. For HyperVReplicaAzure provider, it will + * be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For + * HyperVReplicaAzure provider, it can be null. + * + * @return the providerSpecificDetails value. + */ + public AddDisksProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The ReplicationProviderInput. For HyperVReplicaAzure provider, it will + * be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For + * HyperVReplicaAzure provider, it can be null. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the AddDisksInputProperties object itself. + */ + public AddDisksInputProperties withProviderSpecificDetails(AddDisksProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerSpecificDetails in model AddDisksInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AddDisksInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksProviderSpecificInput.java new file mode 100644 index 000000000000..37941c5fd797 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Add Disks provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = AddDisksProviderSpecificInput.class) +@JsonTypeName("AddDisksProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "A2A", value = A2AAddDisksInput.class)}) +@Immutable +public class AddDisksProviderSpecificInput { + /** Creates an instance of AddDisksProviderSpecificInput class. */ + public AddDisksProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInput.java new file mode 100644 index 000000000000..1b3372a39293 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input required to add a provider. */ +@Fluent +public final class AddRecoveryServicesProviderInput { + /* + * The properties of an add provider request. + */ + @JsonProperty(value = "properties", required = true) + private AddRecoveryServicesProviderInputProperties properties; + + /** Creates an instance of AddRecoveryServicesProviderInput class. */ + public AddRecoveryServicesProviderInput() { + } + + /** + * Get the properties property: The properties of an add provider request. + * + * @return the properties value. + */ + public AddRecoveryServicesProviderInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of an add provider request. + * + * @param properties the properties value to set. + * @return the AddRecoveryServicesProviderInput object itself. + */ + public AddRecoveryServicesProviderInput withProperties(AddRecoveryServicesProviderInputProperties 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 AddRecoveryServicesProviderInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AddRecoveryServicesProviderInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInputProperties.java new file mode 100644 index 000000000000..3ca893ec9c8f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInputProperties.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an add provider request. */ +@Fluent +public final class AddRecoveryServicesProviderInputProperties { + /* + * The name of the machine where the provider is getting added. + */ + @JsonProperty(value = "machineName", required = true) + private String machineName; + + /* + * The Id of the machine where the provider is getting added. + */ + @JsonProperty(value = "machineId") + private String machineId; + + /* + * The Bios Id of the machine. + */ + @JsonProperty(value = "biosId") + private String biosId; + + /* + * The identity provider input for DRA authentication. + */ + @JsonProperty(value = "authenticationIdentityInput", required = true) + private IdentityProviderInput authenticationIdentityInput; + + /* + * The identity provider input for resource access. + */ + @JsonProperty(value = "resourceAccessIdentityInput", required = true) + private IdentityProviderInput resourceAccessIdentityInput; + + /* + * The identity provider input for data plane authentication. + */ + @JsonProperty(value = "dataPlaneAuthenticationIdentityInput") + private IdentityProviderInput dataPlaneAuthenticationIdentityInput; + + /** Creates an instance of AddRecoveryServicesProviderInputProperties class. */ + public AddRecoveryServicesProviderInputProperties() { + } + + /** + * Get the machineName property: The name of the machine where the provider is getting added. + * + * @return the machineName value. + */ + public String machineName() { + return this.machineName; + } + + /** + * Set the machineName property: The name of the machine where the provider is getting added. + * + * @param machineName the machineName value to set. + * @return the AddRecoveryServicesProviderInputProperties object itself. + */ + public AddRecoveryServicesProviderInputProperties withMachineName(String machineName) { + this.machineName = machineName; + return this; + } + + /** + * Get the machineId property: The Id of the machine where the provider is getting added. + * + * @return the machineId value. + */ + public String machineId() { + return this.machineId; + } + + /** + * Set the machineId property: The Id of the machine where the provider is getting added. + * + * @param machineId the machineId value to set. + * @return the AddRecoveryServicesProviderInputProperties object itself. + */ + public AddRecoveryServicesProviderInputProperties withMachineId(String machineId) { + this.machineId = machineId; + return this; + } + + /** + * Get the biosId property: The Bios Id of the machine. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Set the biosId property: The Bios Id of the machine. + * + * @param biosId the biosId value to set. + * @return the AddRecoveryServicesProviderInputProperties object itself. + */ + public AddRecoveryServicesProviderInputProperties withBiosId(String biosId) { + this.biosId = biosId; + return this; + } + + /** + * Get the authenticationIdentityInput property: The identity provider input for DRA authentication. + * + * @return the authenticationIdentityInput value. + */ + public IdentityProviderInput authenticationIdentityInput() { + return this.authenticationIdentityInput; + } + + /** + * Set the authenticationIdentityInput property: The identity provider input for DRA authentication. + * + * @param authenticationIdentityInput the authenticationIdentityInput value to set. + * @return the AddRecoveryServicesProviderInputProperties object itself. + */ + public AddRecoveryServicesProviderInputProperties withAuthenticationIdentityInput( + IdentityProviderInput authenticationIdentityInput) { + this.authenticationIdentityInput = authenticationIdentityInput; + return this; + } + + /** + * Get the resourceAccessIdentityInput property: The identity provider input for resource access. + * + * @return the resourceAccessIdentityInput value. + */ + public IdentityProviderInput resourceAccessIdentityInput() { + return this.resourceAccessIdentityInput; + } + + /** + * Set the resourceAccessIdentityInput property: The identity provider input for resource access. + * + * @param resourceAccessIdentityInput the resourceAccessIdentityInput value to set. + * @return the AddRecoveryServicesProviderInputProperties object itself. + */ + public AddRecoveryServicesProviderInputProperties withResourceAccessIdentityInput( + IdentityProviderInput resourceAccessIdentityInput) { + this.resourceAccessIdentityInput = resourceAccessIdentityInput; + return this; + } + + /** + * Get the dataPlaneAuthenticationIdentityInput property: The identity provider input for data plane authentication. + * + * @return the dataPlaneAuthenticationIdentityInput value. + */ + public IdentityProviderInput dataPlaneAuthenticationIdentityInput() { + return this.dataPlaneAuthenticationIdentityInput; + } + + /** + * Set the dataPlaneAuthenticationIdentityInput property: The identity provider input for data plane authentication. + * + * @param dataPlaneAuthenticationIdentityInput the dataPlaneAuthenticationIdentityInput value to set. + * @return the AddRecoveryServicesProviderInputProperties object itself. + */ + public AddRecoveryServicesProviderInputProperties withDataPlaneAuthenticationIdentityInput( + IdentityProviderInput dataPlaneAuthenticationIdentityInput) { + this.dataPlaneAuthenticationIdentityInput = dataPlaneAuthenticationIdentityInput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (machineName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property machineName in model AddRecoveryServicesProviderInputProperties")); + } + if (authenticationIdentityInput() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property authenticationIdentityInput in model" + + " AddRecoveryServicesProviderInputProperties")); + } else { + authenticationIdentityInput().validate(); + } + if (resourceAccessIdentityInput() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceAccessIdentityInput in model" + + " AddRecoveryServicesProviderInputProperties")); + } else { + resourceAccessIdentityInput().validate(); + } + if (dataPlaneAuthenticationIdentityInput() != null) { + dataPlaneAuthenticationIdentityInput().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AddRecoveryServicesProviderInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddVCenterRequest.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddVCenterRequest.java new file mode 100644 index 000000000000..8093bb870e7f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddVCenterRequest.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input required to add vCenter. */ +@Fluent +public final class AddVCenterRequest { + /* + * The properties of an add vCenter request. + */ + @JsonProperty(value = "properties") + private AddVCenterRequestProperties properties; + + /** Creates an instance of AddVCenterRequest class. */ + public AddVCenterRequest() { + } + + /** + * Get the properties property: The properties of an add vCenter request. + * + * @return the properties value. + */ + public AddVCenterRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of an add vCenter request. + * + * @param properties the properties value to set. + * @return the AddVCenterRequest object itself. + */ + public AddVCenterRequest withProperties(AddVCenterRequestProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddVCenterRequestProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddVCenterRequestProperties.java new file mode 100644 index 000000000000..ef2204f1a5df --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddVCenterRequestProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an add vCenter request. */ +@Fluent +public final class AddVCenterRequestProperties { + /* + * The friendly name of the vCenter. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The IP address of the vCenter to be discovered. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The process server Id from where the discovery is orchestrated. + */ + @JsonProperty(value = "processServerId") + private String processServerId; + + /* + * The port number for discovery. + */ + @JsonProperty(value = "port") + private String port; + + /* + * The account Id which has privileges to discover the vCenter. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /** Creates an instance of AddVCenterRequestProperties class. */ + public AddVCenterRequestProperties() { + } + + /** + * Get the friendlyName property: The friendly name of the vCenter. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name of the vCenter. + * + * @param friendlyName the friendlyName value to set. + * @return the AddVCenterRequestProperties object itself. + */ + public AddVCenterRequestProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the ipAddress property: The IP address of the vCenter to be discovered. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address of the vCenter to be discovered. + * + * @param ipAddress the ipAddress value to set. + * @return the AddVCenterRequestProperties object itself. + */ + public AddVCenterRequestProperties withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the processServerId property: The process server Id from where the discovery is orchestrated. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The process server Id from where the discovery is orchestrated. + * + * @param processServerId the processServerId value to set. + * @return the AddVCenterRequestProperties object itself. + */ + public AddVCenterRequestProperties withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the port property: The port number for discovery. + * + * @return the port value. + */ + public String port() { + return this.port; + } + + /** + * Set the port property: The port number for discovery. + * + * @param port the port value to set. + * @return the AddVCenterRequestProperties object itself. + */ + public AddVCenterRequestProperties withPort(String port) { + this.port = port; + return this; + } + + /** + * Get the runAsAccountId property: The account Id which has privileges to discover the vCenter. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The account Id which has privileges to discover the vCenter. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the AddVCenterRequestProperties object itself. + */ + public AddVCenterRequestProperties withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentAutoUpdateStatus.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentAutoUpdateStatus.java new file mode 100644 index 000000000000..6739b4e3f31c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentAutoUpdateStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A value indicating whether the auto update is enabled. */ +public final class AgentAutoUpdateStatus extends ExpandableStringEnum { + /** Static value Disabled for AgentAutoUpdateStatus. */ + public static final AgentAutoUpdateStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for AgentAutoUpdateStatus. */ + public static final AgentAutoUpdateStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a AgentAutoUpdateStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentAutoUpdateStatus. + */ + @JsonCreator + public static AgentAutoUpdateStatus fromString(String name) { + return fromString(name, AgentAutoUpdateStatus.class); + } + + /** + * Gets known AgentAutoUpdateStatus values. + * + * @return known AgentAutoUpdateStatus values. + */ + public static Collection values() { + return values(AgentAutoUpdateStatus.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentDetails.java new file mode 100644 index 000000000000..c8e163e1146b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Agent details. */ +@Immutable +public final class AgentDetails { + /* + * The Id of the agent running on the server. + */ + @JsonProperty(value = "agentId", access = JsonProperty.Access.WRITE_ONLY) + private String agentId; + + /* + * The Id of the machine to which the agent is registered. + */ + @JsonProperty(value = "machineId", access = JsonProperty.Access.WRITE_ONLY) + private String machineId; + + /* + * The machine BIOS Id. + */ + @JsonProperty(value = "biosId", access = JsonProperty.Access.WRITE_ONLY) + private String biosId; + + /* + * The machine FQDN. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The disks. + */ + @JsonProperty(value = "disks", access = JsonProperty.Access.WRITE_ONLY) + private List disks; + + /** Creates an instance of AgentDetails class. */ + public AgentDetails() { + } + + /** + * Get the agentId property: The Id of the agent running on the server. + * + * @return the agentId value. + */ + public String agentId() { + return this.agentId; + } + + /** + * Get the machineId property: The Id of the machine to which the agent is registered. + * + * @return the machineId value. + */ + public String machineId() { + return this.machineId; + } + + /** + * Get the biosId property: The machine BIOS Id. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Get the fqdn property: The machine FQDN. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the disks property: The disks. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentDiskDetails.java new file mode 100644 index 000000000000..1e8008593749 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentDiskDetails.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Agent disk details. */ +@Immutable +public final class AgentDiskDetails { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId", access = JsonProperty.Access.WRITE_ONLY) + private String diskId; + + /* + * The disk name. + */ + @JsonProperty(value = "diskName", access = JsonProperty.Access.WRITE_ONLY) + private String diskName; + + /* + * A value indicating whether the disk is the OS disk. + */ + @JsonProperty(value = "isOSDisk", access = JsonProperty.Access.WRITE_ONLY) + private String isOSDisk; + + /* + * The disk capacity in bytes. + */ + @JsonProperty(value = "capacityInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityInBytes; + + /* + * The lun of disk. + */ + @JsonProperty(value = "lunId", access = JsonProperty.Access.WRITE_ONLY) + private Integer lunId; + + /** Creates an instance of AgentDiskDetails class. */ + public AgentDiskDetails() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Get the diskName property: The disk name. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Get the isOSDisk property: A value indicating whether the disk is the OS disk. + * + * @return the isOSDisk value. + */ + public String isOSDisk() { + return this.isOSDisk; + } + + /** + * Get the capacityInBytes property: The disk capacity in bytes. + * + * @return the capacityInBytes value. + */ + public Long capacityInBytes() { + return this.capacityInBytes; + } + + /** + * Get the lunId property: The lun of disk. + * + * @return the lunId value. + */ + public Integer lunId() { + return this.lunId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentUpgradeBlockedReason.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentUpgradeBlockedReason.java new file mode 100644 index 000000000000..ed32394aa4a2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentUpgradeBlockedReason.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AgentUpgradeBlockedReason. */ +public final class AgentUpgradeBlockedReason extends ExpandableStringEnum { + /** Static value AlreadyOnLatestVersion for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason ALREADY_ON_LATEST_VERSION = fromString("AlreadyOnLatestVersion"); + + /** Static value RebootRequired for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason REBOOT_REQUIRED = fromString("RebootRequired"); + + /** Static value AgentNoHeartbeat for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason AGENT_NO_HEARTBEAT = fromString("AgentNoHeartbeat"); + + /** Static value RcmProxyNoHeartbeat for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason RCM_PROXY_NO_HEARTBEAT = fromString("RcmProxyNoHeartbeat"); + + /** Static value ProcessServerNoHeartbeat for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason PROCESS_SERVER_NO_HEARTBEAT = fromString("ProcessServerNoHeartbeat"); + + /** Static value IncompatibleApplianceVersion for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason INCOMPATIBLE_APPLIANCE_VERSION = + fromString("IncompatibleApplianceVersion"); + + /** Static value NotProtected for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason NOT_PROTECTED = fromString("NotProtected"); + + /** Static value UnsupportedProtectionScenario for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason UNSUPPORTED_PROTECTION_SCENARIO = + fromString("UnsupportedProtectionScenario"); + + /** Static value DistroIsNotReported for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason DISTRO_IS_NOT_REPORTED = fromString("DistroIsNotReported"); + + /** Static value DistroNotSupportedForUpgrade for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason DISTRO_NOT_SUPPORTED_FOR_UPGRADE = + fromString("DistroNotSupportedForUpgrade"); + + /** Static value MissingUpgradePath for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason MISSING_UPGRADE_PATH = fromString("MissingUpgradePath"); + + /** Static value InvalidAgentVersion for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason INVALID_AGENT_VERSION = fromString("InvalidAgentVersion"); + + /** Static value InvalidDriverVersion for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason INVALID_DRIVER_VERSION = fromString("InvalidDriverVersion"); + + /** Static value Unknown for AgentUpgradeBlockedReason. */ + public static final AgentUpgradeBlockedReason UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a AgentUpgradeBlockedReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentUpgradeBlockedReason. + */ + @JsonCreator + public static AgentUpgradeBlockedReason fromString(String name) { + return fromString(name, AgentUpgradeBlockedReason.class); + } + + /** + * Gets known AgentUpgradeBlockedReason values. + * + * @return known AgentUpgradeBlockedReason values. + */ + public static Collection values() { + return values(AgentUpgradeBlockedReason.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentVersionStatus.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentVersionStatus.java new file mode 100644 index 000000000000..3d7e2f07b8e1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentVersionStatus.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A value indicating whether security update required. */ +public final class AgentVersionStatus extends ExpandableStringEnum { + /** Static value Supported for AgentVersionStatus. */ + public static final AgentVersionStatus SUPPORTED = fromString("Supported"); + + /** Static value NotSupported for AgentVersionStatus. */ + public static final AgentVersionStatus NOT_SUPPORTED = fromString("NotSupported"); + + /** Static value Deprecated for AgentVersionStatus. */ + public static final AgentVersionStatus DEPRECATED = fromString("Deprecated"); + + /** Static value UpdateRequired for AgentVersionStatus. */ + public static final AgentVersionStatus UPDATE_REQUIRED = fromString("UpdateRequired"); + + /** Static value SecurityUpdateRequired for AgentVersionStatus. */ + public static final AgentVersionStatus SECURITY_UPDATE_REQUIRED = fromString("SecurityUpdateRequired"); + + /** + * Creates or finds a AgentVersionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentVersionStatus. + */ + @JsonCreator + public static AgentVersionStatus fromString(String name) { + return fromString(name, AgentVersionStatus.class); + } + + /** + * Gets known AgentVersionStatus values. + * + * @return known AgentVersionStatus values. + */ + public static Collection values() { + return values(AgentVersionStatus.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Alert.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Alert.java new file mode 100644 index 000000000000..b6ea7c18b529 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Alert.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.AlertInner; + +/** An immutable client-side representation of Alert. */ +public interface Alert { + /** + * 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: Alert related data. + * + * @return the properties value. + */ + AlertProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.AlertInner object. + * + * @return the inner object. + */ + AlertInner innerModel(); + + /** The entirety of the Alert definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Alert definition stages. */ + interface DefinitionStages { + /** The first stage of the Alert definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Alert definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @return the next definition stage. + */ + WithCreate withExistingVault(String resourceName, String resourceGroupName); + } + /** + * The stage of the Alert 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Alert create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Alert create(Context context); + } + /** The stage of the Alert definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of a configure alert request.. + * + * @param properties The properties of a configure alert request. + * @return the next definition stage. + */ + WithCreate withProperties(ConfigureAlertRequestProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Alert refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Alert refresh(Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlertCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlertCollection.java new file mode 100644 index 000000000000..be4728ed2528 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlertCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.AlertInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of alerts. */ +@Fluent +public final class AlertCollection { + /* + * The list of alerts. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AlertCollection class. */ + public AlertCollection() { + } + + /** + * Get the value property: The list of alerts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of alerts. + * + * @param value the value value to set. + * @return the AlertCollection object itself. + */ + public AlertCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the AlertCollection object itself. + */ + public AlertCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlertProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlertProperties.java new file mode 100644 index 000000000000..a159164a84cb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlertProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of an alert. */ +@Fluent +public final class AlertProperties { + /* + * A value indicating whether to send email to subscription administrator. + */ + @JsonProperty(value = "sendToOwners") + private String sendToOwners; + + /* + * The custom email address for sending emails. + */ + @JsonProperty(value = "customEmailAddresses") + private List customEmailAddresses; + + /* + * The locale for the email notification. + */ + @JsonProperty(value = "locale") + private String locale; + + /** Creates an instance of AlertProperties class. */ + public AlertProperties() { + } + + /** + * Get the sendToOwners property: A value indicating whether to send email to subscription administrator. + * + * @return the sendToOwners value. + */ + public String sendToOwners() { + return this.sendToOwners; + } + + /** + * Set the sendToOwners property: A value indicating whether to send email to subscription administrator. + * + * @param sendToOwners the sendToOwners value to set. + * @return the AlertProperties object itself. + */ + public AlertProperties withSendToOwners(String sendToOwners) { + this.sendToOwners = sendToOwners; + return this; + } + + /** + * Get the customEmailAddresses property: The custom email address for sending emails. + * + * @return the customEmailAddresses value. + */ + public List customEmailAddresses() { + return this.customEmailAddresses; + } + + /** + * Set the customEmailAddresses property: The custom email address for sending emails. + * + * @param customEmailAddresses the customEmailAddresses value to set. + * @return the AlertProperties object itself. + */ + public AlertProperties withCustomEmailAddresses(List customEmailAddresses) { + this.customEmailAddresses = customEmailAddresses; + return this; + } + + /** + * Get the locale property: The locale for the email notification. + * + * @return the locale value. + */ + public String locale() { + return this.locale; + } + + /** + * Set the locale property: The locale for the email notification. + * + * @param locale the locale value to set. + * @return the AlertProperties object itself. + */ + public AlertProperties 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlternateLocationRecoveryOption.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlternateLocationRecoveryOption.java new file mode 100644 index 000000000000..77e34d704738 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlternateLocationRecoveryOption.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The ALR option. */ +public final class AlternateLocationRecoveryOption extends ExpandableStringEnum { + /** Static value CreateVmIfNotFound for AlternateLocationRecoveryOption. */ + public static final AlternateLocationRecoveryOption CREATE_VM_IF_NOT_FOUND = fromString("CreateVmIfNotFound"); + + /** Static value NoAction for AlternateLocationRecoveryOption. */ + public static final AlternateLocationRecoveryOption NO_ACTION = fromString("NoAction"); + + /** + * Creates or finds a AlternateLocationRecoveryOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlternateLocationRecoveryOption. + */ + @JsonCreator + public static AlternateLocationRecoveryOption fromString(String name) { + return fromString(name, AlternateLocationRecoveryOption.class); + } + + /** + * Gets known AlternateLocationRecoveryOption values. + * + * @return known AlternateLocationRecoveryOption values. + */ + public static Collection values() { + return values(AlternateLocationRecoveryOption.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplianceCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplianceCollection.java new file mode 100644 index 000000000000..59135ff6457b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplianceCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationApplianceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of appliance details. */ +@Fluent +public final class ApplianceCollection { + /* + * The appliance details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ApplianceCollection class. */ + public ApplianceCollection() { + } + + /** + * Get the value property: The appliance details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The appliance details. + * + * @param value the value value to set. + * @return the ApplianceCollection object itself. + */ + public ApplianceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the ApplianceCollection object itself. + */ + public ApplianceCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplianceSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplianceSpecificDetails.java new file mode 100644 index 000000000000..3b35fc8deeb6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplianceSpecificDetails.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.recoveryservicessiterecovery.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; + +/** Appliance specific details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ApplianceSpecificDetails.class) +@JsonTypeName("ApplianceSpecificDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmApplianceSpecificDetails.class)}) +@Immutable +public class ApplianceSpecificDetails { + /** Creates an instance of ApplianceSpecificDetails class. */ + public ApplianceSpecificDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInput.java new file mode 100644 index 000000000000..681d01a07d2a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input to apply recovery point. */ +@Fluent +public final class ApplyRecoveryPointInput { + /* + * The input properties to apply recovery point. + */ + @JsonProperty(value = "properties", required = true) + private ApplyRecoveryPointInputProperties properties; + + /** Creates an instance of ApplyRecoveryPointInput class. */ + public ApplyRecoveryPointInput() { + } + + /** + * Get the properties property: The input properties to apply recovery point. + * + * @return the properties value. + */ + public ApplyRecoveryPointInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The input properties to apply recovery point. + * + * @param properties the properties value to set. + * @return the ApplyRecoveryPointInput object itself. + */ + public ApplyRecoveryPointInput withProperties(ApplyRecoveryPointInputProperties 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 ApplyRecoveryPointInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplyRecoveryPointInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInputProperties.java new file mode 100644 index 000000000000..aa4d971a943c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input properties to apply recovery point. */ +@Fluent +public final class ApplyRecoveryPointInputProperties { + /* + * The recovery point Id. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /* + * Provider specific input for applying recovery point. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private ApplyRecoveryPointProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of ApplyRecoveryPointInputProperties class. */ + public ApplyRecoveryPointInputProperties() { + } + + /** + * Get the recoveryPointId property: The recovery point Id. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point Id. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the ApplyRecoveryPointInputProperties object itself. + */ + public ApplyRecoveryPointInputProperties withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the providerSpecificDetails property: Provider specific input for applying recovery point. + * + * @return the providerSpecificDetails value. + */ + public ApplyRecoveryPointProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: Provider specific input for applying recovery point. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the ApplyRecoveryPointInputProperties object itself. + */ + public ApplyRecoveryPointInputProperties withProviderSpecificDetails( + ApplyRecoveryPointProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerSpecificDetails in model" + + " ApplyRecoveryPointInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplyRecoveryPointInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointProviderSpecificInput.java new file mode 100644 index 000000000000..023137f59ae4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointProviderSpecificInput.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Provider specific input for apply recovery point. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ApplyRecoveryPointProviderSpecificInput.class) +@JsonTypeName("ApplyRecoveryPointProviderSpecificInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AApplyRecoveryPointInput.class), + @JsonSubTypes.Type( + name = "A2ACrossClusterMigration", + value = A2ACrossClusterMigrationApplyRecoveryPointInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzureApplyRecoveryPointInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2ApplyRecoveryPointInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmApplyRecoveryPointInput.class) +}) +@Immutable +public class ApplyRecoveryPointProviderSpecificInput { + /** Creates an instance of ApplyRecoveryPointProviderSpecificInput class. */ + public ApplyRecoveryPointProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AsrJobDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AsrJobDetails.java new file mode 100644 index 000000000000..d086470033a1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AsrJobDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** This class represents job details based on specific job type. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("AsrJobDetails") +@Fluent +public final class AsrJobDetails extends JobDetails { + /** Creates an instance of AsrJobDetails class. */ + public AsrJobDetails() { + } + + /** {@inheritDoc} */ + @Override + public AsrJobDetails withAffectedObjectDetails(Map affectedObjectDetails) { + super.withAffectedObjectDetails(affectedObjectDetails); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AsrTask.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AsrTask.java new file mode 100644 index 000000000000..297fcb5a460b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AsrTask.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Task of the Job. */ +@Fluent +public final class AsrTask { + /* + * The Id. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * The unique Task name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The state/actions applicable on this task. + */ + @JsonProperty(value = "allowedActions") + private List allowedActions; + + /* + * The name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The description of the task state. For example - For Succeeded state, description can be Completed, + * PartiallySucceeded, CompletedWithInformation or Skipped. + */ + @JsonProperty(value = "stateDescription") + private String stateDescription; + + /* + * The type of task. Details in CustomDetails property depend on this type. + */ + @JsonProperty(value = "taskType") + private String taskType; + + /* + * The custom task details based on the task type. + */ + @JsonProperty(value = "customDetails") + private TaskTypeDetails customDetails; + + /* + * The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived + * from it. + */ + @JsonProperty(value = "groupTaskCustomDetails") + private GroupTaskDetails groupTaskCustomDetails; + + /* + * The task error details. + */ + @JsonProperty(value = "errors") + private List errors; + + /** Creates an instance of AsrTask class. */ + public AsrTask() { + } + + /** + * Get the taskId property: The Id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: The Id. + * + * @param taskId the taskId value to set. + * @return the AsrTask object itself. + */ + public AsrTask withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the name property: The unique Task name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique Task name. + * + * @param name the name value to set. + * @return the AsrTask object itself. + */ + public AsrTask withName(String name) { + this.name = name; + return this; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time. + * + * @param startTime the startTime value to set. + * @return the AsrTask object itself. + */ + public AsrTask withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time. + * + * @param endTime the endTime value to set. + * @return the AsrTask object itself. + */ + public AsrTask withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the allowedActions property: The state/actions applicable on this task. + * + * @return the allowedActions value. + */ + public List allowedActions() { + return this.allowedActions; + } + + /** + * Set the allowedActions property: The state/actions applicable on this task. + * + * @param allowedActions the allowedActions value to set. + * @return the AsrTask object itself. + */ + public AsrTask withAllowedActions(List allowedActions) { + this.allowedActions = allowedActions; + return this; + } + + /** + * Get the friendlyName property: The name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The name. + * + * @param friendlyName the friendlyName value to set. + * @return the AsrTask object itself. + */ + public AsrTask withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the state property: The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, + * Cancelled, Suspended or Other. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, + * Cancelled, Suspended or Other. + * + * @param state the state value to set. + * @return the AsrTask object itself. + */ + public AsrTask withState(String state) { + this.state = state; + return this; + } + + /** + * Get the stateDescription property: The description of the task state. For example - For Succeeded state, + * description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + * + * @return the stateDescription value. + */ + public String stateDescription() { + return this.stateDescription; + } + + /** + * Set the stateDescription property: The description of the task state. For example - For Succeeded state, + * description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + * + * @param stateDescription the stateDescription value to set. + * @return the AsrTask object itself. + */ + public AsrTask withStateDescription(String stateDescription) { + this.stateDescription = stateDescription; + return this; + } + + /** + * Get the taskType property: The type of task. Details in CustomDetails property depend on this type. + * + * @return the taskType value. + */ + public String taskType() { + return this.taskType; + } + + /** + * Set the taskType property: The type of task. Details in CustomDetails property depend on this type. + * + * @param taskType the taskType value to set. + * @return the AsrTask object itself. + */ + public AsrTask withTaskType(String taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get the customDetails property: The custom task details based on the task type. + * + * @return the customDetails value. + */ + public TaskTypeDetails customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: The custom task details based on the task type. + * + * @param customDetails the customDetails value to set. + * @return the AsrTask object itself. + */ + public AsrTask withCustomDetails(TaskTypeDetails customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Get the groupTaskCustomDetails property: The custom task details based on the task type, if the task type is + * GroupTaskDetails or one of the types derived from it. + * + * @return the groupTaskCustomDetails value. + */ + public GroupTaskDetails groupTaskCustomDetails() { + return this.groupTaskCustomDetails; + } + + /** + * Set the groupTaskCustomDetails property: The custom task details based on the task type, if the task type is + * GroupTaskDetails or one of the types derived from it. + * + * @param groupTaskCustomDetails the groupTaskCustomDetails value to set. + * @return the AsrTask object itself. + */ + public AsrTask withGroupTaskCustomDetails(GroupTaskDetails groupTaskCustomDetails) { + this.groupTaskCustomDetails = groupTaskCustomDetails; + return this; + } + + /** + * Get the errors property: The task error details. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The task error details. + * + * @param errors the errors value to set. + * @return the AsrTask object itself. + */ + public AsrTask withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customDetails() != null) { + customDetails().validate(); + } + if (groupTaskCustomDetails() != null) { + groupTaskCustomDetails().validate(); + } + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutoProtectionOfDataDisk.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutoProtectionOfDataDisk.java new file mode 100644 index 000000000000..220cd17e8ea8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutoProtectionOfDataDisk.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A value indicating whether the auto protection is enabled. */ +public final class AutoProtectionOfDataDisk extends ExpandableStringEnum { + /** Static value Disabled for AutoProtectionOfDataDisk. */ + public static final AutoProtectionOfDataDisk DISABLED = fromString("Disabled"); + + /** Static value Enabled for AutoProtectionOfDataDisk. */ + public static final AutoProtectionOfDataDisk ENABLED = fromString("Enabled"); + + /** + * Creates or finds a AutoProtectionOfDataDisk from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoProtectionOfDataDisk. + */ + @JsonCreator + public static AutoProtectionOfDataDisk fromString(String name) { + return fromString(name, AutoProtectionOfDataDisk.class); + } + + /** + * Gets known AutoProtectionOfDataDisk values. + * + * @return known AutoProtectionOfDataDisk values. + */ + public static Collection values() { + return values(AutoProtectionOfDataDisk.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutomationAccountAuthenticationType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutomationAccountAuthenticationType.java new file mode 100644 index 000000000000..85c2d097e44e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutomationAccountAuthenticationType.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A value indicating the type authentication to use for automation Account. */ +public final class AutomationAccountAuthenticationType + extends ExpandableStringEnum { + /** Static value RunAsAccount for AutomationAccountAuthenticationType. */ + public static final AutomationAccountAuthenticationType RUN_AS_ACCOUNT = fromString("RunAsAccount"); + + /** Static value SystemAssignedIdentity for AutomationAccountAuthenticationType. */ + public static final AutomationAccountAuthenticationType SYSTEM_ASSIGNED_IDENTITY = + fromString("SystemAssignedIdentity"); + + /** + * Creates or finds a AutomationAccountAuthenticationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutomationAccountAuthenticationType. + */ + @JsonCreator + public static AutomationAccountAuthenticationType fromString(String name) { + return fromString(name, AutomationAccountAuthenticationType.class); + } + + /** + * Gets known AutomationAccountAuthenticationType values. + * + * @return known AutomationAccountAuthenticationType values. + */ + public static Collection values() { + return values(AutomationAccountAuthenticationType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutomationRunbookTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutomationRunbookTaskDetails.java new file mode 100644 index 000000000000..7fef7b04fa4d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutomationRunbookTaskDetails.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** This class represents the task details for an automation runbook. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("AutomationRunbookTaskDetails") +@Fluent +public final class AutomationRunbookTaskDetails extends TaskTypeDetails { + /* + * The recovery plan task name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The cloud service of the automation runbook account. + */ + @JsonProperty(value = "cloudServiceName") + private String cloudServiceName; + + /* + * The subscription Id of the automation runbook account. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /* + * The automation account name of the runbook. + */ + @JsonProperty(value = "accountName") + private String accountName; + + /* + * The runbook Id. + */ + @JsonProperty(value = "runbookId") + private String runbookId; + + /* + * The runbook name. + */ + @JsonProperty(value = "runbookName") + private String runbookName; + + /* + * The job Id of the runbook execution. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /* + * The execution output of the runbook. + */ + @JsonProperty(value = "jobOutput") + private String jobOutput; + + /* + * A value indicating whether it is a primary side script or not. + */ + @JsonProperty(value = "isPrimarySideScript") + private Boolean isPrimarySideScript; + + /** Creates an instance of AutomationRunbookTaskDetails class. */ + public AutomationRunbookTaskDetails() { + } + + /** + * Get the name property: The recovery plan task name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The recovery plan task name. + * + * @param name the name value to set. + * @return the AutomationRunbookTaskDetails object itself. + */ + public AutomationRunbookTaskDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the cloudServiceName property: The cloud service of the automation runbook account. + * + * @return the cloudServiceName value. + */ + public String cloudServiceName() { + return this.cloudServiceName; + } + + /** + * Set the cloudServiceName property: The cloud service of the automation runbook account. + * + * @param cloudServiceName the cloudServiceName value to set. + * @return the AutomationRunbookTaskDetails object itself. + */ + public AutomationRunbookTaskDetails withCloudServiceName(String cloudServiceName) { + this.cloudServiceName = cloudServiceName; + return this; + } + + /** + * Get the subscriptionId property: The subscription Id of the automation runbook account. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: The subscription Id of the automation runbook account. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AutomationRunbookTaskDetails object itself. + */ + public AutomationRunbookTaskDetails withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the accountName property: The automation account name of the runbook. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: The automation account name of the runbook. + * + * @param accountName the accountName value to set. + * @return the AutomationRunbookTaskDetails object itself. + */ + public AutomationRunbookTaskDetails withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the runbookId property: The runbook Id. + * + * @return the runbookId value. + */ + public String runbookId() { + return this.runbookId; + } + + /** + * Set the runbookId property: The runbook Id. + * + * @param runbookId the runbookId value to set. + * @return the AutomationRunbookTaskDetails object itself. + */ + public AutomationRunbookTaskDetails withRunbookId(String runbookId) { + this.runbookId = runbookId; + return this; + } + + /** + * Get the runbookName property: The runbook name. + * + * @return the runbookName value. + */ + public String runbookName() { + return this.runbookName; + } + + /** + * Set the runbookName property: The runbook name. + * + * @param runbookName the runbookName value to set. + * @return the AutomationRunbookTaskDetails object itself. + */ + public AutomationRunbookTaskDetails withRunbookName(String runbookName) { + this.runbookName = runbookName; + return this; + } + + /** + * Get the jobId property: The job Id of the runbook execution. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: The job Id of the runbook execution. + * + * @param jobId the jobId value to set. + * @return the AutomationRunbookTaskDetails object itself. + */ + public AutomationRunbookTaskDetails withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the jobOutput property: The execution output of the runbook. + * + * @return the jobOutput value. + */ + public String jobOutput() { + return this.jobOutput; + } + + /** + * Set the jobOutput property: The execution output of the runbook. + * + * @param jobOutput the jobOutput value to set. + * @return the AutomationRunbookTaskDetails object itself. + */ + public AutomationRunbookTaskDetails withJobOutput(String jobOutput) { + this.jobOutput = jobOutput; + return this; + } + + /** + * Get the isPrimarySideScript property: A value indicating whether it is a primary side script or not. + * + * @return the isPrimarySideScript value. + */ + public Boolean isPrimarySideScript() { + return this.isPrimarySideScript; + } + + /** + * Set the isPrimarySideScript property: A value indicating whether it is a primary side script or not. + * + * @param isPrimarySideScript the isPrimarySideScript value to set. + * @return the AutomationRunbookTaskDetails object itself. + */ + public AutomationRunbookTaskDetails withIsPrimarySideScript(Boolean isPrimarySideScript) { + this.isPrimarySideScript = isPrimarySideScript; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureFabricCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureFabricCreationInput.java new file mode 100644 index 000000000000..7df030ea920b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureFabricCreationInput.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.recoveryservicessiterecovery.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; + +/** Fabric provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("Azure") +@Fluent +public final class AzureFabricCreationInput extends FabricSpecificCreationInput { + /* + * The Location. + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of AzureFabricCreationInput class. */ + public AzureFabricCreationInput() { + } + + /** + * Get the location property: The Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location. + * + * @param location the location value to set. + * @return the AzureFabricCreationInput object itself. + */ + public AzureFabricCreationInput withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureFabricSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureFabricSpecificDetails.java new file mode 100644 index 000000000000..96f3407ee3e5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureFabricSpecificDetails.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; + +/** Azure Fabric Specific Details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("Azure") +@Fluent +public final class AzureFabricSpecificDetails extends FabricSpecificDetails { + /* + * The Location for the Azure fabric. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The container Ids for the Azure fabric. + */ + @JsonProperty(value = "containerIds") + private List containerIds; + + /* + * The zones. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The ExtendedLocations. + */ + @JsonProperty(value = "extendedLocations") + private List extendedLocations; + + /** Creates an instance of AzureFabricSpecificDetails class. */ + public AzureFabricSpecificDetails() { + } + + /** + * Get the location property: The Location for the Azure fabric. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location for the Azure fabric. + * + * @param location the location value to set. + * @return the AzureFabricSpecificDetails object itself. + */ + public AzureFabricSpecificDetails withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the containerIds property: The container Ids for the Azure fabric. + * + * @return the containerIds value. + */ + public List containerIds() { + return this.containerIds; + } + + /** + * Set the containerIds property: The container Ids for the Azure fabric. + * + * @param containerIds the containerIds value to set. + * @return the AzureFabricSpecificDetails object itself. + */ + public AzureFabricSpecificDetails withContainerIds(List containerIds) { + this.containerIds = containerIds; + return this; + } + + /** + * Get the zones property: The zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The zones. + * + * @param zones the zones value to set. + * @return the AzureFabricSpecificDetails object itself. + */ + public AzureFabricSpecificDetails withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the extendedLocations property: The ExtendedLocations. + * + * @return the extendedLocations value. + */ + public List extendedLocations() { + return this.extendedLocations; + } + + /** + * Set the extendedLocations property: The ExtendedLocations. + * + * @param extendedLocations the extendedLocations value to set. + * @return the AzureFabricSpecificDetails object itself. + */ + public AzureFabricSpecificDetails withExtendedLocations(List extendedLocations) { + this.extendedLocations = extendedLocations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (zones() != null) { + zones().forEach(e -> e.validate()); + } + if (extendedLocations() != null) { + extendedLocations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureCreateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureCreateNetworkMappingInput.java new file mode 100644 index 000000000000..b1687b827e9f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureCreateNetworkMappingInput.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.recoveryservicessiterecovery.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; + +/** Create network mappings input properties/behavior specific to Azure to Azure Network mapping. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("AzureToAzure") +@Fluent +public final class AzureToAzureCreateNetworkMappingInput extends FabricSpecificCreateNetworkMappingInput { + /* + * The primary azure vnet Id. + */ + @JsonProperty(value = "primaryNetworkId", required = true) + private String primaryNetworkId; + + /** Creates an instance of AzureToAzureCreateNetworkMappingInput class. */ + public AzureToAzureCreateNetworkMappingInput() { + } + + /** + * Get the primaryNetworkId property: The primary azure vnet Id. + * + * @return the primaryNetworkId value. + */ + public String primaryNetworkId() { + return this.primaryNetworkId; + } + + /** + * Set the primaryNetworkId property: The primary azure vnet Id. + * + * @param primaryNetworkId the primaryNetworkId value to set. + * @return the AzureToAzureCreateNetworkMappingInput object itself. + */ + public AzureToAzureCreateNetworkMappingInput withPrimaryNetworkId(String primaryNetworkId) { + this.primaryNetworkId = primaryNetworkId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (primaryNetworkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property primaryNetworkId in model AzureToAzureCreateNetworkMappingInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureToAzureCreateNetworkMappingInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureNetworkMappingSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureNetworkMappingSettings.java new file mode 100644 index 000000000000..4c6597503207 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureNetworkMappingSettings.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.recoveryservicessiterecovery.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; + +/** A2A Network Mapping fabric specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("AzureToAzure") +@Fluent +public final class AzureToAzureNetworkMappingSettings extends NetworkMappingFabricSpecificSettings { + /* + * The primary fabric location. + */ + @JsonProperty(value = "primaryFabricLocation") + private String primaryFabricLocation; + + /* + * The recovery fabric location. + */ + @JsonProperty(value = "recoveryFabricLocation") + private String recoveryFabricLocation; + + /** Creates an instance of AzureToAzureNetworkMappingSettings class. */ + public AzureToAzureNetworkMappingSettings() { + } + + /** + * Get the primaryFabricLocation property: The primary fabric location. + * + * @return the primaryFabricLocation value. + */ + public String primaryFabricLocation() { + return this.primaryFabricLocation; + } + + /** + * Set the primaryFabricLocation property: The primary fabric location. + * + * @param primaryFabricLocation the primaryFabricLocation value to set. + * @return the AzureToAzureNetworkMappingSettings object itself. + */ + public AzureToAzureNetworkMappingSettings withPrimaryFabricLocation(String primaryFabricLocation) { + this.primaryFabricLocation = primaryFabricLocation; + return this; + } + + /** + * Get the recoveryFabricLocation property: The recovery fabric location. + * + * @return the recoveryFabricLocation value. + */ + public String recoveryFabricLocation() { + return this.recoveryFabricLocation; + } + + /** + * Set the recoveryFabricLocation property: The recovery fabric location. + * + * @param recoveryFabricLocation the recoveryFabricLocation value to set. + * @return the AzureToAzureNetworkMappingSettings object itself. + */ + public AzureToAzureNetworkMappingSettings withRecoveryFabricLocation(String recoveryFabricLocation) { + this.recoveryFabricLocation = recoveryFabricLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureUpdateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureUpdateNetworkMappingInput.java new file mode 100644 index 000000000000..c5dd4c756a8f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureUpdateNetworkMappingInput.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.recoveryservicessiterecovery.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; + +/** Updates network mappings input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("AzureToAzure") +@Fluent +public final class AzureToAzureUpdateNetworkMappingInput extends FabricSpecificUpdateNetworkMappingInput { + /* + * The primary azure vnet Id. + */ + @JsonProperty(value = "primaryNetworkId") + private String primaryNetworkId; + + /** Creates an instance of AzureToAzureUpdateNetworkMappingInput class. */ + public AzureToAzureUpdateNetworkMappingInput() { + } + + /** + * Get the primaryNetworkId property: The primary azure vnet Id. + * + * @return the primaryNetworkId value. + */ + public String primaryNetworkId() { + return this.primaryNetworkId; + } + + /** + * Set the primaryNetworkId property: The primary azure vnet Id. + * + * @param primaryNetworkId the primaryNetworkId value to set. + * @return the AzureToAzureUpdateNetworkMappingInput object itself. + */ + public AzureToAzureUpdateNetworkMappingInput withPrimaryNetworkId(String primaryNetworkId) { + this.primaryNetworkId = primaryNetworkId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureVmSyncedConfigDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureVmSyncedConfigDetails.java new file mode 100644 index 000000000000..5d187edda3ae --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureVmSyncedConfigDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure to Azure VM synced configuration details. */ +@Fluent +public final class AzureToAzureVmSyncedConfigDetails { + /* + * The Azure VM tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The Azure VM input endpoints. + */ + @JsonProperty(value = "inputEndpoints") + private List inputEndpoints; + + /** Creates an instance of AzureToAzureVmSyncedConfigDetails class. */ + public AzureToAzureVmSyncedConfigDetails() { + } + + /** + * Get the tags property: The Azure VM tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure VM tags. + * + * @param tags the tags value to set. + * @return the AzureToAzureVmSyncedConfigDetails object itself. + */ + public AzureToAzureVmSyncedConfigDetails withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the inputEndpoints property: The Azure VM input endpoints. + * + * @return the inputEndpoints value. + */ + public List inputEndpoints() { + return this.inputEndpoints; + } + + /** + * Set the inputEndpoints property: The Azure VM input endpoints. + * + * @param inputEndpoints the inputEndpoints value to set. + * @return the AzureToAzureVmSyncedConfigDetails object itself. + */ + public AzureToAzureVmSyncedConfigDetails withInputEndpoints(List inputEndpoints) { + this.inputEndpoints = inputEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inputEndpoints() != null) { + inputEndpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureVmDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureVmDiskDetails.java new file mode 100644 index 000000000000..576b9d35d785 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureVmDiskDetails.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk details for E2A provider. */ +@Fluent +public final class AzureVmDiskDetails { + /* + * VHD type. + */ + @JsonProperty(value = "vhdType") + private String vhdType; + + /* + * The VHD id. + */ + @JsonProperty(value = "vhdId") + private String vhdId; + + /* + * The disk resource id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * VHD name. + */ + @JsonProperty(value = "vhdName") + private String vhdName; + + /* + * Max side in MB. + */ + @JsonProperty(value = "maxSizeMB") + private String maxSizeMB; + + /* + * Blob uri of the Azure disk. + */ + @JsonProperty(value = "targetDiskLocation") + private String targetDiskLocation; + + /* + * The target Azure disk name. + */ + @JsonProperty(value = "targetDiskName") + private String targetDiskName; + + /* + * Ordinal\LunId of the disk for the Azure VM. + */ + @JsonProperty(value = "lunId") + private String lunId; + + /* + * The DiskEncryptionSet ARM ID. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /* + * The custom target Azure disk name. + */ + @JsonProperty(value = "customTargetDiskName") + private String customTargetDiskName; + + /** Creates an instance of AzureVmDiskDetails class. */ + public AzureVmDiskDetails() { + } + + /** + * Get the vhdType property: VHD type. + * + * @return the vhdType value. + */ + public String vhdType() { + return this.vhdType; + } + + /** + * Set the vhdType property: VHD type. + * + * @param vhdType the vhdType value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withVhdType(String vhdType) { + this.vhdType = vhdType; + return this; + } + + /** + * Get the vhdId property: The VHD id. + * + * @return the vhdId value. + */ + public String vhdId() { + return this.vhdId; + } + + /** + * Set the vhdId property: The VHD id. + * + * @param vhdId the vhdId value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withVhdId(String vhdId) { + this.vhdId = vhdId; + return this; + } + + /** + * Get the diskId property: The disk resource id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk resource id. + * + * @param diskId the diskId value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the vhdName property: VHD name. + * + * @return the vhdName value. + */ + public String vhdName() { + return this.vhdName; + } + + /** + * Set the vhdName property: VHD name. + * + * @param vhdName the vhdName value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withVhdName(String vhdName) { + this.vhdName = vhdName; + return this; + } + + /** + * Get the maxSizeMB property: Max side in MB. + * + * @return the maxSizeMB value. + */ + public String maxSizeMB() { + return this.maxSizeMB; + } + + /** + * Set the maxSizeMB property: Max side in MB. + * + * @param maxSizeMB the maxSizeMB value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withMaxSizeMB(String maxSizeMB) { + this.maxSizeMB = maxSizeMB; + return this; + } + + /** + * Get the targetDiskLocation property: Blob uri of the Azure disk. + * + * @return the targetDiskLocation value. + */ + public String targetDiskLocation() { + return this.targetDiskLocation; + } + + /** + * Set the targetDiskLocation property: Blob uri of the Azure disk. + * + * @param targetDiskLocation the targetDiskLocation value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withTargetDiskLocation(String targetDiskLocation) { + this.targetDiskLocation = targetDiskLocation; + return this; + } + + /** + * Get the targetDiskName property: The target Azure disk name. + * + * @return the targetDiskName value. + */ + public String targetDiskName() { + return this.targetDiskName; + } + + /** + * Set the targetDiskName property: The target Azure disk name. + * + * @param targetDiskName the targetDiskName value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withTargetDiskName(String targetDiskName) { + this.targetDiskName = targetDiskName; + return this; + } + + /** + * Get the lunId property: Ordinal\LunId of the disk for the Azure VM. + * + * @return the lunId value. + */ + public String lunId() { + return this.lunId; + } + + /** + * Set the lunId property: Ordinal\LunId of the disk for the Azure VM. + * + * @param lunId the lunId value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withLunId(String lunId) { + this.lunId = lunId; + return this; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM ID. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The DiskEncryptionSet ARM ID. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Get the customTargetDiskName property: The custom target Azure disk name. + * + * @return the customTargetDiskName value. + */ + public String customTargetDiskName() { + return this.customTargetDiskName; + } + + /** + * Set the customTargetDiskName property: The custom target Azure disk name. + * + * @param customTargetDiskName the customTargetDiskName value to set. + * @return the AzureVmDiskDetails object itself. + */ + public AzureVmDiskDetails withCustomTargetDiskName(String customTargetDiskName) { + this.customTargetDiskName = customTargetDiskName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ComputeSizeErrorDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ComputeSizeErrorDetails.java new file mode 100644 index 000000000000..0dbeec6ed673 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ComputeSizeErrorDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents the error used to indicate why the target compute size is not applicable. */ +@Fluent +public final class ComputeSizeErrorDetails { + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The severity of the error. + */ + @JsonProperty(value = "severity") + private String severity; + + /** Creates an instance of ComputeSizeErrorDetails class. */ + public ComputeSizeErrorDetails() { + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The error message. + * + * @param message the message value to set. + * @return the ComputeSizeErrorDetails object itself. + */ + public ComputeSizeErrorDetails withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the severity property: The severity of the error. + * + * @return the severity value. + */ + public String severity() { + return this.severity; + } + + /** + * Set the severity property: The severity of the error. + * + * @param severity the severity value to set. + * @return the ComputeSizeErrorDetails object itself. + */ + public ComputeSizeErrorDetails withSeverity(String severity) { + this.severity = severity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigurationSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigurationSettings.java new file mode 100644 index 000000000000..f0ab5670adcf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigurationSettings.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.recoveryservicessiterecovery.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 provider specific settings. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ConfigurationSettings.class) +@JsonTypeName("ConfigurationSettings") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "HyperVVirtualMachine", value = HyperVVirtualMachineDetails.class), + @JsonSubTypes.Type(name = "ReplicationGroupDetails", value = ReplicationGroupDetails.class), + @JsonSubTypes.Type(name = "VMwareVirtualMachine", value = VMwareVirtualMachineDetails.class) +}) +@Immutable +public class ConfigurationSettings { + /** Creates an instance of ConfigurationSettings class. */ + public ConfigurationSettings() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigureAlertRequest.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigureAlertRequest.java new file mode 100644 index 000000000000..4d3060db1e47 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigureAlertRequest.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to configure alerts for the system. */ +@Fluent +public final class ConfigureAlertRequest { + /* + * The properties of a configure alert request. + */ + @JsonProperty(value = "properties") + private ConfigureAlertRequestProperties properties; + + /** Creates an instance of ConfigureAlertRequest class. */ + public ConfigureAlertRequest() { + } + + /** + * Get the properties property: The properties of a configure alert request. + * + * @return the properties value. + */ + public ConfigureAlertRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of a configure alert request. + * + * @param properties the properties value to set. + * @return the ConfigureAlertRequest object itself. + */ + public ConfigureAlertRequest withProperties(ConfigureAlertRequestProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigureAlertRequestProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigureAlertRequestProperties.java new file mode 100644 index 000000000000..e631c06e7a1e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigureAlertRequestProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a configure alert request. */ +@Fluent +public final class ConfigureAlertRequestProperties { + /* + * A value indicating whether to send email to subscription administrator. + */ + @JsonProperty(value = "sendToOwners") + private String sendToOwners; + + /* + * The custom email address for sending emails. + */ + @JsonProperty(value = "customEmailAddresses") + private List customEmailAddresses; + + /* + * The locale for the email notification. + */ + @JsonProperty(value = "locale") + private String locale; + + /** Creates an instance of ConfigureAlertRequestProperties class. */ + public ConfigureAlertRequestProperties() { + } + + /** + * Get the sendToOwners property: A value indicating whether to send email to subscription administrator. + * + * @return the sendToOwners value. + */ + public String sendToOwners() { + return this.sendToOwners; + } + + /** + * Set the sendToOwners property: A value indicating whether to send email to subscription administrator. + * + * @param sendToOwners the sendToOwners value to set. + * @return the ConfigureAlertRequestProperties object itself. + */ + public ConfigureAlertRequestProperties withSendToOwners(String sendToOwners) { + this.sendToOwners = sendToOwners; + return this; + } + + /** + * Get the customEmailAddresses property: The custom email address for sending emails. + * + * @return the customEmailAddresses value. + */ + public List customEmailAddresses() { + return this.customEmailAddresses; + } + + /** + * Set the customEmailAddresses property: The custom email address for sending emails. + * + * @param customEmailAddresses the customEmailAddresses value to set. + * @return the ConfigureAlertRequestProperties object itself. + */ + public ConfigureAlertRequestProperties withCustomEmailAddresses(List customEmailAddresses) { + this.customEmailAddresses = customEmailAddresses; + return this; + } + + /** + * Get the locale property: The locale for the email notification. + * + * @return the locale value. + */ + public String locale() { + return this.locale; + } + + /** + * Set the locale property: The locale for the email notification. + * + * @param locale the locale value to set. + * @return the ConfigureAlertRequestProperties object itself. + */ + public ConfigureAlertRequestProperties 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConsistencyCheckTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConsistencyCheckTaskDetails.java new file mode 100644 index 000000000000..40f733aecc08 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConsistencyCheckTaskDetails.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; + +/** This class contains monitoring details of all the inconsistent Protected Entities in Vmm. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("ConsistencyCheckTaskDetails") +@Fluent +public final class ConsistencyCheckTaskDetails extends TaskTypeDetails { + /* + * The list of inconsistent Vm details. + */ + @JsonProperty(value = "vmDetails") + private List vmDetails; + + /** Creates an instance of ConsistencyCheckTaskDetails class. */ + public ConsistencyCheckTaskDetails() { + } + + /** + * Get the vmDetails property: The list of inconsistent Vm details. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.vmDetails; + } + + /** + * Set the vmDetails property: The list of inconsistent Vm details. + * + * @param vmDetails the vmDetails value to set. + * @return the ConsistencyCheckTaskDetails object itself. + */ + public ConsistencyCheckTaskDetails withVmDetails(List vmDetails) { + this.vmDetails = vmDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmDetails() != null) { + vmDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInput.java new file mode 100644 index 000000000000..4492a2a35628 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create network mappings input. */ +@Fluent +public final class CreateNetworkMappingInput { + /* + * Input properties for creating network mapping. + */ + @JsonProperty(value = "properties", required = true) + private CreateNetworkMappingInputProperties properties; + + /** Creates an instance of CreateNetworkMappingInput class. */ + public CreateNetworkMappingInput() { + } + + /** + * Get the properties property: Input properties for creating network mapping. + * + * @return the properties value. + */ + public CreateNetworkMappingInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Input properties for creating network mapping. + * + * @param properties the properties value to set. + * @return the CreateNetworkMappingInput object itself. + */ + public CreateNetworkMappingInput withProperties(CreateNetworkMappingInputProperties 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 CreateNetworkMappingInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateNetworkMappingInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInputProperties.java new file mode 100644 index 000000000000..ea4216924b7a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInputProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common input details for network mapping operation. */ +@Fluent +public final class CreateNetworkMappingInputProperties { + /* + * Recovery fabric Name. + */ + @JsonProperty(value = "recoveryFabricName") + private String recoveryFabricName; + + /* + * Recovery network Id. + */ + @JsonProperty(value = "recoveryNetworkId", required = true) + private String recoveryNetworkId; + + /* + * Fabric specific input properties. + */ + @JsonProperty(value = "fabricSpecificDetails") + private FabricSpecificCreateNetworkMappingInput fabricSpecificDetails; + + /** Creates an instance of CreateNetworkMappingInputProperties class. */ + public CreateNetworkMappingInputProperties() { + } + + /** + * Get the recoveryFabricName property: Recovery fabric Name. + * + * @return the recoveryFabricName value. + */ + public String recoveryFabricName() { + return this.recoveryFabricName; + } + + /** + * Set the recoveryFabricName property: Recovery fabric Name. + * + * @param recoveryFabricName the recoveryFabricName value to set. + * @return the CreateNetworkMappingInputProperties object itself. + */ + public CreateNetworkMappingInputProperties withRecoveryFabricName(String recoveryFabricName) { + this.recoveryFabricName = recoveryFabricName; + return this; + } + + /** + * Get the recoveryNetworkId property: Recovery network Id. + * + * @return the recoveryNetworkId value. + */ + public String recoveryNetworkId() { + return this.recoveryNetworkId; + } + + /** + * Set the recoveryNetworkId property: Recovery network Id. + * + * @param recoveryNetworkId the recoveryNetworkId value to set. + * @return the CreateNetworkMappingInputProperties object itself. + */ + public CreateNetworkMappingInputProperties withRecoveryNetworkId(String recoveryNetworkId) { + this.recoveryNetworkId = recoveryNetworkId; + return this; + } + + /** + * Get the fabricSpecificDetails property: Fabric specific input properties. + * + * @return the fabricSpecificDetails value. + */ + public FabricSpecificCreateNetworkMappingInput fabricSpecificDetails() { + return this.fabricSpecificDetails; + } + + /** + * Set the fabricSpecificDetails property: Fabric specific input properties. + * + * @param fabricSpecificDetails the fabricSpecificDetails value to set. + * @return the CreateNetworkMappingInputProperties object itself. + */ + public CreateNetworkMappingInputProperties withFabricSpecificDetails( + FabricSpecificCreateNetworkMappingInput fabricSpecificDetails) { + this.fabricSpecificDetails = fabricSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recoveryNetworkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryNetworkId in model CreateNetworkMappingInputProperties")); + } + if (fabricSpecificDetails() != null) { + fabricSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateNetworkMappingInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreatePolicyInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreatePolicyInput.java new file mode 100644 index 000000000000..988ee6a1a4dd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreatePolicyInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection Policy input. */ +@Fluent +public final class CreatePolicyInput { + /* + * Policy creation properties. + */ + @JsonProperty(value = "properties") + private CreatePolicyInputProperties properties; + + /** Creates an instance of CreatePolicyInput class. */ + public CreatePolicyInput() { + } + + /** + * Get the properties property: Policy creation properties. + * + * @return the properties value. + */ + public CreatePolicyInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Policy creation properties. + * + * @param properties the properties value to set. + * @return the CreatePolicyInput object itself. + */ + public CreatePolicyInput withProperties(CreatePolicyInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreatePolicyInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreatePolicyInputProperties.java new file mode 100644 index 000000000000..8001cd91e778 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreatePolicyInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Policy creation properties. */ +@Fluent +public final class CreatePolicyInputProperties { + /* + * The ReplicationProviderSettings. + */ + @JsonProperty(value = "providerSpecificInput") + private PolicyProviderSpecificInput providerSpecificInput; + + /** Creates an instance of CreatePolicyInputProperties class. */ + public CreatePolicyInputProperties() { + } + + /** + * Get the providerSpecificInput property: The ReplicationProviderSettings. + * + * @return the providerSpecificInput value. + */ + public PolicyProviderSpecificInput providerSpecificInput() { + return this.providerSpecificInput; + } + + /** + * Set the providerSpecificInput property: The ReplicationProviderSettings. + * + * @param providerSpecificInput the providerSpecificInput value to set. + * @return the CreatePolicyInputProperties object itself. + */ + public CreatePolicyInputProperties withProviderSpecificInput(PolicyProviderSpecificInput providerSpecificInput) { + this.providerSpecificInput = providerSpecificInput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificInput() != null) { + providerSpecificInput().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerInput.java new file mode 100644 index 000000000000..0fe5f9401ed6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create protection container input. */ +@Fluent +public final class CreateProtectionContainerInput { + /* + * Create protection container input properties. + */ + @JsonProperty(value = "properties") + private CreateProtectionContainerInputProperties properties; + + /** Creates an instance of CreateProtectionContainerInput class. */ + public CreateProtectionContainerInput() { + } + + /** + * Get the properties property: Create protection container input properties. + * + * @return the properties value. + */ + public CreateProtectionContainerInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Create protection container input properties. + * + * @param properties the properties value to set. + * @return the CreateProtectionContainerInput object itself. + */ + public CreateProtectionContainerInput withProperties(CreateProtectionContainerInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerInputProperties.java new file mode 100644 index 000000000000..f07b58a87bde --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Create protection container input properties. */ +@Fluent +public final class CreateProtectionContainerInputProperties { + /* + * Provider specific inputs for container creation. + */ + @JsonProperty(value = "providerSpecificInput") + private List providerSpecificInput; + + /** Creates an instance of CreateProtectionContainerInputProperties class. */ + public CreateProtectionContainerInputProperties() { + } + + /** + * Get the providerSpecificInput property: Provider specific inputs for container creation. + * + * @return the providerSpecificInput value. + */ + public List providerSpecificInput() { + return this.providerSpecificInput; + } + + /** + * Set the providerSpecificInput property: Provider specific inputs for container creation. + * + * @param providerSpecificInput the providerSpecificInput value to set. + * @return the CreateProtectionContainerInputProperties object itself. + */ + public CreateProtectionContainerInputProperties withProviderSpecificInput( + List providerSpecificInput) { + this.providerSpecificInput = providerSpecificInput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificInput() != null) { + providerSpecificInput().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerMappingInput.java new file mode 100644 index 000000000000..5db9d2011592 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configure pairing input. */ +@Fluent +public final class CreateProtectionContainerMappingInput { + /* + * Configure protection input properties. + */ + @JsonProperty(value = "properties") + private CreateProtectionContainerMappingInputProperties properties; + + /** Creates an instance of CreateProtectionContainerMappingInput class. */ + public CreateProtectionContainerMappingInput() { + } + + /** + * Get the properties property: Configure protection input properties. + * + * @return the properties value. + */ + public CreateProtectionContainerMappingInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Configure protection input properties. + * + * @param properties the properties value to set. + * @return the CreateProtectionContainerMappingInput object itself. + */ + public CreateProtectionContainerMappingInput withProperties( + CreateProtectionContainerMappingInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerMappingInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerMappingInputProperties.java new file mode 100644 index 000000000000..101576fdc09f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerMappingInputProperties.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configure pairing input properties. */ +@Fluent +public final class CreateProtectionContainerMappingInputProperties { + /* + * The target unique protection container name. + */ + @JsonProperty(value = "targetProtectionContainerId") + private String targetProtectionContainerId; + + /* + * Applicable policy. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * Provider specific input for pairing. + */ + @JsonProperty(value = "providerSpecificInput") + private ReplicationProviderSpecificContainerMappingInput providerSpecificInput; + + /** Creates an instance of CreateProtectionContainerMappingInputProperties class. */ + public CreateProtectionContainerMappingInputProperties() { + } + + /** + * Get the targetProtectionContainerId property: The target unique protection container name. + * + * @return the targetProtectionContainerId value. + */ + public String targetProtectionContainerId() { + return this.targetProtectionContainerId; + } + + /** + * Set the targetProtectionContainerId property: The target unique protection container name. + * + * @param targetProtectionContainerId the targetProtectionContainerId value to set. + * @return the CreateProtectionContainerMappingInputProperties object itself. + */ + public CreateProtectionContainerMappingInputProperties withTargetProtectionContainerId( + String targetProtectionContainerId) { + this.targetProtectionContainerId = targetProtectionContainerId; + return this; + } + + /** + * Get the policyId property: Applicable policy. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: Applicable policy. + * + * @param policyId the policyId value to set. + * @return the CreateProtectionContainerMappingInputProperties object itself. + */ + public CreateProtectionContainerMappingInputProperties withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the providerSpecificInput property: Provider specific input for pairing. + * + * @return the providerSpecificInput value. + */ + public ReplicationProviderSpecificContainerMappingInput providerSpecificInput() { + return this.providerSpecificInput; + } + + /** + * Set the providerSpecificInput property: Provider specific input for pairing. + * + * @param providerSpecificInput the providerSpecificInput value to set. + * @return the CreateProtectionContainerMappingInputProperties object itself. + */ + public CreateProtectionContainerMappingInputProperties withProviderSpecificInput( + ReplicationProviderSpecificContainerMappingInput providerSpecificInput) { + this.providerSpecificInput = providerSpecificInput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificInput() != null) { + providerSpecificInput().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentInput.java new file mode 100644 index 000000000000..d041e7f72eae --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create protection intent input. */ +@Fluent +public final class CreateProtectionIntentInput { + /* + * Create protection intent input properties. + */ + @JsonProperty(value = "properties") + private CreateProtectionIntentProperties properties; + + /** Creates an instance of CreateProtectionIntentInput class. */ + public CreateProtectionIntentInput() { + } + + /** + * Get the properties property: Create protection intent input properties. + * + * @return the properties value. + */ + public CreateProtectionIntentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Create protection intent input properties. + * + * @param properties the properties value to set. + * @return the CreateProtectionIntentInput object itself. + */ + public CreateProtectionIntentInput withProperties(CreateProtectionIntentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProperties.java new file mode 100644 index 000000000000..5223600ac1fc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create protection intent input properties. */ +@Fluent +public final class CreateProtectionIntentProperties { + /* + * The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. + */ + @JsonProperty(value = "providerSpecificDetails") + private CreateProtectionIntentProviderSpecificDetails providerSpecificDetails; + + /** Creates an instance of CreateProtectionIntentProperties class. */ + public CreateProtectionIntentProperties() { + } + + /** + * Get the providerSpecificDetails property: The ReplicationProviderInput. For A2A provider, it will be + * A2ACreateProtectionIntentInput object. + * + * @return the providerSpecificDetails value. + */ + public CreateProtectionIntentProviderSpecificDetails providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The ReplicationProviderInput. For A2A provider, it will be + * A2ACreateProtectionIntentInput object. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the CreateProtectionIntentProperties object itself. + */ + public CreateProtectionIntentProperties withProviderSpecificDetails( + CreateProtectionIntentProviderSpecificDetails providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProviderSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProviderSpecificDetails.java new file mode 100644 index 000000000000..1c28d2f90d8f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProviderSpecificDetails.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.recoveryservicessiterecovery.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; + +/** Create protection intent provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = CreateProtectionIntentProviderSpecificDetails.class) +@JsonTypeName("CreateProtectionIntentProviderSpecificDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "A2A", value = A2ACreateProtectionIntentInput.class)}) +@Immutable +public class CreateProtectionIntentProviderSpecificDetails { + /** Creates an instance of CreateProtectionIntentProviderSpecificDetails class. */ + public CreateProtectionIntentProviderSpecificDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInput.java new file mode 100644 index 000000000000..71ff4d97552e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create recovery plan input class. */ +@Fluent +public final class CreateRecoveryPlanInput { + /* + * Recovery plan creation properties. + */ + @JsonProperty(value = "properties", required = true) + private CreateRecoveryPlanInputProperties properties; + + /** Creates an instance of CreateRecoveryPlanInput class. */ + public CreateRecoveryPlanInput() { + } + + /** + * Get the properties property: Recovery plan creation properties. + * + * @return the properties value. + */ + public CreateRecoveryPlanInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Recovery plan creation properties. + * + * @param properties the properties value to set. + * @return the CreateRecoveryPlanInput object itself. + */ + public CreateRecoveryPlanInput withProperties(CreateRecoveryPlanInputProperties 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 CreateRecoveryPlanInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateRecoveryPlanInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInputProperties.java new file mode 100644 index 000000000000..30f3527d976f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan creation properties. */ +@Fluent +public final class CreateRecoveryPlanInputProperties { + /* + * The primary fabric Id. + */ + @JsonProperty(value = "primaryFabricId", required = true) + private String primaryFabricId; + + /* + * The recovery fabric Id. + */ + @JsonProperty(value = "recoveryFabricId", required = true) + private String recoveryFabricId; + + /* + * The failover deployment model. + */ + @JsonProperty(value = "failoverDeploymentModel") + private FailoverDeploymentModel failoverDeploymentModel; + + /* + * The recovery plan groups. + */ + @JsonProperty(value = "groups", required = true) + private List groups; + + /* + * The provider specific input. + */ + @JsonProperty(value = "providerSpecificInput") + private List providerSpecificInput; + + /** Creates an instance of CreateRecoveryPlanInputProperties class. */ + public CreateRecoveryPlanInputProperties() { + } + + /** + * Get the primaryFabricId property: The primary fabric Id. + * + * @return the primaryFabricId value. + */ + public String primaryFabricId() { + return this.primaryFabricId; + } + + /** + * Set the primaryFabricId property: The primary fabric Id. + * + * @param primaryFabricId the primaryFabricId value to set. + * @return the CreateRecoveryPlanInputProperties object itself. + */ + public CreateRecoveryPlanInputProperties withPrimaryFabricId(String primaryFabricId) { + this.primaryFabricId = primaryFabricId; + return this; + } + + /** + * Get the recoveryFabricId property: The recovery fabric Id. + * + * @return the recoveryFabricId value. + */ + public String recoveryFabricId() { + return this.recoveryFabricId; + } + + /** + * Set the recoveryFabricId property: The recovery fabric Id. + * + * @param recoveryFabricId the recoveryFabricId value to set. + * @return the CreateRecoveryPlanInputProperties object itself. + */ + public CreateRecoveryPlanInputProperties withRecoveryFabricId(String recoveryFabricId) { + this.recoveryFabricId = recoveryFabricId; + return this; + } + + /** + * Get the failoverDeploymentModel property: The failover deployment model. + * + * @return the failoverDeploymentModel value. + */ + public FailoverDeploymentModel failoverDeploymentModel() { + return this.failoverDeploymentModel; + } + + /** + * Set the failoverDeploymentModel property: The failover deployment model. + * + * @param failoverDeploymentModel the failoverDeploymentModel value to set. + * @return the CreateRecoveryPlanInputProperties object itself. + */ + public CreateRecoveryPlanInputProperties withFailoverDeploymentModel( + FailoverDeploymentModel failoverDeploymentModel) { + this.failoverDeploymentModel = failoverDeploymentModel; + return this; + } + + /** + * Get the groups property: The recovery plan groups. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The recovery plan groups. + * + * @param groups the groups value to set. + * @return the CreateRecoveryPlanInputProperties object itself. + */ + public CreateRecoveryPlanInputProperties withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the providerSpecificInput property: The provider specific input. + * + * @return the providerSpecificInput value. + */ + public List providerSpecificInput() { + return this.providerSpecificInput; + } + + /** + * Set the providerSpecificInput property: The provider specific input. + * + * @param providerSpecificInput the providerSpecificInput value to set. + * @return the CreateRecoveryPlanInputProperties object itself. + */ + public CreateRecoveryPlanInputProperties withProviderSpecificInput( + List providerSpecificInput) { + this.providerSpecificInput = providerSpecificInput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (primaryFabricId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property primaryFabricId in model CreateRecoveryPlanInputProperties")); + } + if (recoveryFabricId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryFabricId in model CreateRecoveryPlanInputProperties")); + } + if (groups() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property groups in model CreateRecoveryPlanInputProperties")); + } else { + groups().forEach(e -> e.validate()); + } + if (providerSpecificInput() != null) { + providerSpecificInput().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateRecoveryPlanInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CriticalJobHistoryDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CriticalJobHistoryDetails.java new file mode 100644 index 000000000000..17007527f2c4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CriticalJobHistoryDetails.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Critical past job details of the migration item. */ +@Immutable +public final class CriticalJobHistoryDetails { + /* + * The job name. + */ + @JsonProperty(value = "jobName", access = JsonProperty.Access.WRITE_ONLY) + private String jobName; + + /* + * The ARM Id of the job being executed. + */ + @JsonProperty(value = "jobId", access = JsonProperty.Access.WRITE_ONLY) + private String jobId; + + /* + * The start time of the job. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The job state. + */ + @JsonProperty(value = "jobStatus", access = JsonProperty.Access.WRITE_ONLY) + private String jobStatus; + + /** Creates an instance of CriticalJobHistoryDetails class. */ + public CriticalJobHistoryDetails() { + } + + /** + * Get the jobName property: The job name. + * + * @return the jobName value. + */ + public String jobName() { + return this.jobName; + } + + /** + * Get the jobId property: The ARM Id of the job being executed. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Get the startTime property: The start time of the job. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the jobStatus property: The job state. + * + * @return the jobStatus value. + */ + public String jobStatus() { + return this.jobStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentJobDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentJobDetails.java new file mode 100644 index 000000000000..8c87fd7f7023 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentJobDetails.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Current job details of the migration item. */ +@Immutable +public final class CurrentJobDetails { + /* + * The job name. + */ + @JsonProperty(value = "jobName", access = JsonProperty.Access.WRITE_ONLY) + private String jobName; + + /* + * The ARM Id of the job being executed. + */ + @JsonProperty(value = "jobId", access = JsonProperty.Access.WRITE_ONLY) + private String jobId; + + /* + * The start time of the job. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /** Creates an instance of CurrentJobDetails class. */ + public CurrentJobDetails() { + } + + /** + * Get the jobName property: The job name. + * + * @return the jobName value. + */ + public String jobName() { + return this.jobName; + } + + /** + * Get the jobId property: The ARM Id of the job being executed. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Get the startTime property: The start time of the job. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentScenarioDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentScenarioDetails.java new file mode 100644 index 000000000000..c21fe720b704 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentScenarioDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Current scenario details of the protected entity. */ +@Fluent +public final class CurrentScenarioDetails { + /* + * Scenario name. + */ + @JsonProperty(value = "scenarioName") + private String scenarioName; + + /* + * ARM Id of the job being executed. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /* + * Start time of the workflow. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /** Creates an instance of CurrentScenarioDetails class. */ + public CurrentScenarioDetails() { + } + + /** + * Get the scenarioName property: Scenario name. + * + * @return the scenarioName value. + */ + public String scenarioName() { + return this.scenarioName; + } + + /** + * Set the scenarioName property: Scenario name. + * + * @param scenarioName the scenarioName value to set. + * @return the CurrentScenarioDetails object itself. + */ + public CurrentScenarioDetails withScenarioName(String scenarioName) { + this.scenarioName = scenarioName; + return this; + } + + /** + * Get the jobId property: ARM Id of the job being executed. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: ARM Id of the job being executed. + * + * @param jobId the jobId value to set. + * @return the CurrentScenarioDetails object itself. + */ + public CurrentScenarioDetails withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the startTime property: Start time of the workflow. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of the workflow. + * + * @param startTime the startTime value to set. + * @return the CurrentScenarioDetails object itself. + */ + public CurrentScenarioDetails withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DataStore.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DataStore.java new file mode 100644 index 000000000000..ffed8e995568 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DataStore.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The datastore details of the MT. */ +@Fluent +public final class DataStore { + /* + * The symbolic name of data store. + */ + @JsonProperty(value = "symbolicName") + private String symbolicName; + + /* + * The uuid of data store. + */ + @JsonProperty(value = "uuid") + private String uuid; + + /* + * The capacity of data store in GBs. + */ + @JsonProperty(value = "capacity") + private String capacity; + + /* + * The free space of data store in GBs. + */ + @JsonProperty(value = "freeSpace") + private String freeSpace; + + /* + * The type of data store. + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of DataStore class. */ + public DataStore() { + } + + /** + * Get the symbolicName property: The symbolic name of data store. + * + * @return the symbolicName value. + */ + public String symbolicName() { + return this.symbolicName; + } + + /** + * Set the symbolicName property: The symbolic name of data store. + * + * @param symbolicName the symbolicName value to set. + * @return the DataStore object itself. + */ + public DataStore withSymbolicName(String symbolicName) { + this.symbolicName = symbolicName; + return this; + } + + /** + * Get the uuid property: The uuid of data store. + * + * @return the uuid value. + */ + public String uuid() { + return this.uuid; + } + + /** + * Set the uuid property: The uuid of data store. + * + * @param uuid the uuid value to set. + * @return the DataStore object itself. + */ + public DataStore withUuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get the capacity property: The capacity of data store in GBs. + * + * @return the capacity value. + */ + public String capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The capacity of data store in GBs. + * + * @param capacity the capacity value to set. + * @return the DataStore object itself. + */ + public DataStore withCapacity(String capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the freeSpace property: The free space of data store in GBs. + * + * @return the freeSpace value. + */ + public String freeSpace() { + return this.freeSpace; + } + + /** + * Set the freeSpace property: The free space of data store in GBs. + * + * @param freeSpace the freeSpace value to set. + * @return the DataStore object itself. + */ + public DataStore withFreeSpace(String freeSpace) { + this.freeSpace = freeSpace; + return this; + } + + /** + * Get the type property: The type of data store. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of data store. + * + * @param type the type value to set. + * @return the DataStore object itself. + */ + public DataStore 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DataSyncStatus.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DataSyncStatus.java new file mode 100644 index 000000000000..210cf1b8ebf3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DataSyncStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The data sync option. */ +public final class DataSyncStatus extends ExpandableStringEnum { + /** Static value ForDownTime for DataSyncStatus. */ + public static final DataSyncStatus FOR_DOWN_TIME = fromString("ForDownTime"); + + /** Static value ForSynchronization for DataSyncStatus. */ + public static final DataSyncStatus FOR_SYNCHRONIZATION = fromString("ForSynchronization"); + + /** + * Creates or finds a DataSyncStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataSyncStatus. + */ + @JsonCreator + public static DataSyncStatus fromString(String name) { + return fromString(name, DataSyncStatus.class); + } + + /** + * Gets known DataSyncStatus values. + * + * @return known DataSyncStatus values. + */ + public static Collection values() { + return values(DataSyncStatus.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInput.java new file mode 100644 index 000000000000..41cc34e8fec2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disable protection input. */ +@Fluent +public final class DisableProtectionInput { + /* + * Disable protection input properties. + */ + @JsonProperty(value = "properties", required = true) + private DisableProtectionInputProperties properties; + + /** Creates an instance of DisableProtectionInput class. */ + public DisableProtectionInput() { + } + + /** + * Get the properties property: Disable protection input properties. + * + * @return the properties value. + */ + public DisableProtectionInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Disable protection input properties. + * + * @param properties the properties value to set. + * @return the DisableProtectionInput object itself. + */ + public DisableProtectionInput withProperties(DisableProtectionInputProperties 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 DisableProtectionInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DisableProtectionInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInputProperties.java new file mode 100644 index 000000000000..d11002b1547e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disable protection input properties. */ +@Fluent +public final class DisableProtectionInputProperties { + /* + * Disable protection reason. It can have values NotSpecified/MigrationComplete. + */ + @JsonProperty(value = "disableProtectionReason") + private DisableProtectionReason disableProtectionReason; + + /* + * Replication provider specific input. + */ + @JsonProperty(value = "replicationProviderInput") + private DisableProtectionProviderSpecificInput replicationProviderInput; + + /** Creates an instance of DisableProtectionInputProperties class. */ + public DisableProtectionInputProperties() { + } + + /** + * Get the disableProtectionReason property: Disable protection reason. It can have values + * NotSpecified/MigrationComplete. + * + * @return the disableProtectionReason value. + */ + public DisableProtectionReason disableProtectionReason() { + return this.disableProtectionReason; + } + + /** + * Set the disableProtectionReason property: Disable protection reason. It can have values + * NotSpecified/MigrationComplete. + * + * @param disableProtectionReason the disableProtectionReason value to set. + * @return the DisableProtectionInputProperties object itself. + */ + public DisableProtectionInputProperties withDisableProtectionReason( + DisableProtectionReason disableProtectionReason) { + this.disableProtectionReason = disableProtectionReason; + return this; + } + + /** + * Get the replicationProviderInput property: Replication provider specific input. + * + * @return the replicationProviderInput value. + */ + public DisableProtectionProviderSpecificInput replicationProviderInput() { + return this.replicationProviderInput; + } + + /** + * Set the replicationProviderInput property: Replication provider specific input. + * + * @param replicationProviderInput the replicationProviderInput value to set. + * @return the DisableProtectionInputProperties object itself. + */ + public DisableProtectionInputProperties withReplicationProviderInput( + DisableProtectionProviderSpecificInput replicationProviderInput) { + this.replicationProviderInput = replicationProviderInput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (replicationProviderInput() != null) { + replicationProviderInput().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionProviderSpecificInput.java new file mode 100644 index 000000000000..f44e73aaf10c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Disable protection provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = DisableProtectionProviderSpecificInput.class) +@JsonTypeName("DisableProtectionProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "InMage", value = InMageDisableProtectionProviderSpecificInput.class)}) +@Immutable +public class DisableProtectionProviderSpecificInput { + /** Creates an instance of DisableProtectionProviderSpecificInput class. */ + public DisableProtectionProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionReason.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionReason.java new file mode 100644 index 000000000000..22266d82fe7f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionReason.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Disable protection reason. It can have values NotSpecified/MigrationComplete. */ +public final class DisableProtectionReason extends ExpandableStringEnum { + /** Static value NotSpecified for DisableProtectionReason. */ + public static final DisableProtectionReason NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value MigrationComplete for DisableProtectionReason. */ + public static final DisableProtectionReason MIGRATION_COMPLETE = fromString("MigrationComplete"); + + /** + * Creates or finds a DisableProtectionReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding DisableProtectionReason. + */ + @JsonCreator + public static DisableProtectionReason fromString(String name) { + return fromString(name, DisableProtectionReason.class); + } + + /** + * Gets known DisableProtectionReason values. + * + * @return known DisableProtectionReason values. + */ + public static Collection values() { + return values(DisableProtectionReason.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiscoverProtectableItemRequest.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiscoverProtectableItemRequest.java new file mode 100644 index 000000000000..a2d93bbebc2f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiscoverProtectableItemRequest.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to add a physical machine as a protectable item in a container. */ +@Fluent +public final class DiscoverProtectableItemRequest { + /* + * The properties of a discover protectable item request. + */ + @JsonProperty(value = "properties") + private DiscoverProtectableItemRequestProperties properties; + + /** Creates an instance of DiscoverProtectableItemRequest class. */ + public DiscoverProtectableItemRequest() { + } + + /** + * Get the properties property: The properties of a discover protectable item request. + * + * @return the properties value. + */ + public DiscoverProtectableItemRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of a discover protectable item request. + * + * @param properties the properties value to set. + * @return the DiscoverProtectableItemRequest object itself. + */ + public DiscoverProtectableItemRequest withProperties(DiscoverProtectableItemRequestProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiscoverProtectableItemRequestProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiscoverProtectableItemRequestProperties.java new file mode 100644 index 000000000000..b6bf5ea20131 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiscoverProtectableItemRequestProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Discover protectable item properties. */ +@Fluent +public final class DiscoverProtectableItemRequestProperties { + /* + * The friendly name of the physical machine. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The IP address of the physical machine to be discovered. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The OS type on the physical machine. + */ + @JsonProperty(value = "osType") + private String osType; + + /** Creates an instance of DiscoverProtectableItemRequestProperties class. */ + public DiscoverProtectableItemRequestProperties() { + } + + /** + * Get the friendlyName property: The friendly name of the physical machine. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name of the physical machine. + * + * @param friendlyName the friendlyName value to set. + * @return the DiscoverProtectableItemRequestProperties object itself. + */ + public DiscoverProtectableItemRequestProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the ipAddress property: The IP address of the physical machine to be discovered. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address of the physical machine to be discovered. + * + * @param ipAddress the ipAddress value to set. + * @return the DiscoverProtectableItemRequestProperties object itself. + */ + public DiscoverProtectableItemRequestProperties withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the osType property: The OS type on the physical machine. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type on the physical machine. + * + * @param osType the osType value to set. + * @return the DiscoverProtectableItemRequestProperties object itself. + */ + public DiscoverProtectableItemRequestProperties withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskAccountType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskAccountType.java new file mode 100644 index 000000000000..0e99e720eb2f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskAccountType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The DiskType. */ +public final class DiskAccountType extends ExpandableStringEnum { + /** Static value Standard_LRS for DiskAccountType. */ + public static final DiskAccountType STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for DiskAccountType. */ + public static final DiskAccountType PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value StandardSSD_LRS for DiskAccountType. */ + public static final DiskAccountType STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** + * Creates or finds a DiskAccountType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskAccountType. + */ + @JsonCreator + public static DiskAccountType fromString(String name) { + return fromString(name, DiskAccountType.class); + } + + /** + * Gets known DiskAccountType values. + * + * @return known DiskAccountType values. + */ + public static Collection values() { + return values(DiskAccountType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskDetails.java new file mode 100644 index 000000000000..5f30050b1e69 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Onprem disk details data. */ +@Fluent +public final class DiskDetails { + /* + * The hard disk max size in MB. + */ + @JsonProperty(value = "maxSizeMB") + private Long maxSizeMB; + + /* + * The type of the volume. + */ + @JsonProperty(value = "vhdType") + private String vhdType; + + /* + * The VHD Id. + */ + @JsonProperty(value = "vhdId") + private String vhdId; + + /* + * The VHD name. + */ + @JsonProperty(value = "vhdName") + private String vhdName; + + /** Creates an instance of DiskDetails class. */ + public DiskDetails() { + } + + /** + * Get the maxSizeMB property: The hard disk max size in MB. + * + * @return the maxSizeMB value. + */ + public Long maxSizeMB() { + return this.maxSizeMB; + } + + /** + * Set the maxSizeMB property: The hard disk max size in MB. + * + * @param maxSizeMB the maxSizeMB value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withMaxSizeMB(Long maxSizeMB) { + this.maxSizeMB = maxSizeMB; + return this; + } + + /** + * Get the vhdType property: The type of the volume. + * + * @return the vhdType value. + */ + public String vhdType() { + return this.vhdType; + } + + /** + * Set the vhdType property: The type of the volume. + * + * @param vhdType the vhdType value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withVhdType(String vhdType) { + this.vhdType = vhdType; + return this; + } + + /** + * Get the vhdId property: The VHD Id. + * + * @return the vhdId value. + */ + public String vhdId() { + return this.vhdId; + } + + /** + * Set the vhdId property: The VHD Id. + * + * @param vhdId the vhdId value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withVhdId(String vhdId) { + this.vhdId = vhdId; + return this; + } + + /** + * Get the vhdName property: The VHD name. + * + * @return the vhdName value. + */ + public String vhdName() { + return this.vhdName; + } + + /** + * Set the vhdName property: The VHD name. + * + * @param vhdName the vhdName value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withVhdName(String vhdName) { + this.vhdName = vhdName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskEncryptionInfo.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskEncryptionInfo.java new file mode 100644 index 000000000000..afa521470f06 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskEncryptionInfo.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery disk encryption info (BEK and KEK). */ +@Fluent +public final class DiskEncryptionInfo { + /* + * The recovery KeyVault reference for secret. + */ + @JsonProperty(value = "diskEncryptionKeyInfo") + private DiskEncryptionKeyInfo diskEncryptionKeyInfo; + + /* + * The recovery KeyVault reference for key. + */ + @JsonProperty(value = "keyEncryptionKeyInfo") + private KeyEncryptionKeyInfo keyEncryptionKeyInfo; + + /** Creates an instance of DiskEncryptionInfo class. */ + public DiskEncryptionInfo() { + } + + /** + * Get the diskEncryptionKeyInfo property: The recovery KeyVault reference for secret. + * + * @return the diskEncryptionKeyInfo value. + */ + public DiskEncryptionKeyInfo diskEncryptionKeyInfo() { + return this.diskEncryptionKeyInfo; + } + + /** + * Set the diskEncryptionKeyInfo property: The recovery KeyVault reference for secret. + * + * @param diskEncryptionKeyInfo the diskEncryptionKeyInfo value to set. + * @return the DiskEncryptionInfo object itself. + */ + public DiskEncryptionInfo withDiskEncryptionKeyInfo(DiskEncryptionKeyInfo diskEncryptionKeyInfo) { + this.diskEncryptionKeyInfo = diskEncryptionKeyInfo; + return this; + } + + /** + * Get the keyEncryptionKeyInfo property: The recovery KeyVault reference for key. + * + * @return the keyEncryptionKeyInfo value. + */ + public KeyEncryptionKeyInfo keyEncryptionKeyInfo() { + return this.keyEncryptionKeyInfo; + } + + /** + * Set the keyEncryptionKeyInfo property: The recovery KeyVault reference for key. + * + * @param keyEncryptionKeyInfo the keyEncryptionKeyInfo value to set. + * @return the DiskEncryptionInfo object itself. + */ + public DiskEncryptionInfo withKeyEncryptionKeyInfo(KeyEncryptionKeyInfo keyEncryptionKeyInfo) { + this.keyEncryptionKeyInfo = keyEncryptionKeyInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionKeyInfo() != null) { + diskEncryptionKeyInfo().validate(); + } + if (keyEncryptionKeyInfo() != null) { + keyEncryptionKeyInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskEncryptionKeyInfo.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskEncryptionKeyInfo.java new file mode 100644 index 000000000000..432a29b0ea37 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskEncryptionKeyInfo.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). */ +@Fluent +public final class DiskEncryptionKeyInfo { + /* + * The secret url / identifier. + */ + @JsonProperty(value = "secretIdentifier") + private String secretIdentifier; + + /* + * The KeyVault resource ARM id for secret. + */ + @JsonProperty(value = "keyVaultResourceArmId") + private String keyVaultResourceArmId; + + /** Creates an instance of DiskEncryptionKeyInfo class. */ + public DiskEncryptionKeyInfo() { + } + + /** + * Get the secretIdentifier property: The secret url / identifier. + * + * @return the secretIdentifier value. + */ + public String secretIdentifier() { + return this.secretIdentifier; + } + + /** + * Set the secretIdentifier property: The secret url / identifier. + * + * @param secretIdentifier the secretIdentifier value to set. + * @return the DiskEncryptionKeyInfo object itself. + */ + public DiskEncryptionKeyInfo withSecretIdentifier(String secretIdentifier) { + this.secretIdentifier = secretIdentifier; + return this; + } + + /** + * Get the keyVaultResourceArmId property: The KeyVault resource ARM id for secret. + * + * @return the keyVaultResourceArmId value. + */ + public String keyVaultResourceArmId() { + return this.keyVaultResourceArmId; + } + + /** + * Set the keyVaultResourceArmId property: The KeyVault resource ARM id for secret. + * + * @param keyVaultResourceArmId the keyVaultResourceArmId value to set. + * @return the DiskEncryptionKeyInfo object itself. + */ + public DiskEncryptionKeyInfo withKeyVaultResourceArmId(String keyVaultResourceArmId) { + this.keyVaultResourceArmId = keyVaultResourceArmId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskReplicationProgressHealth.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskReplicationProgressHealth.java new file mode 100644 index 000000000000..c189913672fe --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskReplicationProgressHealth.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The progress health. */ +public final class DiskReplicationProgressHealth extends ExpandableStringEnum { + /** Static value None for DiskReplicationProgressHealth. */ + public static final DiskReplicationProgressHealth NONE = fromString("None"); + + /** Static value InProgress for DiskReplicationProgressHealth. */ + public static final DiskReplicationProgressHealth IN_PROGRESS = fromString("InProgress"); + + /** Static value SlowProgress for DiskReplicationProgressHealth. */ + public static final DiskReplicationProgressHealth SLOW_PROGRESS = fromString("SlowProgress"); + + /** Static value NoProgress for DiskReplicationProgressHealth. */ + public static final DiskReplicationProgressHealth NO_PROGRESS = fromString("NoProgress"); + + /** Static value Queued for DiskReplicationProgressHealth. */ + public static final DiskReplicationProgressHealth QUEUED = fromString("Queued"); + + /** + * Creates or finds a DiskReplicationProgressHealth from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskReplicationProgressHealth. + */ + @JsonCreator + public static DiskReplicationProgressHealth fromString(String name) { + return fromString(name, DiskReplicationProgressHealth.class); + } + + /** + * Gets known DiskReplicationProgressHealth values. + * + * @return known DiskReplicationProgressHealth values. + */ + public static Collection values() { + return values(DiskReplicationProgressHealth.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskVolumeDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskVolumeDetails.java new file mode 100644 index 000000000000..28cfd5dd5566 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskVolumeDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume details. */ +@Fluent +public final class DiskVolumeDetails { + /* + * The volume label. + */ + @JsonProperty(value = "label") + private String label; + + /* + * The volume name. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of DiskVolumeDetails class. */ + public DiskVolumeDetails() { + } + + /** + * Get the label property: The volume label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: The volume label. + * + * @param label the label value to set. + * @return the DiskVolumeDetails object itself. + */ + public DiskVolumeDetails withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the name property: The volume name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The volume name. + * + * @param name the name value to set. + * @return the DiskVolumeDetails object itself. + */ + public DiskVolumeDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Display.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Display.java new file mode 100644 index 000000000000..683d65f8fa30 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Display.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the localized display information for this particular operation / action. These value will be used by + * several clients for (1) custom role definitions for RBAC; (2) complex query filters for the event service; and (3) + * audit history / records for management operations. + */ +@Fluent +public final class Display { + /* + * The provider. The localized friendly form of the resource provider name - it is expected to also include the + * publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. + * e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The resource. The localized friendly form of the resource related to this action/operation - it should match the + * public documentation for the resource provider. It should use Title Casing. This value should be unique for a + * particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual + * Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The operation. The localized friendly name for the operation, as it should be shown to the user. It should be + * concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive + * guidance: Read Create or Update Delete 'ActionName'. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The description. The localized friendly description for the operation, as it should be shown to the user. It + * should be thorough, yet concise - it will be used in tool tips and detailed views. Prescriptive guidance for + * namespaces: Read any 'display.provider' resource Create or Update any 'display.provider' resource Delete any + * 'display.provider' resource Perform any other action on any 'display.provider' resource Prescriptive guidance + * for namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any + * 'display.resource' 'ActionName' any 'display.resources'. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of Display class. */ + public Display() { + } + + /** + * Get the provider property: The provider. The localized friendly form of the resource provider name - it is + * expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" + * for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The provider. The localized friendly form of the resource provider name - it is + * expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" + * for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + * + * @param provider the provider value to set. + * @return the Display object itself. + */ + public Display withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The resource. The localized friendly form of the resource related to this + * action/operation - it should match the public documentation for the resource provider. It should use Title + * Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their + * parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM + * Sizes" or "Scheduler Jobs". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The resource. The localized friendly form of the resource related to this + * action/operation - it should match the public documentation for the resource provider. It should use Title + * Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their + * parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM + * Sizes" or "Scheduler Jobs". + * + * @param resource the resource value to set. + * @return the Display object itself. + */ + public Display withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The operation. The localized friendly name for the operation, as it should be shown + * to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title + * Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation. The localized friendly name for the operation, as it should be shown + * to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title + * Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + * + * @param operation the operation value to set. + * @return the Display object itself. + */ + public Display withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The description. The localized friendly description for the operation, as it should + * be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. + * Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any + * 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any + * 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update + * any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description. The localized friendly description for the operation, as it should + * be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views. + * Prescriptive guidance for namespaces: Read any 'display.provider' resource Create or Update any + * 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any + * 'display.provider' resource Prescriptive guidance for namespaces: Read any 'display.resource' Create or Update + * any 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + * + * @param description the description value to set. + * @return the Display object itself. + */ + public Display withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DraDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DraDetails.java new file mode 100644 index 000000000000..39697a1436c1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DraDetails.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** DRA details. */ +@Immutable +public final class DraDetails { + /* + * The DRA Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The DRA name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The DRA Bios Id. + */ + @JsonProperty(value = "biosId", access = JsonProperty.Access.WRITE_ONLY) + private String biosId; + + /* + * The version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The last heartbeat received from the DRA. + */ + @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeatUtc; + + /* + * The health. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth health; + + /* + * The health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /* + * The count of protected items which are protected in forward direction. + */ + @JsonProperty(value = "forwardProtectedItemCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer forwardProtectedItemCount; + + /* + * The count of protected items which are protected in reverse direction. + */ + @JsonProperty(value = "reverseProtectedItemCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer reverseProtectedItemCount; + + /** Creates an instance of DraDetails class. */ + public DraDetails() { + } + + /** + * Get the id property: The DRA Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The DRA name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the biosId property: The DRA Bios Id. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the lastHeartbeatUtc property: The last heartbeat received from the DRA. + * + * @return the lastHeartbeatUtc value. + */ + public OffsetDateTime lastHeartbeatUtc() { + return this.lastHeartbeatUtc; + } + + /** + * Get the health property: The health. + * + * @return the health value. + */ + public ProtectionHealth health() { + return this.health; + } + + /** + * Get the healthErrors property: The health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Get the forwardProtectedItemCount property: The count of protected items which are protected in forward + * direction. + * + * @return the forwardProtectedItemCount value. + */ + public Integer forwardProtectedItemCount() { + return this.forwardProtectedItemCount; + } + + /** + * Get the reverseProtectedItemCount property: The count of protected items which are protected in reverse + * direction. + * + * @return the reverseProtectedItemCount value. + */ + public Integer reverseProtectedItemCount() { + return this.reverseProtectedItemCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInput.java new file mode 100644 index 000000000000..c681b2299a38 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInput.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enable migration input. */ +@Fluent +public final class EnableMigrationInput { + /* + * Enable migration input properties. + */ + @JsonProperty(value = "properties", required = true) + private EnableMigrationInputProperties properties; + + /** Creates an instance of EnableMigrationInput class. */ + public EnableMigrationInput() { + } + + /** + * Get the properties property: Enable migration input properties. + * + * @return the properties value. + */ + public EnableMigrationInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Enable migration input properties. + * + * @param properties the properties value to set. + * @return the EnableMigrationInput object itself. + */ + public EnableMigrationInput withProperties(EnableMigrationInputProperties 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 EnableMigrationInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EnableMigrationInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInputProperties.java new file mode 100644 index 000000000000..ce19cf2872c5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInputProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enable migration input properties. */ +@Fluent +public final class EnableMigrationInputProperties { + /* + * The policy Id. + */ + @JsonProperty(value = "policyId", required = true) + private String policyId; + + /* + * The provider specific details. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private EnableMigrationProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of EnableMigrationInputProperties class. */ + public EnableMigrationInputProperties() { + } + + /** + * Get the policyId property: The policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: The policy Id. + * + * @param policyId the policyId value to set. + * @return the EnableMigrationInputProperties object itself. + */ + public EnableMigrationInputProperties withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider specific details. + * + * @return the providerSpecificDetails value. + */ + public EnableMigrationProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific details. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the EnableMigrationInputProperties object itself. + */ + public EnableMigrationInputProperties withProviderSpecificDetails( + EnableMigrationProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property policyId in model EnableMigrationInputProperties")); + } + if (providerSpecificDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerSpecificDetails in model EnableMigrationInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EnableMigrationInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationProviderSpecificInput.java new file mode 100644 index 000000000000..99a31eb622db --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Enable migration provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = EnableMigrationProviderSpecificInput.class) +@JsonTypeName("EnableMigrationProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtEnableMigrationInput.class)}) +@Immutable +public class EnableMigrationProviderSpecificInput { + /** Creates an instance of EnableMigrationProviderSpecificInput class. */ + public EnableMigrationProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionInput.java new file mode 100644 index 000000000000..67d1792fd10a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enable protection input. */ +@Fluent +public final class EnableProtectionInput { + /* + * Enable protection input properties. + */ + @JsonProperty(value = "properties") + private EnableProtectionInputProperties properties; + + /** Creates an instance of EnableProtectionInput class. */ + public EnableProtectionInput() { + } + + /** + * Get the properties property: Enable protection input properties. + * + * @return the properties value. + */ + public EnableProtectionInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Enable protection input properties. + * + * @param properties the properties value to set. + * @return the EnableProtectionInput object itself. + */ + public EnableProtectionInput withProperties(EnableProtectionInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionInputProperties.java new file mode 100644 index 000000000000..2ccf453a06b7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionInputProperties.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enable protection input properties. */ +@Fluent +public final class EnableProtectionInputProperties { + /* + * The Policy Id. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * The protectable item Id. + */ + @JsonProperty(value = "protectableItemId") + private String protectableItemId; + + /* + * The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For + * San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + */ + @JsonProperty(value = "providerSpecificDetails") + private EnableProtectionProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of EnableProtectionInputProperties class. */ + public EnableProtectionInputProperties() { + } + + /** + * Get the policyId property: The Policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: The Policy Id. + * + * @param policyId the policyId value to set. + * @return the EnableProtectionInputProperties object itself. + */ + public EnableProtectionInputProperties withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the protectableItemId property: The protectable item Id. + * + * @return the protectableItemId value. + */ + public String protectableItemId() { + return this.protectableItemId; + } + + /** + * Set the protectableItemId property: The protectable item Id. + * + * @param protectableItemId the protectableItemId value to set. + * @return the EnableProtectionInputProperties object itself. + */ + public EnableProtectionInputProperties withProtectableItemId(String protectableItemId) { + this.protectableItemId = protectableItemId; + return this; + } + + /** + * Get the providerSpecificDetails property: The ReplicationProviderInput. For HyperVReplicaAzure provider, it will + * be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For + * HyperVReplicaAzure provider, it can be null. + * + * @return the providerSpecificDetails value. + */ + public EnableProtectionProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The ReplicationProviderInput. For HyperVReplicaAzure provider, it will + * be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For + * HyperVReplicaAzure provider, it can be null. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the EnableProtectionInputProperties object itself. + */ + public EnableProtectionInputProperties withProviderSpecificDetails( + EnableProtectionProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionProviderSpecificInput.java new file mode 100644 index 000000000000..f25193eb410a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Enable protection provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = EnableProtectionProviderSpecificInput.class) +@JsonTypeName("EnableProtectionProviderSpecificInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2ACrossClusterMigration", value = A2ACrossClusterMigrationEnableProtectionInput.class), + @JsonSubTypes.Type(name = "A2A", value = A2AEnableProtectionInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzureEnableProtectionInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2EnableProtectionInput.class), + @JsonSubTypes.Type(name = "InMage", value = InMageEnableProtectionInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmEnableProtectionInput.class) +}) +@Immutable +public class EnableProtectionProviderSpecificInput { + /** Creates an instance of EnableProtectionProviderSpecificInput class. */ + public EnableProtectionProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EncryptionDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EncryptionDetails.java new file mode 100644 index 000000000000..4e99481d9dac --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EncryptionDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Encryption details for the fabric. */ +@Fluent +public final class EncryptionDetails { + /* + * The key encryption key state for the Vmm. + */ + @JsonProperty(value = "kekState") + private String kekState; + + /* + * The key encryption key certificate thumbprint. + */ + @JsonProperty(value = "kekCertThumbprint") + private String kekCertThumbprint; + + /* + * The key encryption key certificate expiry date. + */ + @JsonProperty(value = "kekCertExpiryDate") + private OffsetDateTime kekCertExpiryDate; + + /** Creates an instance of EncryptionDetails class. */ + public EncryptionDetails() { + } + + /** + * Get the kekState property: The key encryption key state for the Vmm. + * + * @return the kekState value. + */ + public String kekState() { + return this.kekState; + } + + /** + * Set the kekState property: The key encryption key state for the Vmm. + * + * @param kekState the kekState value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekState(String kekState) { + this.kekState = kekState; + return this; + } + + /** + * Get the kekCertThumbprint property: The key encryption key certificate thumbprint. + * + * @return the kekCertThumbprint value. + */ + public String kekCertThumbprint() { + return this.kekCertThumbprint; + } + + /** + * Set the kekCertThumbprint property: The key encryption key certificate thumbprint. + * + * @param kekCertThumbprint the kekCertThumbprint value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekCertThumbprint(String kekCertThumbprint) { + this.kekCertThumbprint = kekCertThumbprint; + return this; + } + + /** + * Get the kekCertExpiryDate property: The key encryption key certificate expiry date. + * + * @return the kekCertExpiryDate value. + */ + public OffsetDateTime kekCertExpiryDate() { + return this.kekCertExpiryDate; + } + + /** + * Set the kekCertExpiryDate property: The key encryption key certificate expiry date. + * + * @param kekCertExpiryDate the kekCertExpiryDate value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekCertExpiryDate(OffsetDateTime kekCertExpiryDate) { + this.kekCertExpiryDate = kekCertExpiryDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EthernetAddressType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EthernetAddressType.java new file mode 100644 index 000000000000..d6cb60feb199 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EthernetAddressType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The source IP address type. */ +public final class EthernetAddressType extends ExpandableStringEnum { + /** Static value Dynamic for EthernetAddressType. */ + public static final EthernetAddressType DYNAMIC = fromString("Dynamic"); + + /** Static value Static for EthernetAddressType. */ + public static final EthernetAddressType STATIC = fromString("Static"); + + /** + * Creates or finds a EthernetAddressType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EthernetAddressType. + */ + @JsonCreator + public static EthernetAddressType fromString(String name) { + return fromString(name, EthernetAddressType.class); + } + + /** + * Gets known EthernetAddressType values. + * + * @return known EthernetAddressType values. + */ + public static Collection values() { + return values(EthernetAddressType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Event.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Event.java new file mode 100644 index 000000000000..d4b0f0e86cc2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Event.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.EventInner; + +/** An immutable client-side representation of Event. */ +public interface Event { + /** + * 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: Event related data. + * + * @return the properties value. + */ + EventProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.EventInner object. + * + * @return the inner object. + */ + EventInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventCollection.java new file mode 100644 index 000000000000..85b122d442c5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.EventInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of fabric details. */ +@Fluent +public final class EventCollection { + /* + * The list of events. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of EventCollection class. */ + public EventCollection() { + } + + /** + * Get the value property: The list of events. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of events. + * + * @param value the value value to set. + * @return the EventCollection object itself. + */ + public EventCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the EventCollection object itself. + */ + public EventCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProperties.java new file mode 100644 index 000000000000..8be906f93135 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProperties.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a monitoring event. */ +@Fluent +public final class EventProperties { + /* + * The Id of the monitoring event. + */ + @JsonProperty(value = "eventCode") + private String eventCode; + + /* + * The event name. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The type of the event. for example: VM Health, Server Health, Job Failure etc. + */ + @JsonProperty(value = "eventType") + private String eventType; + + /* + * The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). + */ + @JsonProperty(value = "affectedObjectFriendlyName") + private String affectedObjectFriendlyName; + + /* + * The affected object correlationId for the event. + */ + @JsonProperty(value = "affectedObjectCorrelationId") + private String affectedObjectCorrelationId; + + /* + * The severity of the event. + */ + @JsonProperty(value = "severity") + private String severity; + + /* + * The time of occurrence of the event. + */ + @JsonProperty(value = "timeOfOccurrence") + private OffsetDateTime timeOfOccurrence; + + /* + * The ARM ID of the fabric. + */ + @JsonProperty(value = "fabricId") + private String fabricId; + + /* + * The provider specific settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private EventProviderSpecificDetails providerSpecificDetails; + + /* + * The event specific settings. + */ + @JsonProperty(value = "eventSpecificDetails") + private EventSpecificDetails eventSpecificDetails; + + /* + * The list of errors / warnings capturing details associated with the issue(s). + */ + @JsonProperty(value = "healthErrors") + private List healthErrors; + + /** Creates an instance of EventProperties class. */ + public EventProperties() { + } + + /** + * Get the eventCode property: The Id of the monitoring event. + * + * @return the eventCode value. + */ + public String eventCode() { + return this.eventCode; + } + + /** + * Set the eventCode property: The Id of the monitoring event. + * + * @param eventCode the eventCode value to set. + * @return the EventProperties object itself. + */ + public EventProperties withEventCode(String eventCode) { + this.eventCode = eventCode; + return this; + } + + /** + * Get the description property: The event name. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The event name. + * + * @param description the description value to set. + * @return the EventProperties object itself. + */ + public EventProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the eventType property: The type of the event. for example: VM Health, Server Health, Job Failure etc. + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Set the eventType property: The type of the event. for example: VM Health, Server Health, Job Failure etc. + * + * @param eventType the eventType value to set. + * @return the EventProperties object itself. + */ + public EventProperties withEventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the affectedObjectFriendlyName property: The friendly name of the source of the event on which it is raised + * (for example, VM, VMM etc). + * + * @return the affectedObjectFriendlyName value. + */ + public String affectedObjectFriendlyName() { + return this.affectedObjectFriendlyName; + } + + /** + * Set the affectedObjectFriendlyName property: The friendly name of the source of the event on which it is raised + * (for example, VM, VMM etc). + * + * @param affectedObjectFriendlyName the affectedObjectFriendlyName value to set. + * @return the EventProperties object itself. + */ + public EventProperties withAffectedObjectFriendlyName(String affectedObjectFriendlyName) { + this.affectedObjectFriendlyName = affectedObjectFriendlyName; + return this; + } + + /** + * Get the affectedObjectCorrelationId property: The affected object correlationId for the event. + * + * @return the affectedObjectCorrelationId value. + */ + public String affectedObjectCorrelationId() { + return this.affectedObjectCorrelationId; + } + + /** + * Set the affectedObjectCorrelationId property: The affected object correlationId for the event. + * + * @param affectedObjectCorrelationId the affectedObjectCorrelationId value to set. + * @return the EventProperties object itself. + */ + public EventProperties withAffectedObjectCorrelationId(String affectedObjectCorrelationId) { + this.affectedObjectCorrelationId = affectedObjectCorrelationId; + return this; + } + + /** + * Get the severity property: The severity of the event. + * + * @return the severity value. + */ + public String severity() { + return this.severity; + } + + /** + * Set the severity property: The severity of the event. + * + * @param severity the severity value to set. + * @return the EventProperties object itself. + */ + public EventProperties withSeverity(String severity) { + this.severity = severity; + return this; + } + + /** + * Get the timeOfOccurrence property: The time of occurrence of the event. + * + * @return the timeOfOccurrence value. + */ + public OffsetDateTime timeOfOccurrence() { + return this.timeOfOccurrence; + } + + /** + * Set the timeOfOccurrence property: The time of occurrence of the event. + * + * @param timeOfOccurrence the timeOfOccurrence value to set. + * @return the EventProperties object itself. + */ + public EventProperties withTimeOfOccurrence(OffsetDateTime timeOfOccurrence) { + this.timeOfOccurrence = timeOfOccurrence; + return this; + } + + /** + * Get the fabricId property: The ARM ID of the fabric. + * + * @return the fabricId value. + */ + public String fabricId() { + return this.fabricId; + } + + /** + * Set the fabricId property: The ARM ID of the fabric. + * + * @param fabricId the fabricId value to set. + * @return the EventProperties object itself. + */ + public EventProperties withFabricId(String fabricId) { + this.fabricId = fabricId; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider specific settings. + * + * @return the providerSpecificDetails value. + */ + public EventProviderSpecificDetails providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific settings. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the EventProperties object itself. + */ + public EventProperties withProviderSpecificDetails(EventProviderSpecificDetails providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Get the eventSpecificDetails property: The event specific settings. + * + * @return the eventSpecificDetails value. + */ + public EventSpecificDetails eventSpecificDetails() { + return this.eventSpecificDetails; + } + + /** + * Set the eventSpecificDetails property: The event specific settings. + * + * @param eventSpecificDetails the eventSpecificDetails value to set. + * @return the EventProperties object itself. + */ + public EventProperties withEventSpecificDetails(EventSpecificDetails eventSpecificDetails) { + this.eventSpecificDetails = eventSpecificDetails; + return this; + } + + /** + * Get the healthErrors property: The list of errors / warnings capturing details associated with the issue(s). + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Set the healthErrors property: The list of errors / warnings capturing details associated with the issue(s). + * + * @param healthErrors the healthErrors value to set. + * @return the EventProperties object itself. + */ + public EventProperties withHealthErrors(List healthErrors) { + this.healthErrors = healthErrors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + if (eventSpecificDetails() != null) { + eventSpecificDetails().validate(); + } + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProviderSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProviderSpecificDetails.java new file mode 100644 index 000000000000..ad8da6acbac2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProviderSpecificDetails.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.recoveryservicessiterecovery.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; + +/** Model class for provider specific details for an event. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = EventProviderSpecificDetails.class) +@JsonTypeName("EventProviderSpecificDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AEventDetails.class), + @JsonSubTypes.Type(name = "HyperVReplica2012", value = HyperVReplica2012EventDetails.class), + @JsonSubTypes.Type(name = "HyperVReplica2012R2", value = HyperVReplica2012R2EventDetails.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzureEventDetails.class), + @JsonSubTypes.Type(name = "HyperVReplicaBaseEventDetails", value = HyperVReplicaBaseEventDetails.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2EventDetails.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmEventDetails.class), + @JsonSubTypes.Type(name = "InMageRcmFailback", value = InMageRcmFailbackEventDetails.class), + @JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtEventDetails.class) +}) +@Immutable +public class EventProviderSpecificDetails { + /** Creates an instance of EventProviderSpecificDetails class. */ + public EventProviderSpecificDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventSpecificDetails.java new file mode 100644 index 000000000000..75b5818b57ad --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventSpecificDetails.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.recoveryservicessiterecovery.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; + +/** Model class for event specific details for an event. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = EventSpecificDetails.class) +@JsonTypeName("EventSpecificDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "JobStatus", value = JobStatusEventDetails.class)}) +@Immutable +public class EventSpecificDetails { + /** Creates an instance of EventSpecificDetails class. */ + public EventSpecificDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingProtectionProfile.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingProtectionProfile.java new file mode 100644 index 000000000000..ed8cb735a9b1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingProtectionProfile.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.recoveryservicessiterecovery.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; + +/** Existing storage account input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Existing") +@Fluent +public final class ExistingProtectionProfile extends ProtectionProfileCustomDetails { + /* + * The protection profile Arm Id. Throw error, if resource does not exists. + */ + @JsonProperty(value = "protectionProfileId", required = true) + private String protectionProfileId; + + /** Creates an instance of ExistingProtectionProfile class. */ + public ExistingProtectionProfile() { + } + + /** + * Get the protectionProfileId property: The protection profile Arm Id. Throw error, if resource does not exists. + * + * @return the protectionProfileId value. + */ + public String protectionProfileId() { + return this.protectionProfileId; + } + + /** + * Set the protectionProfileId property: The protection profile Arm Id. Throw error, if resource does not exists. + * + * @param protectionProfileId the protectionProfileId value to set. + * @return the ExistingProtectionProfile object itself. + */ + public ExistingProtectionProfile withProtectionProfileId(String protectionProfileId) { + this.protectionProfileId = protectionProfileId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protectionProfileId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protectionProfileId in model ExistingProtectionProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExistingProtectionProfile.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryAvailabilitySet.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryAvailabilitySet.java new file mode 100644 index 000000000000..8a70d77b02ed --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryAvailabilitySet.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.recoveryservicessiterecovery.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; + +/** Existing recovery availability set input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Existing") +@Fluent +public final class ExistingRecoveryAvailabilitySet extends RecoveryAvailabilitySetCustomDetails { + /* + * The recovery availability set Id. Will throw error, if resource does not exist. + */ + @JsonProperty(value = "recoveryAvailabilitySetId") + private String recoveryAvailabilitySetId; + + /** Creates an instance of ExistingRecoveryAvailabilitySet class. */ + public ExistingRecoveryAvailabilitySet() { + } + + /** + * Get the recoveryAvailabilitySetId property: The recovery availability set Id. Will throw error, if resource does + * not exist. + * + * @return the recoveryAvailabilitySetId value. + */ + public String recoveryAvailabilitySetId() { + return this.recoveryAvailabilitySetId; + } + + /** + * Set the recoveryAvailabilitySetId property: The recovery availability set Id. Will throw error, if resource does + * not exist. + * + * @param recoveryAvailabilitySetId the recoveryAvailabilitySetId value to set. + * @return the ExistingRecoveryAvailabilitySet object itself. + */ + public ExistingRecoveryAvailabilitySet withRecoveryAvailabilitySetId(String recoveryAvailabilitySetId) { + this.recoveryAvailabilitySetId = recoveryAvailabilitySetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryProximityPlacementGroup.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryProximityPlacementGroup.java new file mode 100644 index 000000000000..91a49065f7ac --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryProximityPlacementGroup.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.recoveryservicessiterecovery.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; + +/** Existing recovery proximity placement group input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Existing") +@Fluent +public final class ExistingRecoveryProximityPlacementGroup extends RecoveryProximityPlacementGroupCustomDetails { + /* + * The recovery proximity placement group Id. Will throw error, if resource does not exist. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /** Creates an instance of ExistingRecoveryProximityPlacementGroup class. */ + public ExistingRecoveryProximityPlacementGroup() { + } + + /** + * Get the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. Will throw error, + * if resource does not exist. + * + * @return the recoveryProximityPlacementGroupId value. + */ + public String recoveryProximityPlacementGroupId() { + return this.recoveryProximityPlacementGroupId; + } + + /** + * Set the recoveryProximityPlacementGroupId property: The recovery proximity placement group Id. Will throw error, + * if resource does not exist. + * + * @param recoveryProximityPlacementGroupId the recoveryProximityPlacementGroupId value to set. + * @return the ExistingRecoveryProximityPlacementGroup object itself. + */ + public ExistingRecoveryProximityPlacementGroup withRecoveryProximityPlacementGroupId( + String recoveryProximityPlacementGroupId) { + this.recoveryProximityPlacementGroupId = recoveryProximityPlacementGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryResourceGroup.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryResourceGroup.java new file mode 100644 index 000000000000..bb7582fe55d3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryResourceGroup.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.recoveryservicessiterecovery.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; + +/** Existing recovery resource group input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Existing") +@Fluent +public final class ExistingRecoveryResourceGroup extends RecoveryResourceGroupCustomDetails { + /* + * The recovery resource group Id. Valid for V2 scenarios. + */ + @JsonProperty(value = "recoveryResourceGroupId") + private String recoveryResourceGroupId; + + /** Creates an instance of ExistingRecoveryResourceGroup class. */ + public ExistingRecoveryResourceGroup() { + } + + /** + * Get the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @return the recoveryResourceGroupId value. + */ + public String recoveryResourceGroupId() { + return this.recoveryResourceGroupId; + } + + /** + * Set the recoveryResourceGroupId property: The recovery resource group Id. Valid for V2 scenarios. + * + * @param recoveryResourceGroupId the recoveryResourceGroupId value to set. + * @return the ExistingRecoveryResourceGroup object itself. + */ + public ExistingRecoveryResourceGroup withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryVirtualNetwork.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryVirtualNetwork.java new file mode 100644 index 000000000000..61b84d7fb584 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryVirtualNetwork.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Existing recovery virtual network input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Existing") +@Fluent +public final class ExistingRecoveryVirtualNetwork extends RecoveryVirtualNetworkCustomDetails { + /* + * The recovery virtual network Id. Will throw error, if resource does not exist. + */ + @JsonProperty(value = "recoveryVirtualNetworkId", required = true) + private String recoveryVirtualNetworkId; + + /* + * The recovery subnet name. + */ + @JsonProperty(value = "recoverySubnetName") + private String recoverySubnetName; + + /** Creates an instance of ExistingRecoveryVirtualNetwork class. */ + public ExistingRecoveryVirtualNetwork() { + } + + /** + * Get the recoveryVirtualNetworkId property: The recovery virtual network Id. Will throw error, if resource does + * not exist. + * + * @return the recoveryVirtualNetworkId value. + */ + public String recoveryVirtualNetworkId() { + return this.recoveryVirtualNetworkId; + } + + /** + * Set the recoveryVirtualNetworkId property: The recovery virtual network Id. Will throw error, if resource does + * not exist. + * + * @param recoveryVirtualNetworkId the recoveryVirtualNetworkId value to set. + * @return the ExistingRecoveryVirtualNetwork object itself. + */ + public ExistingRecoveryVirtualNetwork withRecoveryVirtualNetworkId(String recoveryVirtualNetworkId) { + this.recoveryVirtualNetworkId = recoveryVirtualNetworkId; + return this; + } + + /** + * Get the recoverySubnetName property: The recovery subnet name. + * + * @return the recoverySubnetName value. + */ + public String recoverySubnetName() { + return this.recoverySubnetName; + } + + /** + * Set the recoverySubnetName property: The recovery subnet name. + * + * @param recoverySubnetName the recoverySubnetName value to set. + * @return the ExistingRecoveryVirtualNetwork object itself. + */ + public ExistingRecoveryVirtualNetwork withRecoverySubnetName(String recoverySubnetName) { + this.recoverySubnetName = recoverySubnetName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryVirtualNetworkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryVirtualNetworkId in model ExistingRecoveryVirtualNetwork")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExistingRecoveryVirtualNetwork.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingStorageAccount.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingStorageAccount.java new file mode 100644 index 000000000000..544157a3a0a9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingStorageAccount.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.recoveryservicessiterecovery.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; + +/** Existing storage account input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Existing") +@Fluent +public final class ExistingStorageAccount extends StorageAccountCustomDetails { + /* + * The storage account Arm Id. Throw error, if resource does not exists. + */ + @JsonProperty(value = "azureStorageAccountId", required = true) + private String azureStorageAccountId; + + /** Creates an instance of ExistingStorageAccount class. */ + public ExistingStorageAccount() { + } + + /** + * Get the azureStorageAccountId property: The storage account Arm Id. Throw error, if resource does not exists. + * + * @return the azureStorageAccountId value. + */ + public String azureStorageAccountId() { + return this.azureStorageAccountId; + } + + /** + * Set the azureStorageAccountId property: The storage account Arm Id. Throw error, if resource does not exists. + * + * @param azureStorageAccountId the azureStorageAccountId value to set. + * @return the ExistingStorageAccount object itself. + */ + public ExistingStorageAccount withAzureStorageAccountId(String azureStorageAccountId) { + this.azureStorageAccountId = azureStorageAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (azureStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azureStorageAccountId in model ExistingStorageAccount")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExistingStorageAccount.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExportJobDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExportJobDetails.java new file mode 100644 index 000000000000..b6350a2fa68b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExportJobDetails.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.recoveryservicessiterecovery.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; +import java.util.Map; + +/** This class represents details for export jobs workflow. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("ExportJobDetails") +@Fluent +public final class ExportJobDetails extends JobDetails { + /* + * BlobUri of the exported jobs. + */ + @JsonProperty(value = "blobUri") + private String blobUri; + + /* + * The sas token to access blob. + */ + @JsonProperty(value = "sasToken") + private String sasToken; + + /** Creates an instance of ExportJobDetails class. */ + public ExportJobDetails() { + } + + /** + * Get the blobUri property: BlobUri of the exported jobs. + * + * @return the blobUri value. + */ + public String blobUri() { + return this.blobUri; + } + + /** + * Set the blobUri property: BlobUri of the exported jobs. + * + * @param blobUri the blobUri value to set. + * @return the ExportJobDetails object itself. + */ + public ExportJobDetails withBlobUri(String blobUri) { + this.blobUri = blobUri; + return this; + } + + /** + * Get the sasToken property: The sas token to access blob. + * + * @return the sasToken value. + */ + public String sasToken() { + return this.sasToken; + } + + /** + * Set the sasToken property: The sas token to access blob. + * + * @param sasToken the sasToken value to set. + * @return the ExportJobDetails object itself. + */ + public ExportJobDetails withSasToken(String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExportJobDetails withAffectedObjectDetails(Map affectedObjectDetails) { + super.withAffectedObjectDetails(affectedObjectDetails); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExportJobOutputSerializationType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExportJobOutputSerializationType.java new file mode 100644 index 000000000000..3227a890eec9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExportJobOutputSerializationType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The output type of the jobs. */ +public final class ExportJobOutputSerializationType extends ExpandableStringEnum { + /** Static value Json for ExportJobOutputSerializationType. */ + public static final ExportJobOutputSerializationType JSON = fromString("Json"); + + /** Static value Xml for ExportJobOutputSerializationType. */ + public static final ExportJobOutputSerializationType XML = fromString("Xml"); + + /** Static value Excel for ExportJobOutputSerializationType. */ + public static final ExportJobOutputSerializationType EXCEL = fromString("Excel"); + + /** + * Creates or finds a ExportJobOutputSerializationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportJobOutputSerializationType. + */ + @JsonCreator + public static ExportJobOutputSerializationType fromString(String name) { + return fromString(name, ExportJobOutputSerializationType.class); + } + + /** + * Gets known ExportJobOutputSerializationType values. + * + * @return known ExportJobOutputSerializationType values. + */ + public static Collection values() { + return values(ExportJobOutputSerializationType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExtendedLocation.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExtendedLocation.java new file mode 100644 index 000000000000..ec20b3c95c92 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExtendedLocation.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extended location of the resource. */ +@Fluent +public final class ExtendedLocation { + /* + * The name of the extended location. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The extended location type. + */ + @JsonProperty(value = "type", required = true) + private ExtendedLocationType type; + + /** Creates an instance of ExtendedLocation class. */ + public ExtendedLocation() { + } + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The extended location type. + * + * @return the type value. + */ + public ExtendedLocationType type() { + return this.type; + } + + /** + * Set the type property: The extended location type. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationType type) { + this.type = type; + 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 ExtendedLocation")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ExtendedLocation")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExtendedLocation.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExtendedLocationType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExtendedLocationType.java new file mode 100644 index 000000000000..c4392a529c02 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExtendedLocationType.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The extended location type. */ +public final class ExtendedLocationType extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationType. */ + public static final ExtendedLocationType EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates or finds a ExtendedLocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationType. + */ + @JsonCreator + public static ExtendedLocationType fromString(String name) { + return fromString(name, ExtendedLocationType.class); + } + + /** + * Gets known ExtendedLocationType values. + * + * @return known ExtendedLocationType values. + */ + public static Collection values() { + return values(ExtendedLocationType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Fabric.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Fabric.java new file mode 100644 index 000000000000..0be5f3520da0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Fabric.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.FabricInner; + +/** An immutable client-side representation of Fabric. */ +public interface Fabric { + /** + * 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: Fabric related data. + * + * @return the properties value. + */ + FabricProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.FabricInner object. + * + * @return the inner object. + */ + FabricInner innerModel(); + + /** The entirety of the Fabric definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Fabric definition stages. */ + interface DefinitionStages { + /** The first stage of the Fabric definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Fabric definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @return the next definition stage. + */ + WithCreate withExistingVault(String resourceName, String resourceGroupName); + } + /** + * The stage of the Fabric 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Fabric create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Fabric create(Context context); + } + /** The stage of the Fabric definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Fabric creation input.. + * + * @param properties Fabric creation input. + * @return the next definition stage. + */ + WithCreate withProperties(FabricCreationInputProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Fabric refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Fabric refresh(Context context); + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @throws com.azure.core.management.exception.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 definition. + */ + Fabric checkConsistency(); + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @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 definition. + */ + Fabric checkConsistency(Context context); + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @throws com.azure.core.management.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 migrateToAad(); + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @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 migrateToAad(Context context); + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param failoverProcessServerRequest The input to the failover process server 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 definition. + */ + Fabric reassociateGateway(FailoverProcessServerRequest failoverProcessServerRequest); + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param failoverProcessServerRequest The input to the failover process server 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 fabric definition. + */ + Fabric reassociateGateway(FailoverProcessServerRequest failoverProcessServerRequest, Context context); + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @throws com.azure.core.management.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(); + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @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(Context context); + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param renewCertificate Renew certificate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 definition. + */ + Fabric renewCertificate(RenewCertificateInput renewCertificate); + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param renewCertificate Renew certificate input. + * @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 definition. + */ + Fabric renewCertificate(RenewCertificateInput renewCertificate, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCollection.java new file mode 100644 index 000000000000..39fe310d7794 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.FabricInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of fabric details. */ +@Fluent +public final class FabricCollection { + /* + * The fabric details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of FabricCollection class. */ + public FabricCollection() { + } + + /** + * Get the value property: The fabric details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The fabric details. + * + * @param value the value value to set. + * @return the FabricCollection object itself. + */ + public FabricCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the FabricCollection object itself. + */ + public FabricCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCreationInput.java new file mode 100644 index 000000000000..6b0be966f9a7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCreationInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Site details provided during the time of site creation. */ +@Fluent +public final class FabricCreationInput { + /* + * Fabric creation input. + */ + @JsonProperty(value = "properties") + private FabricCreationInputProperties properties; + + /** Creates an instance of FabricCreationInput class. */ + public FabricCreationInput() { + } + + /** + * Get the properties property: Fabric creation input. + * + * @return the properties value. + */ + public FabricCreationInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Fabric creation input. + * + * @param properties the properties value to set. + * @return the FabricCreationInput object itself. + */ + public FabricCreationInput withProperties(FabricCreationInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCreationInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCreationInputProperties.java new file mode 100644 index 000000000000..102edf1b3e0e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricCreationInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of site details provided during the time of site creation. */ +@Fluent +public final class FabricCreationInputProperties { + /* + * Fabric provider specific creation input. + */ + @JsonProperty(value = "customDetails") + private FabricSpecificCreationInput customDetails; + + /** Creates an instance of FabricCreationInputProperties class. */ + public FabricCreationInputProperties() { + } + + /** + * Get the customDetails property: Fabric provider specific creation input. + * + * @return the customDetails value. + */ + public FabricSpecificCreationInput customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: Fabric provider specific creation input. + * + * @param customDetails the customDetails value to set. + * @return the FabricCreationInputProperties object itself. + */ + public FabricCreationInputProperties withCustomDetails(FabricSpecificCreationInput customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customDetails() != null) { + customDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricProperties.java new file mode 100644 index 000000000000..75e2cabd798f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricProperties.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Fabric properties. */ +@Fluent +public final class FabricProperties { + /* + * Friendly name of the fabric. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Encryption details for the fabric. + */ + @JsonProperty(value = "encryptionDetails") + private EncryptionDetails encryptionDetails; + + /* + * Rollover encryption details for the fabric. + */ + @JsonProperty(value = "rolloverEncryptionDetails") + private EncryptionDetails rolloverEncryptionDetails; + + /* + * Dra Registration Id. + */ + @JsonProperty(value = "internalIdentifier") + private String internalIdentifier; + + /* + * BCDR state of the fabric. + */ + @JsonProperty(value = "bcdrState") + private String bcdrState; + + /* + * Fabric specific settings. + */ + @JsonProperty(value = "customDetails") + private FabricSpecificDetails customDetails; + + /* + * Fabric health error details. + */ + @JsonProperty(value = "healthErrorDetails") + private List healthErrorDetails; + + /* + * Health of fabric. + */ + @JsonProperty(value = "health") + private String health; + + /** Creates an instance of FabricProperties class. */ + public FabricProperties() { + } + + /** + * Get the friendlyName property: Friendly name of the fabric. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the fabric. + * + * @param friendlyName the friendlyName value to set. + * @return the FabricProperties object itself. + */ + public FabricProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the encryptionDetails property: Encryption details for the fabric. + * + * @return the encryptionDetails value. + */ + public EncryptionDetails encryptionDetails() { + return this.encryptionDetails; + } + + /** + * Set the encryptionDetails property: Encryption details for the fabric. + * + * @param encryptionDetails the encryptionDetails value to set. + * @return the FabricProperties object itself. + */ + public FabricProperties withEncryptionDetails(EncryptionDetails encryptionDetails) { + this.encryptionDetails = encryptionDetails; + return this; + } + + /** + * Get the rolloverEncryptionDetails property: Rollover encryption details for the fabric. + * + * @return the rolloverEncryptionDetails value. + */ + public EncryptionDetails rolloverEncryptionDetails() { + return this.rolloverEncryptionDetails; + } + + /** + * Set the rolloverEncryptionDetails property: Rollover encryption details for the fabric. + * + * @param rolloverEncryptionDetails the rolloverEncryptionDetails value to set. + * @return the FabricProperties object itself. + */ + public FabricProperties withRolloverEncryptionDetails(EncryptionDetails rolloverEncryptionDetails) { + this.rolloverEncryptionDetails = rolloverEncryptionDetails; + return this; + } + + /** + * Get the internalIdentifier property: Dra Registration Id. + * + * @return the internalIdentifier value. + */ + public String internalIdentifier() { + return this.internalIdentifier; + } + + /** + * Set the internalIdentifier property: Dra Registration Id. + * + * @param internalIdentifier the internalIdentifier value to set. + * @return the FabricProperties object itself. + */ + public FabricProperties withInternalIdentifier(String internalIdentifier) { + this.internalIdentifier = internalIdentifier; + return this; + } + + /** + * Get the bcdrState property: BCDR state of the fabric. + * + * @return the bcdrState value. + */ + public String bcdrState() { + return this.bcdrState; + } + + /** + * Set the bcdrState property: BCDR state of the fabric. + * + * @param bcdrState the bcdrState value to set. + * @return the FabricProperties object itself. + */ + public FabricProperties withBcdrState(String bcdrState) { + this.bcdrState = bcdrState; + return this; + } + + /** + * Get the customDetails property: Fabric specific settings. + * + * @return the customDetails value. + */ + public FabricSpecificDetails customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: Fabric specific settings. + * + * @param customDetails the customDetails value to set. + * @return the FabricProperties object itself. + */ + public FabricProperties withCustomDetails(FabricSpecificDetails customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Get the healthErrorDetails property: Fabric health error details. + * + * @return the healthErrorDetails value. + */ + public List healthErrorDetails() { + return this.healthErrorDetails; + } + + /** + * Set the healthErrorDetails property: Fabric health error details. + * + * @param healthErrorDetails the healthErrorDetails value to set. + * @return the FabricProperties object itself. + */ + public FabricProperties withHealthErrorDetails(List healthErrorDetails) { + this.healthErrorDetails = healthErrorDetails; + return this; + } + + /** + * Get the health property: Health of fabric. + * + * @return the health value. + */ + public String health() { + return this.health; + } + + /** + * Set the health property: Health of fabric. + * + * @param health the health value to set. + * @return the FabricProperties object itself. + */ + public FabricProperties withHealth(String health) { + this.health = health; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionDetails() != null) { + encryptionDetails().validate(); + } + if (rolloverEncryptionDetails() != null) { + rolloverEncryptionDetails().validate(); + } + if (customDetails() != null) { + customDetails().validate(); + } + if (healthErrorDetails() != null) { + healthErrorDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricReplicationGroupTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricReplicationGroupTaskDetails.java new file mode 100644 index 000000000000..4ee166dc6b85 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricReplicationGroupTaskDetails.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.recoveryservicessiterecovery.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; + +/** This class represents the fabric replication group task details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("FabricReplicationGroupTaskDetails") +@Fluent +public final class FabricReplicationGroupTaskDetails extends JobTaskDetails { + /* + * The skipped reason. + */ + @JsonProperty(value = "skippedReason") + private String skippedReason; + + /* + * The skipped reason string. + */ + @JsonProperty(value = "skippedReasonString") + private String skippedReasonString; + + /** Creates an instance of FabricReplicationGroupTaskDetails class. */ + public FabricReplicationGroupTaskDetails() { + } + + /** + * Get the skippedReason property: The skipped reason. + * + * @return the skippedReason value. + */ + public String skippedReason() { + return this.skippedReason; + } + + /** + * Set the skippedReason property: The skipped reason. + * + * @param skippedReason the skippedReason value to set. + * @return the FabricReplicationGroupTaskDetails object itself. + */ + public FabricReplicationGroupTaskDetails withSkippedReason(String skippedReason) { + this.skippedReason = skippedReason; + return this; + } + + /** + * Get the skippedReasonString property: The skipped reason string. + * + * @return the skippedReasonString value. + */ + public String skippedReasonString() { + return this.skippedReasonString; + } + + /** + * Set the skippedReasonString property: The skipped reason string. + * + * @param skippedReasonString the skippedReasonString value to set. + * @return the FabricReplicationGroupTaskDetails object itself. + */ + public FabricReplicationGroupTaskDetails withSkippedReasonString(String skippedReasonString) { + this.skippedReasonString = skippedReasonString; + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricReplicationGroupTaskDetails withJobTask(JobEntity jobTask) { + super.withJobTask(jobTask); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificCreateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificCreateNetworkMappingInput.java new file mode 100644 index 000000000000..3f2e7c38983f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificCreateNetworkMappingInput.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.recoveryservicessiterecovery.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; + +/** Input details specific to fabrics during Network Mapping. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = FabricSpecificCreateNetworkMappingInput.class) +@JsonTypeName("FabricSpecificCreateNetworkMappingInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureToAzure", value = AzureToAzureCreateNetworkMappingInput.class), + @JsonSubTypes.Type(name = "VmmToAzure", value = VmmToAzureCreateNetworkMappingInput.class), + @JsonSubTypes.Type(name = "VmmToVmm", value = VmmToVmmCreateNetworkMappingInput.class) +}) +@Immutable +public class FabricSpecificCreateNetworkMappingInput { + /** Creates an instance of FabricSpecificCreateNetworkMappingInput class. */ + public FabricSpecificCreateNetworkMappingInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificCreationInput.java new file mode 100644 index 000000000000..b4f6c6477e3e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificCreationInput.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.recoveryservicessiterecovery.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 provider specific settings. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = FabricSpecificCreationInput.class) +@JsonTypeName("FabricSpecificCreationInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Azure", value = AzureFabricCreationInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmFabricCreationInput.class), + @JsonSubTypes.Type(name = "VMwareV2", value = VMwareV2FabricCreationInput.class) +}) +@Immutable +public class FabricSpecificCreationInput { + /** Creates an instance of FabricSpecificCreationInput class. */ + public FabricSpecificCreationInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificDetails.java new file mode 100644 index 000000000000..98dffa2cae73 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificDetails.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.recoveryservicessiterecovery.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 specific details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = FabricSpecificDetails.class) +@JsonTypeName("FabricSpecificDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Azure", value = AzureFabricSpecificDetails.class), + @JsonSubTypes.Type(name = "HyperVSite", value = HyperVSiteDetails.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmFabricSpecificDetails.class), + @JsonSubTypes.Type(name = "VMM", value = VmmDetails.class), + @JsonSubTypes.Type(name = "VMware", value = VMwareDetails.class), + @JsonSubTypes.Type(name = "VMwareV2", value = VMwareV2FabricSpecificDetails.class) +}) +@Immutable +public class FabricSpecificDetails { + /** Creates an instance of FabricSpecificDetails class. */ + public FabricSpecificDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificUpdateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificUpdateNetworkMappingInput.java new file mode 100644 index 000000000000..3c09b429cfd9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificUpdateNetworkMappingInput.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.recoveryservicessiterecovery.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; + +/** Input details specific to fabrics during Network Mapping. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = FabricSpecificUpdateNetworkMappingInput.class) +@JsonTypeName("FabricSpecificUpdateNetworkMappingInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureToAzure", value = AzureToAzureUpdateNetworkMappingInput.class), + @JsonSubTypes.Type(name = "VmmToAzure", value = VmmToAzureUpdateNetworkMappingInput.class), + @JsonSubTypes.Type(name = "VmmToVmm", value = VmmToVmmUpdateNetworkMappingInput.class) +}) +@Immutable +public class FabricSpecificUpdateNetworkMappingInput { + /** Creates an instance of FabricSpecificUpdateNetworkMappingInput class. */ + public FabricSpecificUpdateNetworkMappingInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverDeploymentModel.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverDeploymentModel.java new file mode 100644 index 000000000000..ceb84c444d9b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverDeploymentModel.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The failover deployment model. */ +public final class FailoverDeploymentModel extends ExpandableStringEnum { + /** Static value NotApplicable for FailoverDeploymentModel. */ + public static final FailoverDeploymentModel NOT_APPLICABLE = fromString("NotApplicable"); + + /** Static value Classic for FailoverDeploymentModel. */ + public static final FailoverDeploymentModel CLASSIC = fromString("Classic"); + + /** Static value ResourceManager for FailoverDeploymentModel. */ + public static final FailoverDeploymentModel RESOURCE_MANAGER = fromString("ResourceManager"); + + /** + * Creates or finds a FailoverDeploymentModel from its string representation. + * + * @param name a name to look for. + * @return the corresponding FailoverDeploymentModel. + */ + @JsonCreator + public static FailoverDeploymentModel fromString(String name) { + return fromString(name, FailoverDeploymentModel.class); + } + + /** + * Gets known FailoverDeploymentModel values. + * + * @return known FailoverDeploymentModel values. + */ + public static Collection values() { + return values(FailoverDeploymentModel.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverJobDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverJobDetails.java new file mode 100644 index 000000000000..c6918c1f9965 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverJobDetails.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.recoveryservicessiterecovery.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; +import java.util.List; +import java.util.Map; + +/** This class represents the details for a failover job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("FailoverJobDetails") +@Fluent +public final class FailoverJobDetails extends JobDetails { + /* + * The test VM details. + */ + @JsonProperty(value = "protectedItemDetails") + private List protectedItemDetails; + + /** Creates an instance of FailoverJobDetails class. */ + public FailoverJobDetails() { + } + + /** + * Get the protectedItemDetails property: The test VM details. + * + * @return the protectedItemDetails value. + */ + public List protectedItemDetails() { + return this.protectedItemDetails; + } + + /** + * Set the protectedItemDetails property: The test VM details. + * + * @param protectedItemDetails the protectedItemDetails value to set. + * @return the FailoverJobDetails object itself. + */ + public FailoverJobDetails withProtectedItemDetails( + List protectedItemDetails) { + this.protectedItemDetails = protectedItemDetails; + return this; + } + + /** {@inheritDoc} */ + @Override + public FailoverJobDetails withAffectedObjectDetails(Map affectedObjectDetails) { + super.withAffectedObjectDetails(affectedObjectDetails); + return this; + } + + /** + * 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverProcessServerRequest.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverProcessServerRequest.java new file mode 100644 index 000000000000..08ba8d1c6e3d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverProcessServerRequest.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to failover a process server. */ +@Fluent +public final class FailoverProcessServerRequest { + /* + * The properties of the PS Failover request. + */ + @JsonProperty(value = "properties") + private FailoverProcessServerRequestProperties properties; + + /** Creates an instance of FailoverProcessServerRequest class. */ + public FailoverProcessServerRequest() { + } + + /** + * Get the properties property: The properties of the PS Failover request. + * + * @return the properties value. + */ + public FailoverProcessServerRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the PS Failover request. + * + * @param properties the properties value to set. + * @return the FailoverProcessServerRequest object itself. + */ + public FailoverProcessServerRequest withProperties(FailoverProcessServerRequestProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverProcessServerRequestProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverProcessServerRequestProperties.java new file mode 100644 index 000000000000..ba1e711c04af --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverProcessServerRequestProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of the Failover Process Server request. */ +@Fluent +public final class FailoverProcessServerRequestProperties { + /* + * The container identifier. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * The source process server. + */ + @JsonProperty(value = "sourceProcessServerId") + private String sourceProcessServerId; + + /* + * The new process server. + */ + @JsonProperty(value = "targetProcessServerId") + private String targetProcessServerId; + + /* + * The VMS to migrate. + */ + @JsonProperty(value = "vmsToMigrate") + private List vmsToMigrate; + + /* + * A value for failover type. It can be systemlevel/serverlevel. + */ + @JsonProperty(value = "updateType") + private String updateType; + + /** Creates an instance of FailoverProcessServerRequestProperties class. */ + public FailoverProcessServerRequestProperties() { + } + + /** + * Get the containerName property: The container identifier. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The container identifier. + * + * @param containerName the containerName value to set. + * @return the FailoverProcessServerRequestProperties object itself. + */ + public FailoverProcessServerRequestProperties withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the sourceProcessServerId property: The source process server. + * + * @return the sourceProcessServerId value. + */ + public String sourceProcessServerId() { + return this.sourceProcessServerId; + } + + /** + * Set the sourceProcessServerId property: The source process server. + * + * @param sourceProcessServerId the sourceProcessServerId value to set. + * @return the FailoverProcessServerRequestProperties object itself. + */ + public FailoverProcessServerRequestProperties withSourceProcessServerId(String sourceProcessServerId) { + this.sourceProcessServerId = sourceProcessServerId; + return this; + } + + /** + * Get the targetProcessServerId property: The new process server. + * + * @return the targetProcessServerId value. + */ + public String targetProcessServerId() { + return this.targetProcessServerId; + } + + /** + * Set the targetProcessServerId property: The new process server. + * + * @param targetProcessServerId the targetProcessServerId value to set. + * @return the FailoverProcessServerRequestProperties object itself. + */ + public FailoverProcessServerRequestProperties withTargetProcessServerId(String targetProcessServerId) { + this.targetProcessServerId = targetProcessServerId; + return this; + } + + /** + * Get the vmsToMigrate property: The VMS to migrate. + * + * @return the vmsToMigrate value. + */ + public List vmsToMigrate() { + return this.vmsToMigrate; + } + + /** + * Set the vmsToMigrate property: The VMS to migrate. + * + * @param vmsToMigrate the vmsToMigrate value to set. + * @return the FailoverProcessServerRequestProperties object itself. + */ + public FailoverProcessServerRequestProperties withVmsToMigrate(List vmsToMigrate) { + this.vmsToMigrate = vmsToMigrate; + return this; + } + + /** + * Get the updateType property: A value for failover type. It can be systemlevel/serverlevel. + * + * @return the updateType value. + */ + public String updateType() { + return this.updateType; + } + + /** + * Set the updateType property: A value for failover type. It can be systemlevel/serverlevel. + * + * @param updateType the updateType value to set. + * @return the FailoverProcessServerRequestProperties object itself. + */ + public FailoverProcessServerRequestProperties withUpdateType(String updateType) { + this.updateType = updateType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverReplicationProtectedItemDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverReplicationProtectedItemDetails.java new file mode 100644 index 000000000000..dbbdc9a099af --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverReplicationProtectedItemDetails.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Failover details for a replication protected item. */ +@Fluent +public final class FailoverReplicationProtectedItemDetails { + /* + * The name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The test Vm name. + */ + @JsonProperty(value = "testVmName") + private String testVmName; + + /* + * The test Vm friendly name. + */ + @JsonProperty(value = "testVmFriendlyName") + private String testVmFriendlyName; + + /* + * The network connection status. + */ + @JsonProperty(value = "networkConnectionStatus") + private String networkConnectionStatus; + + /* + * The network friendly name. + */ + @JsonProperty(value = "networkFriendlyName") + private String networkFriendlyName; + + /* + * The network subnet. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /* + * The recovery point Id. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /* + * The recovery point time. + */ + @JsonProperty(value = "recoveryPointTime") + private OffsetDateTime recoveryPointTime; + + /** Creates an instance of FailoverReplicationProtectedItemDetails class. */ + public FailoverReplicationProtectedItemDetails() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name. + * + * @param name the name value to set. + * @return the FailoverReplicationProtectedItemDetails object itself. + */ + public FailoverReplicationProtectedItemDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the friendlyName property: The friendly name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name. + * + * @param friendlyName the friendlyName value to set. + * @return the FailoverReplicationProtectedItemDetails object itself. + */ + public FailoverReplicationProtectedItemDetails withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the testVmName property: The test Vm name. + * + * @return the testVmName value. + */ + public String testVmName() { + return this.testVmName; + } + + /** + * Set the testVmName property: The test Vm name. + * + * @param testVmName the testVmName value to set. + * @return the FailoverReplicationProtectedItemDetails object itself. + */ + public FailoverReplicationProtectedItemDetails withTestVmName(String testVmName) { + this.testVmName = testVmName; + return this; + } + + /** + * Get the testVmFriendlyName property: The test Vm friendly name. + * + * @return the testVmFriendlyName value. + */ + public String testVmFriendlyName() { + return this.testVmFriendlyName; + } + + /** + * Set the testVmFriendlyName property: The test Vm friendly name. + * + * @param testVmFriendlyName the testVmFriendlyName value to set. + * @return the FailoverReplicationProtectedItemDetails object itself. + */ + public FailoverReplicationProtectedItemDetails withTestVmFriendlyName(String testVmFriendlyName) { + this.testVmFriendlyName = testVmFriendlyName; + return this; + } + + /** + * Get the networkConnectionStatus property: The network connection status. + * + * @return the networkConnectionStatus value. + */ + public String networkConnectionStatus() { + return this.networkConnectionStatus; + } + + /** + * Set the networkConnectionStatus property: The network connection status. + * + * @param networkConnectionStatus the networkConnectionStatus value to set. + * @return the FailoverReplicationProtectedItemDetails object itself. + */ + public FailoverReplicationProtectedItemDetails withNetworkConnectionStatus(String networkConnectionStatus) { + this.networkConnectionStatus = networkConnectionStatus; + return this; + } + + /** + * Get the networkFriendlyName property: The network friendly name. + * + * @return the networkFriendlyName value. + */ + public String networkFriendlyName() { + return this.networkFriendlyName; + } + + /** + * Set the networkFriendlyName property: The network friendly name. + * + * @param networkFriendlyName the networkFriendlyName value to set. + * @return the FailoverReplicationProtectedItemDetails object itself. + */ + public FailoverReplicationProtectedItemDetails withNetworkFriendlyName(String networkFriendlyName) { + this.networkFriendlyName = networkFriendlyName; + return this; + } + + /** + * Get the subnet property: The network subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The network subnet. + * + * @param subnet the subnet value to set. + * @return the FailoverReplicationProtectedItemDetails object itself. + */ + public FailoverReplicationProtectedItemDetails withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the recoveryPointId property: The recovery point Id. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point Id. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the FailoverReplicationProtectedItemDetails object itself. + */ + public FailoverReplicationProtectedItemDetails withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the recoveryPointTime property: The recovery point time. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the recoveryPointTime property: The recovery point time. + * + * @param recoveryPointTime the recoveryPointTime value to set. + * @return the FailoverReplicationProtectedItemDetails object itself. + */ + public FailoverReplicationProtectedItemDetails withRecoveryPointTime(OffsetDateTime recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/GroupTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/GroupTaskDetails.java new file mode 100644 index 000000000000..36ea202a1eb4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/GroupTaskDetails.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +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.List; + +/** This class represents the group task details when parent child relationship exists in the drill down. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = GroupTaskDetails.class) +@JsonTypeName("GroupTaskDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "InlineWorkflowTaskDetails", value = InlineWorkflowTaskDetails.class), + @JsonSubTypes.Type(name = "RecoveryPlanGroupTaskDetails", value = RecoveryPlanGroupTaskDetails.class) +}) +@Fluent +public class GroupTaskDetails { + /* + * The child tasks. + */ + @JsonProperty(value = "childTasks") + private List childTasks; + + /** Creates an instance of GroupTaskDetails class. */ + public GroupTaskDetails() { + } + + /** + * Get the childTasks property: The child tasks. + * + * @return the childTasks value. + */ + public List childTasks() { + return this.childTasks; + } + + /** + * Set the childTasks property: The child tasks. + * + * @param childTasks the childTasks value to set. + * @return the GroupTaskDetails object itself. + */ + public GroupTaskDetails withChildTasks(List childTasks) { + this.childTasks = childTasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (childTasks() != null) { + childTasks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthError.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthError.java new file mode 100644 index 000000000000..5630de13f4d9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthError.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Health Error. */ +@Fluent +public final class HealthError { + /* + * The inner health errors. HealthError having a list of HealthError as child errors is problematic. + * InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to + * auto-generate the contract. We are exposing the related health errors as inner health errors and all API + * consumers can utilize this in the same fashion as Exception -> InnerException. + */ + @JsonProperty(value = "innerHealthErrors") + private List innerHealthErrors; + + /* + * Source of error. + */ + @JsonProperty(value = "errorSource") + private String errorSource; + + /* + * Type of error. + */ + @JsonProperty(value = "errorType") + private String errorType; + + /* + * Level of error. + */ + @JsonProperty(value = "errorLevel") + private String errorLevel; + + /* + * Category of error. + */ + @JsonProperty(value = "errorCategory") + private String errorCategory; + + /* + * Error code. + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Summary message of the entity. + */ + @JsonProperty(value = "summaryMessage") + private String summaryMessage; + + /* + * Error message. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * Possible causes of error. + */ + @JsonProperty(value = "possibleCauses") + private String possibleCauses; + + /* + * Recommended action to resolve error. + */ + @JsonProperty(value = "recommendedAction") + private String recommendedAction; + + /* + * Error creation time (UTC). + */ + @JsonProperty(value = "creationTimeUtc") + private OffsetDateTime creationTimeUtc; + + /* + * DRA error message. + */ + @JsonProperty(value = "recoveryProviderErrorMessage") + private String recoveryProviderErrorMessage; + + /* + * ID of the entity. + */ + @JsonProperty(value = "entityId") + private String entityId; + + /* + * The health error unique id. + */ + @JsonProperty(value = "errorId") + private String errorId; + + /* + * Value indicating whether the health error is customer resolvable. + */ + @JsonProperty(value = "customerResolvability") + private HealthErrorCustomerResolvability customerResolvability; + + /** Creates an instance of HealthError class. */ + public HealthError() { + } + + /** + * Get the innerHealthErrors property: The inner health errors. HealthError having a list of HealthError as child + * errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when + * Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and + * all API consumers can utilize this in the same fashion as Exception -&gt; InnerException. + * + * @return the innerHealthErrors value. + */ + public List innerHealthErrors() { + return this.innerHealthErrors; + } + + /** + * Set the innerHealthErrors property: The inner health errors. HealthError having a list of HealthError as child + * errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when + * Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and + * all API consumers can utilize this in the same fashion as Exception -&gt; InnerException. + * + * @param innerHealthErrors the innerHealthErrors value to set. + * @return the HealthError object itself. + */ + public HealthError withInnerHealthErrors(List innerHealthErrors) { + this.innerHealthErrors = innerHealthErrors; + return this; + } + + /** + * Get the errorSource property: Source of error. + * + * @return the errorSource value. + */ + public String errorSource() { + return this.errorSource; + } + + /** + * Set the errorSource property: Source of error. + * + * @param errorSource the errorSource value to set. + * @return the HealthError object itself. + */ + public HealthError withErrorSource(String errorSource) { + this.errorSource = errorSource; + return this; + } + + /** + * Get the errorType property: Type of error. + * + * @return the errorType value. + */ + public String errorType() { + return this.errorType; + } + + /** + * Set the errorType property: Type of error. + * + * @param errorType the errorType value to set. + * @return the HealthError object itself. + */ + public HealthError withErrorType(String errorType) { + this.errorType = errorType; + return this; + } + + /** + * Get the errorLevel property: Level of error. + * + * @return the errorLevel value. + */ + public String errorLevel() { + return this.errorLevel; + } + + /** + * Set the errorLevel property: Level of error. + * + * @param errorLevel the errorLevel value to set. + * @return the HealthError object itself. + */ + public HealthError withErrorLevel(String errorLevel) { + this.errorLevel = errorLevel; + return this; + } + + /** + * Get the errorCategory property: Category of error. + * + * @return the errorCategory value. + */ + public String errorCategory() { + return this.errorCategory; + } + + /** + * Set the errorCategory property: Category of error. + * + * @param errorCategory the errorCategory value to set. + * @return the HealthError object itself. + */ + public HealthError withErrorCategory(String errorCategory) { + this.errorCategory = errorCategory; + return this; + } + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: Error code. + * + * @param errorCode the errorCode value to set. + * @return the HealthError object itself. + */ + public HealthError withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the summaryMessage property: Summary message of the entity. + * + * @return the summaryMessage value. + */ + public String summaryMessage() { + return this.summaryMessage; + } + + /** + * Set the summaryMessage property: Summary message of the entity. + * + * @param summaryMessage the summaryMessage value to set. + * @return the HealthError object itself. + */ + public HealthError withSummaryMessage(String summaryMessage) { + this.summaryMessage = summaryMessage; + return this; + } + + /** + * Get the errorMessage property: Error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message. + * + * @param errorMessage the errorMessage value to set. + * @return the HealthError object itself. + */ + public HealthError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the possibleCauses property: Possible causes of error. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Set the possibleCauses property: Possible causes of error. + * + * @param possibleCauses the possibleCauses value to set. + * @return the HealthError object itself. + */ + public HealthError withPossibleCauses(String possibleCauses) { + this.possibleCauses = possibleCauses; + return this; + } + + /** + * Get the recommendedAction property: Recommended action to resolve error. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Set the recommendedAction property: Recommended action to resolve error. + * + * @param recommendedAction the recommendedAction value to set. + * @return the HealthError object itself. + */ + public HealthError withRecommendedAction(String recommendedAction) { + this.recommendedAction = recommendedAction; + return this; + } + + /** + * Get the creationTimeUtc property: Error creation time (UTC). + * + * @return the creationTimeUtc value. + */ + public OffsetDateTime creationTimeUtc() { + return this.creationTimeUtc; + } + + /** + * Set the creationTimeUtc property: Error creation time (UTC). + * + * @param creationTimeUtc the creationTimeUtc value to set. + * @return the HealthError object itself. + */ + public HealthError withCreationTimeUtc(OffsetDateTime creationTimeUtc) { + this.creationTimeUtc = creationTimeUtc; + return this; + } + + /** + * Get the recoveryProviderErrorMessage property: DRA error message. + * + * @return the recoveryProviderErrorMessage value. + */ + public String recoveryProviderErrorMessage() { + return this.recoveryProviderErrorMessage; + } + + /** + * Set the recoveryProviderErrorMessage property: DRA error message. + * + * @param recoveryProviderErrorMessage the recoveryProviderErrorMessage value to set. + * @return the HealthError object itself. + */ + public HealthError withRecoveryProviderErrorMessage(String recoveryProviderErrorMessage) { + this.recoveryProviderErrorMessage = recoveryProviderErrorMessage; + return this; + } + + /** + * Get the entityId property: ID of the entity. + * + * @return the entityId value. + */ + public String entityId() { + return this.entityId; + } + + /** + * Set the entityId property: ID of the entity. + * + * @param entityId the entityId value to set. + * @return the HealthError object itself. + */ + public HealthError withEntityId(String entityId) { + this.entityId = entityId; + return this; + } + + /** + * Get the errorId property: The health error unique id. + * + * @return the errorId value. + */ + public String errorId() { + return this.errorId; + } + + /** + * Set the errorId property: The health error unique id. + * + * @param errorId the errorId value to set. + * @return the HealthError object itself. + */ + public HealthError withErrorId(String errorId) { + this.errorId = errorId; + return this; + } + + /** + * Get the customerResolvability property: Value indicating whether the health error is customer resolvable. + * + * @return the customerResolvability value. + */ + public HealthErrorCustomerResolvability customerResolvability() { + return this.customerResolvability; + } + + /** + * Set the customerResolvability property: Value indicating whether the health error is customer resolvable. + * + * @param customerResolvability the customerResolvability value to set. + * @return the HealthError object itself. + */ + public HealthError withCustomerResolvability(HealthErrorCustomerResolvability customerResolvability) { + this.customerResolvability = customerResolvability; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerHealthErrors() != null) { + innerHealthErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCategory.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCategory.java new file mode 100644 index 000000000000..a23a5886b9ce --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCategory.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The category of the health error. */ +public final class HealthErrorCategory extends ExpandableStringEnum { + /** Static value None for HealthErrorCategory. */ + public static final HealthErrorCategory NONE = fromString("None"); + + /** Static value Replication for HealthErrorCategory. */ + public static final HealthErrorCategory REPLICATION = fromString("Replication"); + + /** Static value TestFailover for HealthErrorCategory. */ + public static final HealthErrorCategory TEST_FAILOVER = fromString("TestFailover"); + + /** Static value Configuration for HealthErrorCategory. */ + public static final HealthErrorCategory CONFIGURATION = fromString("Configuration"); + + /** Static value FabricInfrastructure for HealthErrorCategory. */ + public static final HealthErrorCategory FABRIC_INFRASTRUCTURE = fromString("FabricInfrastructure"); + + /** Static value VersionExpiry for HealthErrorCategory. */ + public static final HealthErrorCategory VERSION_EXPIRY = fromString("VersionExpiry"); + + /** Static value AgentAutoUpdateInfra for HealthErrorCategory. */ + public static final HealthErrorCategory AGENT_AUTO_UPDATE_INFRA = fromString("AgentAutoUpdateInfra"); + + /** Static value AgentAutoUpdateArtifactDeleted for HealthErrorCategory. */ + public static final HealthErrorCategory AGENT_AUTO_UPDATE_ARTIFACT_DELETED = + fromString("AgentAutoUpdateArtifactDeleted"); + + /** Static value AgentAutoUpdateRunAsAccount for HealthErrorCategory. */ + public static final HealthErrorCategory AGENT_AUTO_UPDATE_RUN_AS_ACCOUNT = + fromString("AgentAutoUpdateRunAsAccount"); + + /** Static value AgentAutoUpdateRunAsAccountExpiry for HealthErrorCategory. */ + public static final HealthErrorCategory AGENT_AUTO_UPDATE_RUN_AS_ACCOUNT_EXPIRY = + fromString("AgentAutoUpdateRunAsAccountExpiry"); + + /** Static value AgentAutoUpdateRunAsAccountExpired for HealthErrorCategory. */ + public static final HealthErrorCategory AGENT_AUTO_UPDATE_RUN_AS_ACCOUNT_EXPIRED = + fromString("AgentAutoUpdateRunAsAccountExpired"); + + /** + * Creates or finds a HealthErrorCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthErrorCategory. + */ + @JsonCreator + public static HealthErrorCategory fromString(String name) { + return fromString(name, HealthErrorCategory.class); + } + + /** + * Gets known HealthErrorCategory values. + * + * @return known HealthErrorCategory values. + */ + public static Collection values() { + return values(HealthErrorCategory.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCustomerResolvability.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCustomerResolvability.java new file mode 100644 index 000000000000..d0d26e6dc173 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCustomerResolvability.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Value indicating whether the health error is customer resolvable. */ +public final class HealthErrorCustomerResolvability extends ExpandableStringEnum { + /** Static value Allowed for HealthErrorCustomerResolvability. */ + public static final HealthErrorCustomerResolvability ALLOWED = fromString("Allowed"); + + /** Static value NotAllowed for HealthErrorCustomerResolvability. */ + public static final HealthErrorCustomerResolvability NOT_ALLOWED = fromString("NotAllowed"); + + /** + * Creates or finds a HealthErrorCustomerResolvability from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthErrorCustomerResolvability. + */ + @JsonCreator + public static HealthErrorCustomerResolvability fromString(String name) { + return fromString(name, HealthErrorCustomerResolvability.class); + } + + /** + * Gets known HealthErrorCustomerResolvability values. + * + * @return known HealthErrorCustomerResolvability values. + */ + public static Collection values() { + return values(HealthErrorCustomerResolvability.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorSummary.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorSummary.java new file mode 100644 index 000000000000..63232b4ce3d0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorSummary.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** class to define the summary of the health error details. */ +@Fluent +public final class HealthErrorSummary { + /* + * The code of the health error. + */ + @JsonProperty(value = "summaryCode") + private String summaryCode; + + /* + * The category of the health error. + */ + @JsonProperty(value = "category") + private HealthErrorCategory category; + + /* + * Severity of error. + */ + @JsonProperty(value = "severity") + private Severity severity; + + /* + * The summary message of the health error. + */ + @JsonProperty(value = "summaryMessage") + private String summaryMessage; + + /* + * The type of affected ARM resource. + */ + @JsonProperty(value = "affectedResourceType") + private String affectedResourceType; + + /* + * The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if + * not applicable. + */ + @JsonProperty(value = "affectedResourceSubtype") + private String affectedResourceSubtype; + + /* + * 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; + + /** Creates an instance of HealthErrorSummary class. */ + public HealthErrorSummary() { + } + + /** + * Get the summaryCode property: The code of the health error. + * + * @return the summaryCode value. + */ + public String summaryCode() { + return this.summaryCode; + } + + /** + * Set the summaryCode property: The code of the health error. + * + * @param summaryCode the summaryCode value to set. + * @return the HealthErrorSummary object itself. + */ + public HealthErrorSummary withSummaryCode(String summaryCode) { + this.summaryCode = summaryCode; + return this; + } + + /** + * Get the category property: The category of the health error. + * + * @return the category value. + */ + public HealthErrorCategory category() { + return this.category; + } + + /** + * Set the category property: The category of the health error. + * + * @param category the category value to set. + * @return the HealthErrorSummary object itself. + */ + public HealthErrorSummary withCategory(HealthErrorCategory category) { + this.category = category; + return this; + } + + /** + * Get the severity property: Severity of error. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Set the severity property: Severity of error. + * + * @param severity the severity value to set. + * @return the HealthErrorSummary object itself. + */ + public HealthErrorSummary withSeverity(Severity severity) { + this.severity = severity; + return this; + } + + /** + * Get the summaryMessage property: The summary message of the health error. + * + * @return the summaryMessage value. + */ + public String summaryMessage() { + return this.summaryMessage; + } + + /** + * Set the summaryMessage property: The summary message of the health error. + * + * @param summaryMessage the summaryMessage value to set. + * @return the HealthErrorSummary object itself. + */ + public HealthErrorSummary withSummaryMessage(String summaryMessage) { + this.summaryMessage = summaryMessage; + return this; + } + + /** + * Get the affectedResourceType property: The type of affected ARM resource. + * + * @return the affectedResourceType value. + */ + public String affectedResourceType() { + return this.affectedResourceType; + } + + /** + * Set the affectedResourceType property: The type of affected ARM resource. + * + * @param affectedResourceType the affectedResourceType value to set. + * @return the HealthErrorSummary object itself. + */ + public HealthErrorSummary withAffectedResourceType(String affectedResourceType) { + this.affectedResourceType = affectedResourceType; + return this; + } + + /** + * Get the affectedResourceSubtype property: The sub type of any subcomponent within the ARM resource that this + * might be applicable. Value remains null if not applicable. + * + * @return the affectedResourceSubtype value. + */ + public String affectedResourceSubtype() { + return this.affectedResourceSubtype; + } + + /** + * Set the affectedResourceSubtype property: The sub type of any subcomponent within the ARM resource that this + * might be applicable. Value remains null if not applicable. + * + * @param affectedResourceSubtype the affectedResourceSubtype value to set. + * @return the HealthErrorSummary object itself. + */ + public HealthErrorSummary withAffectedResourceSubtype(String affectedResourceSubtype) { + this.affectedResourceSubtype = affectedResourceSubtype; + return this; + } + + /** + * Get the affectedResourceCorrelationIds property: 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: 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 HealthErrorSummary object itself. + */ + public HealthErrorSummary withAffectedResourceCorrelationIds(List affectedResourceCorrelationIds) { + this.affectedResourceCorrelationIds = affectedResourceCorrelationIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVHostDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVHostDetails.java new file mode 100644 index 000000000000..6a334cf7b1b3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVHostDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Hyper-V host details. */ +@Immutable +public final class HyperVHostDetails { + /* + * The Hyper-V host Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The Hyper-V host name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The Mars agent version. + */ + @JsonProperty(value = "marsAgentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String marsAgentVersion; + + /** Creates an instance of HyperVHostDetails class. */ + public HyperVHostDetails() { + } + + /** + * Get the id property: The Hyper-V host Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The Hyper-V host name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the marsAgentVersion property: The Mars agent version. + * + * @return the marsAgentVersion value. + */ + public String marsAgentVersion() { + return this.marsAgentVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplica2012EventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplica2012EventDetails.java new file mode 100644 index 000000000000..22714ded54df --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplica2012EventDetails.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Model class for event details of a HyperVReplica E2E event. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplica2012") +@Fluent +public final class HyperVReplica2012EventDetails extends EventProviderSpecificDetails { + /* + * The container friendly name. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * The fabric friendly name. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /* + * The remote container name. + */ + @JsonProperty(value = "remoteContainerName") + private String remoteContainerName; + + /* + * The remote fabric name. + */ + @JsonProperty(value = "remoteFabricName") + private String remoteFabricName; + + /** Creates an instance of HyperVReplica2012EventDetails class. */ + public HyperVReplica2012EventDetails() { + } + + /** + * Get the containerName property: The container friendly name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The container friendly name. + * + * @param containerName the containerName value to set. + * @return the HyperVReplica2012EventDetails object itself. + */ + public HyperVReplica2012EventDetails withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the fabricName property: The fabric friendly name. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set the fabricName property: The fabric friendly name. + * + * @param fabricName the fabricName value to set. + * @return the HyperVReplica2012EventDetails object itself. + */ + public HyperVReplica2012EventDetails withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get the remoteContainerName property: The remote container name. + * + * @return the remoteContainerName value. + */ + public String remoteContainerName() { + return this.remoteContainerName; + } + + /** + * Set the remoteContainerName property: The remote container name. + * + * @param remoteContainerName the remoteContainerName value to set. + * @return the HyperVReplica2012EventDetails object itself. + */ + public HyperVReplica2012EventDetails withRemoteContainerName(String remoteContainerName) { + this.remoteContainerName = remoteContainerName; + return this; + } + + /** + * Get the remoteFabricName property: The remote fabric name. + * + * @return the remoteFabricName value. + */ + public String remoteFabricName() { + return this.remoteFabricName; + } + + /** + * Set the remoteFabricName property: The remote fabric name. + * + * @param remoteFabricName the remoteFabricName value to set. + * @return the HyperVReplica2012EventDetails object itself. + */ + public HyperVReplica2012EventDetails withRemoteFabricName(String remoteFabricName) { + this.remoteFabricName = remoteFabricName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplica2012R2EventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplica2012R2EventDetails.java new file mode 100644 index 000000000000..e3715350f5ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplica2012R2EventDetails.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Model class for event details of a HyperVReplica blue E2E event. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplica2012R2") +@Fluent +public final class HyperVReplica2012R2EventDetails extends EventProviderSpecificDetails { + /* + * The container friendly name. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * The fabric friendly name. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /* + * The remote container name. + */ + @JsonProperty(value = "remoteContainerName") + private String remoteContainerName; + + /* + * The remote fabric name. + */ + @JsonProperty(value = "remoteFabricName") + private String remoteFabricName; + + /** Creates an instance of HyperVReplica2012R2EventDetails class. */ + public HyperVReplica2012R2EventDetails() { + } + + /** + * Get the containerName property: The container friendly name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The container friendly name. + * + * @param containerName the containerName value to set. + * @return the HyperVReplica2012R2EventDetails object itself. + */ + public HyperVReplica2012R2EventDetails withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the fabricName property: The fabric friendly name. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set the fabricName property: The fabric friendly name. + * + * @param fabricName the fabricName value to set. + * @return the HyperVReplica2012R2EventDetails object itself. + */ + public HyperVReplica2012R2EventDetails withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get the remoteContainerName property: The remote container name. + * + * @return the remoteContainerName value. + */ + public String remoteContainerName() { + return this.remoteContainerName; + } + + /** + * Set the remoteContainerName property: The remote container name. + * + * @param remoteContainerName the remoteContainerName value to set. + * @return the HyperVReplica2012R2EventDetails object itself. + */ + public HyperVReplica2012R2EventDetails withRemoteContainerName(String remoteContainerName) { + this.remoteContainerName = remoteContainerName; + return this; + } + + /** + * Get the remoteFabricName property: The remote fabric name. + * + * @return the remoteFabricName value. + */ + public String remoteFabricName() { + return this.remoteFabricName; + } + + /** + * Set the remoteFabricName property: The remote fabric name. + * + * @param remoteFabricName the remoteFabricName value to set. + * @return the HyperVReplica2012R2EventDetails object itself. + */ + public HyperVReplica2012R2EventDetails withRemoteFabricName(String remoteFabricName) { + this.remoteFabricName = remoteFabricName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureApplyRecoveryPointInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureApplyRecoveryPointInput.java new file mode 100644 index 000000000000..882f9e06e988 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureApplyRecoveryPointInput.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.recoveryservicessiterecovery.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; + +/** ApplyRecoveryPoint input specific to HyperVReplicaAzure provider. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { + /* + * The primary kek certificate pfx. + */ + @JsonProperty(value = "primaryKekCertificatePfx") + private String primaryKekCertificatePfx; + + /* + * The secondary kek certificate pfx. + */ + @JsonProperty(value = "secondaryKekCertificatePfx") + private String secondaryKekCertificatePfx; + + /** Creates an instance of HyperVReplicaAzureApplyRecoveryPointInput class. */ + public HyperVReplicaAzureApplyRecoveryPointInput() { + } + + /** + * Get the primaryKekCertificatePfx property: The primary kek certificate pfx. + * + * @return the primaryKekCertificatePfx value. + */ + public String primaryKekCertificatePfx() { + return this.primaryKekCertificatePfx; + } + + /** + * Set the primaryKekCertificatePfx property: The primary kek certificate pfx. + * + * @param primaryKekCertificatePfx the primaryKekCertificatePfx value to set. + * @return the HyperVReplicaAzureApplyRecoveryPointInput object itself. + */ + public HyperVReplicaAzureApplyRecoveryPointInput withPrimaryKekCertificatePfx(String primaryKekCertificatePfx) { + this.primaryKekCertificatePfx = primaryKekCertificatePfx; + return this; + } + + /** + * Get the secondaryKekCertificatePfx property: The secondary kek certificate pfx. + * + * @return the secondaryKekCertificatePfx value. + */ + public String secondaryKekCertificatePfx() { + return this.secondaryKekCertificatePfx; + } + + /** + * Set the secondaryKekCertificatePfx property: The secondary kek certificate pfx. + * + * @param secondaryKekCertificatePfx the secondaryKekCertificatePfx value to set. + * @return the HyperVReplicaAzureApplyRecoveryPointInput object itself. + */ + public HyperVReplicaAzureApplyRecoveryPointInput withSecondaryKekCertificatePfx(String secondaryKekCertificatePfx) { + this.secondaryKekCertificatePfx = secondaryKekCertificatePfx; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureDiskInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureDiskInputDetails.java new file mode 100644 index 000000000000..5b4d9fda8d15 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureDiskInputDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk input details. */ +@Fluent +public final class HyperVReplicaAzureDiskInputDetails { + /* + * The DiskId. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The LogStorageAccountId. + */ + @JsonProperty(value = "logStorageAccountId") + private String logStorageAccountId; + + /* + * The DiskType. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /* + * The DiskEncryptionSet ARM ID. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** Creates an instance of HyperVReplicaAzureDiskInputDetails class. */ + public HyperVReplicaAzureDiskInputDetails() { + } + + /** + * Get the diskId property: The DiskId. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The DiskId. + * + * @param diskId the diskId value to set. + * @return the HyperVReplicaAzureDiskInputDetails object itself. + */ + public HyperVReplicaAzureDiskInputDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the logStorageAccountId property: The LogStorageAccountId. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The LogStorageAccountId. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the HyperVReplicaAzureDiskInputDetails object itself. + */ + public HyperVReplicaAzureDiskInputDetails withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Get the diskType property: The DiskType. + * + * @return the diskType value. + */ + public DiskAccountType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The DiskType. + * + * @param diskType the diskType value to set. + * @return the HyperVReplicaAzureDiskInputDetails object itself. + */ + public HyperVReplicaAzureDiskInputDetails withDiskType(DiskAccountType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM ID. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The DiskEncryptionSet ARM ID. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the HyperVReplicaAzureDiskInputDetails object itself. + */ + public HyperVReplicaAzureDiskInputDetails withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEnableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEnableProtectionInput.java new file mode 100644 index 000000000000..f74697d9687f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEnableProtectionInput.java @@ -0,0 +1,783 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** HyperVReplicaAzure specific enable protection input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureEnableProtectionInput extends EnableProtectionProviderSpecificInput { + /* + * The Hyper-V host VM Id. + */ + @JsonProperty(value = "hvHostVmId") + private String hvHostVmId; + + /* + * The VM Name. + */ + @JsonProperty(value = "vmName") + private String vmName; + + /* + * The OS type associated with VM. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The OS disk VHD id associated with VM. + */ + @JsonProperty(value = "vhdId") + private String vhdId; + + /* + * The storage account Id. + */ + @JsonProperty(value = "targetStorageAccountId") + private String targetStorageAccountId; + + /* + * The selected target Azure network Id. + */ + @JsonProperty(value = "targetAzureNetworkId") + private String targetAzureNetworkId; + + /* + * The selected target Azure subnet Id. + */ + @JsonProperty(value = "targetAzureSubnetId") + private String targetAzureSubnetId; + + /* + * The selected option to enable RDP\SSH on target vm after failover. String value of + * SrsDataContract.EnableRDPOnTargetOption enum. + */ + @JsonProperty(value = "enableRdpOnTargetOption") + private String enableRdpOnTargetOption; + + /* + * The target azure VM Name. + */ + @JsonProperty(value = "targetAzureVmName") + private String targetAzureVmName; + + /* + * The storage account to be used for logging during replication. + */ + @JsonProperty(value = "logStorageAccountId") + private String logStorageAccountId; + + /* + * The list of VHD Ids of disks to be protected. + */ + @JsonProperty(value = "disksToInclude") + private List disksToInclude; + + /* + * The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + */ + @JsonProperty(value = "targetAzureV1ResourceGroupId") + private String targetAzureV1ResourceGroupId; + + /* + * The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + */ + @JsonProperty(value = "targetAzureV2ResourceGroupId") + private String targetAzureV2ResourceGroupId; + + /* + * A value indicating whether managed disks should be used during failover. + */ + @JsonProperty(value = "useManagedDisks") + private String useManagedDisks; + + /* + * The target availability set ARM Id for resource manager deployment. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * License type. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private SqlServerLicenseType sqlServerLicenseType; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /* + * The proximity placement group ARM Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * A value indicating whether managed disks should be used during replication. + */ + @JsonProperty(value = "useManagedDisksForReplication") + private String useManagedDisksForReplication; + + /* + * The DiskType. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /* + * The disks to include list for managed disks. + */ + @JsonProperty(value = "disksToIncludeForManagedDisks") + private List disksToIncludeForManagedDisks; + + /* + * The DiskEncryptionSet ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The tags for the seed managed disks. + */ + @JsonProperty(value = "seedManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map seedManagedDiskTags; + + /* + * The tags for the target managed disks. + */ + @JsonProperty(value = "targetManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetManagedDiskTags; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /** Creates an instance of HyperVReplicaAzureEnableProtectionInput class. */ + public HyperVReplicaAzureEnableProtectionInput() { + } + + /** + * Get the hvHostVmId property: The Hyper-V host VM Id. + * + * @return the hvHostVmId value. + */ + public String hvHostVmId() { + return this.hvHostVmId; + } + + /** + * Set the hvHostVmId property: The Hyper-V host VM Id. + * + * @param hvHostVmId the hvHostVmId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withHvHostVmId(String hvHostVmId) { + this.hvHostVmId = hvHostVmId; + return this; + } + + /** + * Get the vmName property: The VM Name. + * + * @return the vmName value. + */ + public String vmName() { + return this.vmName; + } + + /** + * Set the vmName property: The VM Name. + * + * @param vmName the vmName value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withVmName(String vmName) { + this.vmName = vmName; + return this; + } + + /** + * Get the osType property: The OS type associated with VM. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type associated with VM. + * + * @param osType the osType value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the vhdId property: The OS disk VHD id associated with VM. + * + * @return the vhdId value. + */ + public String vhdId() { + return this.vhdId; + } + + /** + * Set the vhdId property: The OS disk VHD id associated with VM. + * + * @param vhdId the vhdId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withVhdId(String vhdId) { + this.vhdId = vhdId; + return this; + } + + /** + * Get the targetStorageAccountId property: The storage account Id. + * + * @return the targetStorageAccountId value. + */ + public String targetStorageAccountId() { + return this.targetStorageAccountId; + } + + /** + * Set the targetStorageAccountId property: The storage account Id. + * + * @param targetStorageAccountId the targetStorageAccountId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetStorageAccountId(String targetStorageAccountId) { + this.targetStorageAccountId = targetStorageAccountId; + return this; + } + + /** + * Get the targetAzureNetworkId property: The selected target Azure network Id. + * + * @return the targetAzureNetworkId value. + */ + public String targetAzureNetworkId() { + return this.targetAzureNetworkId; + } + + /** + * Set the targetAzureNetworkId property: The selected target Azure network Id. + * + * @param targetAzureNetworkId the targetAzureNetworkId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetAzureNetworkId(String targetAzureNetworkId) { + this.targetAzureNetworkId = targetAzureNetworkId; + return this; + } + + /** + * Get the targetAzureSubnetId property: The selected target Azure subnet Id. + * + * @return the targetAzureSubnetId value. + */ + public String targetAzureSubnetId() { + return this.targetAzureSubnetId; + } + + /** + * Set the targetAzureSubnetId property: The selected target Azure subnet Id. + * + * @param targetAzureSubnetId the targetAzureSubnetId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetAzureSubnetId(String targetAzureSubnetId) { + this.targetAzureSubnetId = targetAzureSubnetId; + return this; + } + + /** + * Get the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target vm after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @return the enableRdpOnTargetOption value. + */ + public String enableRdpOnTargetOption() { + return this.enableRdpOnTargetOption; + } + + /** + * Set the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target vm after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @param enableRdpOnTargetOption the enableRdpOnTargetOption value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withEnableRdpOnTargetOption(String enableRdpOnTargetOption) { + this.enableRdpOnTargetOption = enableRdpOnTargetOption; + return this; + } + + /** + * Get the targetAzureVmName property: The target azure VM Name. + * + * @return the targetAzureVmName value. + */ + public String targetAzureVmName() { + return this.targetAzureVmName; + } + + /** + * Set the targetAzureVmName property: The target azure VM Name. + * + * @param targetAzureVmName the targetAzureVmName value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetAzureVmName(String targetAzureVmName) { + this.targetAzureVmName = targetAzureVmName; + return this; + } + + /** + * Get the logStorageAccountId property: The storage account to be used for logging during replication. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The storage account to be used for logging during replication. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Get the disksToInclude property: The list of VHD Ids of disks to be protected. + * + * @return the disksToInclude value. + */ + public List disksToInclude() { + return this.disksToInclude; + } + + /** + * Set the disksToInclude property: The list of VHD Ids of disks to be protected. + * + * @param disksToInclude the disksToInclude value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withDisksToInclude(List disksToInclude) { + this.disksToInclude = disksToInclude; + return this; + } + + /** + * Get the targetAzureV1ResourceGroupId property: The Id of the target resource group (for classic deployment) in + * which the failover VM is to be created. + * + * @return the targetAzureV1ResourceGroupId value. + */ + public String targetAzureV1ResourceGroupId() { + return this.targetAzureV1ResourceGroupId; + } + + /** + * Set the targetAzureV1ResourceGroupId property: The Id of the target resource group (for classic deployment) in + * which the failover VM is to be created. + * + * @param targetAzureV1ResourceGroupId the targetAzureV1ResourceGroupId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetAzureV1ResourceGroupId( + String targetAzureV1ResourceGroupId) { + this.targetAzureV1ResourceGroupId = targetAzureV1ResourceGroupId; + return this; + } + + /** + * Get the targetAzureV2ResourceGroupId property: The Id of the target resource group (for resource manager + * deployment) in which the failover VM is to be created. + * + * @return the targetAzureV2ResourceGroupId value. + */ + public String targetAzureV2ResourceGroupId() { + return this.targetAzureV2ResourceGroupId; + } + + /** + * Set the targetAzureV2ResourceGroupId property: The Id of the target resource group (for resource manager + * deployment) in which the failover VM is to be created. + * + * @param targetAzureV2ResourceGroupId the targetAzureV2ResourceGroupId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetAzureV2ResourceGroupId( + String targetAzureV2ResourceGroupId) { + this.targetAzureV2ResourceGroupId = targetAzureV2ResourceGroupId; + return this; + } + + /** + * Get the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @return the useManagedDisks value. + */ + public String useManagedDisks() { + return this.useManagedDisks; + } + + /** + * Set the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @param useManagedDisks the useManagedDisks value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withUseManagedDisks(String useManagedDisks) { + this.useManagedDisks = useManagedDisks; + return this; + } + + /** + * Get the targetAvailabilitySetId property: The target availability set ARM Id for resource manager deployment. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The target availability set ARM Id for resource manager deployment. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the licenseType property: License type. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: License type. + * + * @param licenseType the licenseType value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public SqlServerLicenseType sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withSqlServerLicenseType(SqlServerLicenseType sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the targetVmSize property: The target VM size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Set the targetVmSize property: The target VM size. + * + * @param targetVmSize the targetVmSize value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetVmSize(String targetVmSize) { + this.targetVmSize = targetVmSize; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The proximity placement group ARM Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The proximity placement group ARM Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetProximityPlacementGroupId( + String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the useManagedDisksForReplication property: A value indicating whether managed disks should be used during + * replication. + * + * @return the useManagedDisksForReplication value. + */ + public String useManagedDisksForReplication() { + return this.useManagedDisksForReplication; + } + + /** + * Set the useManagedDisksForReplication property: A value indicating whether managed disks should be used during + * replication. + * + * @param useManagedDisksForReplication the useManagedDisksForReplication value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withUseManagedDisksForReplication( + String useManagedDisksForReplication) { + this.useManagedDisksForReplication = useManagedDisksForReplication; + return this; + } + + /** + * Get the diskType property: The DiskType. + * + * @return the diskType value. + */ + public DiskAccountType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The DiskType. + * + * @param diskType the diskType value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withDiskType(DiskAccountType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the disksToIncludeForManagedDisks property: The disks to include list for managed disks. + * + * @return the disksToIncludeForManagedDisks value. + */ + public List disksToIncludeForManagedDisks() { + return this.disksToIncludeForManagedDisks; + } + + /** + * Set the disksToIncludeForManagedDisks property: The disks to include list for managed disks. + * + * @param disksToIncludeForManagedDisks the disksToIncludeForManagedDisks value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withDisksToIncludeForManagedDisks( + List disksToIncludeForManagedDisks) { + this.disksToIncludeForManagedDisks = disksToIncludeForManagedDisks; + return this; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the seedManagedDiskTags property: The tags for the seed managed disks. + * + * @return the seedManagedDiskTags value. + */ + public Map seedManagedDiskTags() { + return this.seedManagedDiskTags; + } + + /** + * Set the seedManagedDiskTags property: The tags for the seed managed disks. + * + * @param seedManagedDiskTags the seedManagedDiskTags value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withSeedManagedDiskTags(Map seedManagedDiskTags) { + this.seedManagedDiskTags = seedManagedDiskTags; + return this; + } + + /** + * Get the targetManagedDiskTags property: The tags for the target managed disks. + * + * @return the targetManagedDiskTags value. + */ + public Map targetManagedDiskTags() { + return this.targetManagedDiskTags; + } + + /** + * Set the targetManagedDiskTags property: The tags for the target managed disks. + * + * @param targetManagedDiskTags the targetManagedDiskTags value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetManagedDiskTags( + Map targetManagedDiskTags) { + this.targetManagedDiskTags = targetManagedDiskTags; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (disksToIncludeForManagedDisks() != null) { + disksToIncludeForManagedDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEventDetails.java new file mode 100644 index 000000000000..61fe344a5b76 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEventDetails.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Model class for event details of a HyperVReplica E2A event. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureEventDetails extends EventProviderSpecificDetails { + /* + * The container friendly name. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * The fabric friendly name. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /* + * The remote container name. + */ + @JsonProperty(value = "remoteContainerName") + private String remoteContainerName; + + /** Creates an instance of HyperVReplicaAzureEventDetails class. */ + public HyperVReplicaAzureEventDetails() { + } + + /** + * Get the containerName property: The container friendly name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The container friendly name. + * + * @param containerName the containerName value to set. + * @return the HyperVReplicaAzureEventDetails object itself. + */ + public HyperVReplicaAzureEventDetails withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the fabricName property: The fabric friendly name. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set the fabricName property: The fabric friendly name. + * + * @param fabricName the fabricName value to set. + * @return the HyperVReplicaAzureEventDetails object itself. + */ + public HyperVReplicaAzureEventDetails withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get the remoteContainerName property: The remote container name. + * + * @return the remoteContainerName value. + */ + public String remoteContainerName() { + return this.remoteContainerName; + } + + /** + * Set the remoteContainerName property: The remote container name. + * + * @param remoteContainerName the remoteContainerName value to set. + * @return the HyperVReplicaAzureEventDetails object itself. + */ + public HyperVReplicaAzureEventDetails withRemoteContainerName(String remoteContainerName) { + this.remoteContainerName = remoteContainerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureFailbackProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureFailbackProviderInput.java new file mode 100644 index 000000000000..87d0f88adf9f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureFailbackProviderInput.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** HyperVReplicaAzureFailback specific planned failover input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzureFailback") +@Fluent +public final class HyperVReplicaAzureFailbackProviderInput extends PlannedFailoverProviderSpecificFailoverInput { + /* + * Data sync option. + */ + @JsonProperty(value = "dataSyncOption") + private String dataSyncOption; + + /* + * ALR options to create alternate recovery. + */ + @JsonProperty(value = "recoveryVmCreationOption") + private String recoveryVmCreationOption; + + /* + * Provider Id for alternate location. + */ + @JsonProperty(value = "providerIdForAlternateRecovery") + private String providerIdForAlternateRecovery; + + /** Creates an instance of HyperVReplicaAzureFailbackProviderInput class. */ + public HyperVReplicaAzureFailbackProviderInput() { + } + + /** + * Get the dataSyncOption property: Data sync option. + * + * @return the dataSyncOption value. + */ + public String dataSyncOption() { + return this.dataSyncOption; + } + + /** + * Set the dataSyncOption property: Data sync option. + * + * @param dataSyncOption the dataSyncOption value to set. + * @return the HyperVReplicaAzureFailbackProviderInput object itself. + */ + public HyperVReplicaAzureFailbackProviderInput withDataSyncOption(String dataSyncOption) { + this.dataSyncOption = dataSyncOption; + return this; + } + + /** + * Get the recoveryVmCreationOption property: ALR options to create alternate recovery. + * + * @return the recoveryVmCreationOption value. + */ + public String recoveryVmCreationOption() { + return this.recoveryVmCreationOption; + } + + /** + * Set the recoveryVmCreationOption property: ALR options to create alternate recovery. + * + * @param recoveryVmCreationOption the recoveryVmCreationOption value to set. + * @return the HyperVReplicaAzureFailbackProviderInput object itself. + */ + public HyperVReplicaAzureFailbackProviderInput withRecoveryVmCreationOption(String recoveryVmCreationOption) { + this.recoveryVmCreationOption = recoveryVmCreationOption; + return this; + } + + /** + * Get the providerIdForAlternateRecovery property: Provider Id for alternate location. + * + * @return the providerIdForAlternateRecovery value. + */ + public String providerIdForAlternateRecovery() { + return this.providerIdForAlternateRecovery; + } + + /** + * Set the providerIdForAlternateRecovery property: Provider Id for alternate location. + * + * @param providerIdForAlternateRecovery the providerIdForAlternateRecovery value to set. + * @return the HyperVReplicaAzureFailbackProviderInput object itself. + */ + public HyperVReplicaAzureFailbackProviderInput withProviderIdForAlternateRecovery( + String providerIdForAlternateRecovery) { + this.providerIdForAlternateRecovery = providerIdForAlternateRecovery; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureManagedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureManagedDiskDetails.java new file mode 100644 index 000000000000..8f35670622e3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureManagedDiskDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Hyper-V Managed disk details. */ +@Fluent +public final class HyperVReplicaAzureManagedDiskDetails { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * Seed managed disk Id. + */ + @JsonProperty(value = "seedManagedDiskId") + private String seedManagedDiskId; + + /* + * The replica disk type. + */ + @JsonProperty(value = "replicaDiskType") + private String replicaDiskType; + + /* + * The disk encryption set ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** Creates an instance of HyperVReplicaAzureManagedDiskDetails class. */ + public HyperVReplicaAzureManagedDiskDetails() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk Id. + * + * @param diskId the diskId value to set. + * @return the HyperVReplicaAzureManagedDiskDetails object itself. + */ + public HyperVReplicaAzureManagedDiskDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the seedManagedDiskId property: Seed managed disk Id. + * + * @return the seedManagedDiskId value. + */ + public String seedManagedDiskId() { + return this.seedManagedDiskId; + } + + /** + * Set the seedManagedDiskId property: Seed managed disk Id. + * + * @param seedManagedDiskId the seedManagedDiskId value to set. + * @return the HyperVReplicaAzureManagedDiskDetails object itself. + */ + public HyperVReplicaAzureManagedDiskDetails withSeedManagedDiskId(String seedManagedDiskId) { + this.seedManagedDiskId = seedManagedDiskId; + return this; + } + + /** + * Get the replicaDiskType property: The replica disk type. + * + * @return the replicaDiskType value. + */ + public String replicaDiskType() { + return this.replicaDiskType; + } + + /** + * Set the replicaDiskType property: The replica disk type. + * + * @param replicaDiskType the replicaDiskType value to set. + * @return the HyperVReplicaAzureManagedDiskDetails object itself. + */ + public HyperVReplicaAzureManagedDiskDetails withReplicaDiskType(String replicaDiskType) { + this.replicaDiskType = replicaDiskType; + return this; + } + + /** + * Get the diskEncryptionSetId property: The disk encryption set ARM Id. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The disk encryption set ARM Id. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the HyperVReplicaAzureManagedDiskDetails object itself. + */ + public HyperVReplicaAzureManagedDiskDetails withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePlannedFailoverProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePlannedFailoverProviderInput.java new file mode 100644 index 000000000000..ea22ab7357e1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePlannedFailoverProviderInput.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** HyperVReplicaAzure specific planned failover input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzurePlannedFailoverProviderInput extends PlannedFailoverProviderSpecificFailoverInput { + /* + * Primary kek certificate pfx. + */ + @JsonProperty(value = "primaryKekCertificatePfx") + private String primaryKekCertificatePfx; + + /* + * Secondary kek certificate pfx. + */ + @JsonProperty(value = "secondaryKekCertificatePfx") + private String secondaryKekCertificatePfx; + + /* + * The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, + * null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** Creates an instance of HyperVReplicaAzurePlannedFailoverProviderInput class. */ + public HyperVReplicaAzurePlannedFailoverProviderInput() { + } + + /** + * Get the primaryKekCertificatePfx property: Primary kek certificate pfx. + * + * @return the primaryKekCertificatePfx value. + */ + public String primaryKekCertificatePfx() { + return this.primaryKekCertificatePfx; + } + + /** + * Set the primaryKekCertificatePfx property: Primary kek certificate pfx. + * + * @param primaryKekCertificatePfx the primaryKekCertificatePfx value to set. + * @return the HyperVReplicaAzurePlannedFailoverProviderInput object itself. + */ + public HyperVReplicaAzurePlannedFailoverProviderInput withPrimaryKekCertificatePfx( + String primaryKekCertificatePfx) { + this.primaryKekCertificatePfx = primaryKekCertificatePfx; + return this; + } + + /** + * Get the secondaryKekCertificatePfx property: Secondary kek certificate pfx. + * + * @return the secondaryKekCertificatePfx value. + */ + public String secondaryKekCertificatePfx() { + return this.secondaryKekCertificatePfx; + } + + /** + * Set the secondaryKekCertificatePfx property: Secondary kek certificate pfx. + * + * @param secondaryKekCertificatePfx the secondaryKekCertificatePfx value to set. + * @return the HyperVReplicaAzurePlannedFailoverProviderInput object itself. + */ + public HyperVReplicaAzurePlannedFailoverProviderInput withSecondaryKekCertificatePfx( + String secondaryKekCertificatePfx) { + this.secondaryKekCertificatePfx = secondaryKekCertificatePfx; + return this; + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the HyperVReplicaAzurePlannedFailoverProviderInput object itself. + */ + public HyperVReplicaAzurePlannedFailoverProviderInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyDetails.java new file mode 100644 index 000000000000..3d85a8fd5bf5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyDetails.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Hyper-V Replica Azure specific protection profile details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzurePolicyDetails extends PolicyProviderSpecificDetails { + /* + * The duration (in hours) to which point the recovery history needs to be maintained. + */ + @JsonProperty(value = "recoveryPointHistoryDurationInHours") + private Integer recoveryPointHistoryDurationInHours; + + /* + * The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + */ + @JsonProperty(value = "applicationConsistentSnapshotFrequencyInHours") + private Integer applicationConsistentSnapshotFrequencyInHours; + + /* + * The replication interval. + */ + @JsonProperty(value = "replicationInterval") + private Integer replicationInterval; + + /* + * The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts + * immediately. + */ + @JsonProperty(value = "onlineReplicationStartTime") + private String onlineReplicationStartTime; + + /* + * A value indicating whether encryption is enabled for virtual machines in this cloud. + */ + @JsonProperty(value = "encryption") + private String encryption; + + /* + * The active storage account Id. + */ + @JsonProperty(value = "activeStorageAccountId") + private String activeStorageAccountId; + + /** Creates an instance of HyperVReplicaAzurePolicyDetails class. */ + public HyperVReplicaAzurePolicyDetails() { + } + + /** + * Get the recoveryPointHistoryDurationInHours property: The duration (in hours) to which point the recovery history + * needs to be maintained. + * + * @return the recoveryPointHistoryDurationInHours value. + */ + public Integer recoveryPointHistoryDurationInHours() { + return this.recoveryPointHistoryDurationInHours; + } + + /** + * Set the recoveryPointHistoryDurationInHours property: The duration (in hours) to which point the recovery history + * needs to be maintained. + * + * @param recoveryPointHistoryDurationInHours the recoveryPointHistoryDurationInHours value to set. + * @return the HyperVReplicaAzurePolicyDetails object itself. + */ + public HyperVReplicaAzurePolicyDetails withRecoveryPointHistoryDurationInHours( + Integer recoveryPointHistoryDurationInHours) { + this.recoveryPointHistoryDurationInHours = recoveryPointHistoryDurationInHours; + return this; + } + + /** + * Get the applicationConsistentSnapshotFrequencyInHours property: The interval (in hours) at which Hyper-V Replica + * should create an application consistent snapshot within the VM. + * + * @return the applicationConsistentSnapshotFrequencyInHours value. + */ + public Integer applicationConsistentSnapshotFrequencyInHours() { + return this.applicationConsistentSnapshotFrequencyInHours; + } + + /** + * Set the applicationConsistentSnapshotFrequencyInHours property: The interval (in hours) at which Hyper-V Replica + * should create an application consistent snapshot within the VM. + * + * @param applicationConsistentSnapshotFrequencyInHours the applicationConsistentSnapshotFrequencyInHours value to + * set. + * @return the HyperVReplicaAzurePolicyDetails object itself. + */ + public HyperVReplicaAzurePolicyDetails withApplicationConsistentSnapshotFrequencyInHours( + Integer applicationConsistentSnapshotFrequencyInHours) { + this.applicationConsistentSnapshotFrequencyInHours = applicationConsistentSnapshotFrequencyInHours; + return this; + } + + /** + * Get the replicationInterval property: The replication interval. + * + * @return the replicationInterval value. + */ + public Integer replicationInterval() { + return this.replicationInterval; + } + + /** + * Set the replicationInterval property: The replication interval. + * + * @param replicationInterval the replicationInterval value to set. + * @return the HyperVReplicaAzurePolicyDetails object itself. + */ + public HyperVReplicaAzurePolicyDetails withReplicationInterval(Integer replicationInterval) { + this.replicationInterval = replicationInterval; + return this; + } + + /** + * Get the onlineReplicationStartTime property: The scheduled start time for the initial replication. If this + * parameter is Null, the initial replication starts immediately. + * + * @return the onlineReplicationStartTime value. + */ + public String onlineReplicationStartTime() { + return this.onlineReplicationStartTime; + } + + /** + * Set the onlineReplicationStartTime property: The scheduled start time for the initial replication. If this + * parameter is Null, the initial replication starts immediately. + * + * @param onlineReplicationStartTime the onlineReplicationStartTime value to set. + * @return the HyperVReplicaAzurePolicyDetails object itself. + */ + public HyperVReplicaAzurePolicyDetails withOnlineReplicationStartTime(String onlineReplicationStartTime) { + this.onlineReplicationStartTime = onlineReplicationStartTime; + return this; + } + + /** + * Get the encryption property: A value indicating whether encryption is enabled for virtual machines in this cloud. + * + * @return the encryption value. + */ + public String encryption() { + return this.encryption; + } + + /** + * Set the encryption property: A value indicating whether encryption is enabled for virtual machines in this cloud. + * + * @param encryption the encryption value to set. + * @return the HyperVReplicaAzurePolicyDetails object itself. + */ + public HyperVReplicaAzurePolicyDetails withEncryption(String encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the activeStorageAccountId property: The active storage account Id. + * + * @return the activeStorageAccountId value. + */ + public String activeStorageAccountId() { + return this.activeStorageAccountId; + } + + /** + * Set the activeStorageAccountId property: The active storage account Id. + * + * @param activeStorageAccountId the activeStorageAccountId value to set. + * @return the HyperVReplicaAzurePolicyDetails object itself. + */ + public HyperVReplicaAzurePolicyDetails withActiveStorageAccountId(String activeStorageAccountId) { + this.activeStorageAccountId = activeStorageAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyInput.java new file mode 100644 index 000000000000..3858b50da96d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyInput.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.recoveryservicessiterecovery.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; +import java.util.List; + +/** Hyper-V Replica Azure specific input for creating a protection profile. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzurePolicyInput extends PolicyProviderSpecificInput { + /* + * The duration (in hours) to which point the recovery history needs to be maintained. + */ + @JsonProperty(value = "recoveryPointHistoryDuration") + private Integer recoveryPointHistoryDuration; + + /* + * The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. + */ + @JsonProperty(value = "applicationConsistentSnapshotFrequencyInHours") + private Integer applicationConsistentSnapshotFrequencyInHours; + + /* + * The replication interval. + */ + @JsonProperty(value = "replicationInterval") + private Integer replicationInterval; + + /* + * The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts + * immediately. + */ + @JsonProperty(value = "onlineReplicationStartTime") + private String onlineReplicationStartTime; + + /* + * The list of storage accounts to which the VMs in the primary cloud can replicate to. + */ + @JsonProperty(value = "storageAccounts") + private List storageAccounts; + + /** Creates an instance of HyperVReplicaAzurePolicyInput class. */ + public HyperVReplicaAzurePolicyInput() { + } + + /** + * Get the recoveryPointHistoryDuration property: The duration (in hours) to which point the recovery history needs + * to be maintained. + * + * @return the recoveryPointHistoryDuration value. + */ + public Integer recoveryPointHistoryDuration() { + return this.recoveryPointHistoryDuration; + } + + /** + * Set the recoveryPointHistoryDuration property: The duration (in hours) to which point the recovery history needs + * to be maintained. + * + * @param recoveryPointHistoryDuration the recoveryPointHistoryDuration value to set. + * @return the HyperVReplicaAzurePolicyInput object itself. + */ + public HyperVReplicaAzurePolicyInput withRecoveryPointHistoryDuration(Integer recoveryPointHistoryDuration) { + this.recoveryPointHistoryDuration = recoveryPointHistoryDuration; + return this; + } + + /** + * Get the applicationConsistentSnapshotFrequencyInHours property: The interval (in hours) at which Hyper-V Replica + * should create an application consistent snapshot within the VM. + * + * @return the applicationConsistentSnapshotFrequencyInHours value. + */ + public Integer applicationConsistentSnapshotFrequencyInHours() { + return this.applicationConsistentSnapshotFrequencyInHours; + } + + /** + * Set the applicationConsistentSnapshotFrequencyInHours property: The interval (in hours) at which Hyper-V Replica + * should create an application consistent snapshot within the VM. + * + * @param applicationConsistentSnapshotFrequencyInHours the applicationConsistentSnapshotFrequencyInHours value to + * set. + * @return the HyperVReplicaAzurePolicyInput object itself. + */ + public HyperVReplicaAzurePolicyInput withApplicationConsistentSnapshotFrequencyInHours( + Integer applicationConsistentSnapshotFrequencyInHours) { + this.applicationConsistentSnapshotFrequencyInHours = applicationConsistentSnapshotFrequencyInHours; + return this; + } + + /** + * Get the replicationInterval property: The replication interval. + * + * @return the replicationInterval value. + */ + public Integer replicationInterval() { + return this.replicationInterval; + } + + /** + * Set the replicationInterval property: The replication interval. + * + * @param replicationInterval the replicationInterval value to set. + * @return the HyperVReplicaAzurePolicyInput object itself. + */ + public HyperVReplicaAzurePolicyInput withReplicationInterval(Integer replicationInterval) { + this.replicationInterval = replicationInterval; + return this; + } + + /** + * Get the onlineReplicationStartTime property: The scheduled start time for the initial replication. If this + * parameter is Null, the initial replication starts immediately. + * + * @return the onlineReplicationStartTime value. + */ + public String onlineReplicationStartTime() { + return this.onlineReplicationStartTime; + } + + /** + * Set the onlineReplicationStartTime property: The scheduled start time for the initial replication. If this + * parameter is Null, the initial replication starts immediately. + * + * @param onlineReplicationStartTime the onlineReplicationStartTime value to set. + * @return the HyperVReplicaAzurePolicyInput object itself. + */ + public HyperVReplicaAzurePolicyInput withOnlineReplicationStartTime(String onlineReplicationStartTime) { + this.onlineReplicationStartTime = onlineReplicationStartTime; + return this; + } + + /** + * Get the storageAccounts property: The list of storage accounts to which the VMs in the primary cloud can + * replicate to. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storageAccounts property: The list of storage accounts to which the VMs in the primary cloud can + * replicate to. + * + * @param storageAccounts the storageAccounts value to set. + * @return the HyperVReplicaAzurePolicyInput object itself. + */ + public HyperVReplicaAzurePolicyInput withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureReplicationDetails.java new file mode 100644 index 000000000000..e6fd3ddb9114 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureReplicationDetails.java @@ -0,0 +1,913 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +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; +import java.util.Map; + +/** Hyper V Replica Azure provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * Azure VM Disk details. + */ + @JsonProperty(value = "azureVmDiskDetails") + private List azureVmDiskDetails; + + /* + * Recovery Azure given name. + */ + @JsonProperty(value = "recoveryAzureVmName") + private String recoveryAzureVmName; + + /* + * The Recovery Azure VM size. + */ + @JsonProperty(value = "recoveryAzureVMSize") + private String recoveryAzureVMSize; + + /* + * The recovery Azure storage account. + */ + @JsonProperty(value = "recoveryAzureStorageAccount") + private String recoveryAzureStorageAccount; + + /* + * The ARM id of the log storage account used for replication. This will be set to null if no log storage account + * was provided during enable protection. + */ + @JsonProperty(value = "recoveryAzureLogStorageAccountId") + private String recoveryAzureLogStorageAccountId; + + /* + * The Last replication time. + */ + @JsonProperty(value = "lastReplicatedTime") + private OffsetDateTime lastReplicatedTime; + + /* + * Last RPO value. + */ + @JsonProperty(value = "rpoInSeconds") + private Long rpoInSeconds; + + /* + * The last RPO calculated time. + */ + @JsonProperty(value = "lastRpoCalculatedTime") + private OffsetDateTime lastRpoCalculatedTime; + + /* + * The virtual machine Id. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * The protection state for the vm. + */ + @JsonProperty(value = "vmProtectionState") + private String vmProtectionState; + + /* + * The protection state description for the vm. + */ + @JsonProperty(value = "vmProtectionStateDescription") + private String vmProtectionStateDescription; + + /* + * Initial replication details. + */ + @JsonProperty(value = "initialReplicationDetails") + private InitialReplicationDetails initialReplicationDetails; + + /* + * The PE Network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The selected recovery azure network Id. + */ + @JsonProperty(value = "selectedRecoveryAzureNetworkId") + private String selectedRecoveryAzureNetworkId; + + /* + * The selected source nic Id which will be used as the primary nic during failover. + */ + @JsonProperty(value = "selectedSourceNicId") + private String selectedSourceNicId; + + /* + * The encryption info. + */ + @JsonProperty(value = "encryption") + private String encryption; + + /* + * The operating system info. + */ + @JsonProperty(value = "oSDetails") + private OSDetails oSDetails; + + /* + * The RAM size of the VM on the primary side. + */ + @JsonProperty(value = "sourceVmRamSizeInMB") + private Integer sourceVmRamSizeInMB; + + /* + * The CPU count of the VM on the primary side. + */ + @JsonProperty(value = "sourceVmCpuCount") + private Integer sourceVmCpuCount; + + /* + * The selected option to enable RDP\SSH on target vm after failover. String value of + * SrsDataContract.EnableRDPOnTargetOption enum. + */ + @JsonProperty(value = "enableRdpOnTargetOption") + private String enableRdpOnTargetOption; + + /* + * The target resource group Id. + */ + @JsonProperty(value = "recoveryAzureResourceGroupId") + private String recoveryAzureResourceGroupId; + + /* + * The recovery availability set Id. + */ + @JsonProperty(value = "recoveryAvailabilitySetId") + private String recoveryAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * A value indicating whether managed disks should be used during failover. + */ + @JsonProperty(value = "useManagedDisks") + private String useManagedDisks; + + /* + * License Type of the VM to be used. + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private String sqlServerLicenseType; + + /* + * The last recovery point received time. + */ + @JsonProperty(value = "lastRecoveryPointReceived", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastRecoveryPointReceived; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The tags for the seed managed disks. + */ + @JsonProperty(value = "seedManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map seedManagedDiskTags; + + /* + * The tags for the target managed disks. + */ + @JsonProperty(value = "targetManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetManagedDiskTags; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /* + * The list of protected managed disks. + */ + @JsonProperty(value = "protectedManagedDisks") + private List protectedManagedDisks; + + /** Creates an instance of HyperVReplicaAzureReplicationDetails class. */ + public HyperVReplicaAzureReplicationDetails() { + } + + /** + * Get the azureVmDiskDetails property: Azure VM Disk details. + * + * @return the azureVmDiskDetails value. + */ + public List azureVmDiskDetails() { + return this.azureVmDiskDetails; + } + + /** + * Set the azureVmDiskDetails property: Azure VM Disk details. + * + * @param azureVmDiskDetails the azureVmDiskDetails value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withAzureVmDiskDetails(List azureVmDiskDetails) { + this.azureVmDiskDetails = azureVmDiskDetails; + return this; + } + + /** + * Get the recoveryAzureVmName property: Recovery Azure given name. + * + * @return the recoveryAzureVmName value. + */ + public String recoveryAzureVmName() { + return this.recoveryAzureVmName; + } + + /** + * Set the recoveryAzureVmName property: Recovery Azure given name. + * + * @param recoveryAzureVmName the recoveryAzureVmName value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withRecoveryAzureVmName(String recoveryAzureVmName) { + this.recoveryAzureVmName = recoveryAzureVmName; + return this; + } + + /** + * Get the recoveryAzureVMSize property: The Recovery Azure VM size. + * + * @return the recoveryAzureVMSize value. + */ + public String recoveryAzureVMSize() { + return this.recoveryAzureVMSize; + } + + /** + * Set the recoveryAzureVMSize property: The Recovery Azure VM size. + * + * @param recoveryAzureVMSize the recoveryAzureVMSize value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withRecoveryAzureVMSize(String recoveryAzureVMSize) { + this.recoveryAzureVMSize = recoveryAzureVMSize; + return this; + } + + /** + * Get the recoveryAzureStorageAccount property: The recovery Azure storage account. + * + * @return the recoveryAzureStorageAccount value. + */ + public String recoveryAzureStorageAccount() { + return this.recoveryAzureStorageAccount; + } + + /** + * Set the recoveryAzureStorageAccount property: The recovery Azure storage account. + * + * @param recoveryAzureStorageAccount the recoveryAzureStorageAccount value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withRecoveryAzureStorageAccount(String recoveryAzureStorageAccount) { + this.recoveryAzureStorageAccount = recoveryAzureStorageAccount; + return this; + } + + /** + * Get the recoveryAzureLogStorageAccountId property: The ARM id of the log storage account used for replication. + * This will be set to null if no log storage account was provided during enable protection. + * + * @return the recoveryAzureLogStorageAccountId value. + */ + public String recoveryAzureLogStorageAccountId() { + return this.recoveryAzureLogStorageAccountId; + } + + /** + * Set the recoveryAzureLogStorageAccountId property: The ARM id of the log storage account used for replication. + * This will be set to null if no log storage account was provided during enable protection. + * + * @param recoveryAzureLogStorageAccountId the recoveryAzureLogStorageAccountId value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withRecoveryAzureLogStorageAccountId( + String recoveryAzureLogStorageAccountId) { + this.recoveryAzureLogStorageAccountId = recoveryAzureLogStorageAccountId; + return this; + } + + /** + * Get the lastReplicatedTime property: The Last replication time. + * + * @return the lastReplicatedTime value. + */ + public OffsetDateTime lastReplicatedTime() { + return this.lastReplicatedTime; + } + + /** + * Set the lastReplicatedTime property: The Last replication time. + * + * @param lastReplicatedTime the lastReplicatedTime value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withLastReplicatedTime(OffsetDateTime lastReplicatedTime) { + this.lastReplicatedTime = lastReplicatedTime; + return this; + } + + /** + * Get the rpoInSeconds property: Last RPO value. + * + * @return the rpoInSeconds value. + */ + public Long rpoInSeconds() { + return this.rpoInSeconds; + } + + /** + * Set the rpoInSeconds property: Last RPO value. + * + * @param rpoInSeconds the rpoInSeconds value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withRpoInSeconds(Long rpoInSeconds) { + this.rpoInSeconds = rpoInSeconds; + return this; + } + + /** + * Get the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @return the lastRpoCalculatedTime value. + */ + public OffsetDateTime lastRpoCalculatedTime() { + return this.lastRpoCalculatedTime; + } + + /** + * Set the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @param lastRpoCalculatedTime the lastRpoCalculatedTime value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withLastRpoCalculatedTime(OffsetDateTime lastRpoCalculatedTime) { + this.lastRpoCalculatedTime = lastRpoCalculatedTime; + return this; + } + + /** + * Get the vmId property: The virtual machine Id. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: The virtual machine Id. + * + * @param vmId the vmId value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the vmProtectionState property: The protection state for the vm. + * + * @return the vmProtectionState value. + */ + public String vmProtectionState() { + return this.vmProtectionState; + } + + /** + * Set the vmProtectionState property: The protection state for the vm. + * + * @param vmProtectionState the vmProtectionState value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withVmProtectionState(String vmProtectionState) { + this.vmProtectionState = vmProtectionState; + return this; + } + + /** + * Get the vmProtectionStateDescription property: The protection state description for the vm. + * + * @return the vmProtectionStateDescription value. + */ + public String vmProtectionStateDescription() { + return this.vmProtectionStateDescription; + } + + /** + * Set the vmProtectionStateDescription property: The protection state description for the vm. + * + * @param vmProtectionStateDescription the vmProtectionStateDescription value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withVmProtectionStateDescription(String vmProtectionStateDescription) { + this.vmProtectionStateDescription = vmProtectionStateDescription; + return this; + } + + /** + * Get the initialReplicationDetails property: Initial replication details. + * + * @return the initialReplicationDetails value. + */ + public InitialReplicationDetails initialReplicationDetails() { + return this.initialReplicationDetails; + } + + /** + * Set the initialReplicationDetails property: Initial replication details. + * + * @param initialReplicationDetails the initialReplicationDetails value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withInitialReplicationDetails( + InitialReplicationDetails initialReplicationDetails) { + this.initialReplicationDetails = initialReplicationDetails; + return this; + } + + /** + * Get the vmNics property: The PE Network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The PE Network details. + * + * @param vmNics the vmNics value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the selectedRecoveryAzureNetworkId property: The selected recovery azure network Id. + * + * @return the selectedRecoveryAzureNetworkId value. + */ + public String selectedRecoveryAzureNetworkId() { + return this.selectedRecoveryAzureNetworkId; + } + + /** + * Set the selectedRecoveryAzureNetworkId property: The selected recovery azure network Id. + * + * @param selectedRecoveryAzureNetworkId the selectedRecoveryAzureNetworkId value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withSelectedRecoveryAzureNetworkId( + String selectedRecoveryAzureNetworkId) { + this.selectedRecoveryAzureNetworkId = selectedRecoveryAzureNetworkId; + return this; + } + + /** + * Get the selectedSourceNicId property: The selected source nic Id which will be used as the primary nic during + * failover. + * + * @return the selectedSourceNicId value. + */ + public String selectedSourceNicId() { + return this.selectedSourceNicId; + } + + /** + * Set the selectedSourceNicId property: The selected source nic Id which will be used as the primary nic during + * failover. + * + * @param selectedSourceNicId the selectedSourceNicId value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withSelectedSourceNicId(String selectedSourceNicId) { + this.selectedSourceNicId = selectedSourceNicId; + return this; + } + + /** + * Get the encryption property: The encryption info. + * + * @return the encryption value. + */ + public String encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption info. + * + * @param encryption the encryption value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withEncryption(String encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the oSDetails property: The operating system info. + * + * @return the oSDetails value. + */ + public OSDetails oSDetails() { + return this.oSDetails; + } + + /** + * Set the oSDetails property: The operating system info. + * + * @param oSDetails the oSDetails value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withOSDetails(OSDetails oSDetails) { + this.oSDetails = oSDetails; + return this; + } + + /** + * Get the sourceVmRamSizeInMB property: The RAM size of the VM on the primary side. + * + * @return the sourceVmRamSizeInMB value. + */ + public Integer sourceVmRamSizeInMB() { + return this.sourceVmRamSizeInMB; + } + + /** + * Set the sourceVmRamSizeInMB property: The RAM size of the VM on the primary side. + * + * @param sourceVmRamSizeInMB the sourceVmRamSizeInMB value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withSourceVmRamSizeInMB(Integer sourceVmRamSizeInMB) { + this.sourceVmRamSizeInMB = sourceVmRamSizeInMB; + return this; + } + + /** + * Get the sourceVmCpuCount property: The CPU count of the VM on the primary side. + * + * @return the sourceVmCpuCount value. + */ + public Integer sourceVmCpuCount() { + return this.sourceVmCpuCount; + } + + /** + * Set the sourceVmCpuCount property: The CPU count of the VM on the primary side. + * + * @param sourceVmCpuCount the sourceVmCpuCount value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withSourceVmCpuCount(Integer sourceVmCpuCount) { + this.sourceVmCpuCount = sourceVmCpuCount; + return this; + } + + /** + * Get the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target vm after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @return the enableRdpOnTargetOption value. + */ + public String enableRdpOnTargetOption() { + return this.enableRdpOnTargetOption; + } + + /** + * Set the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target vm after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @param enableRdpOnTargetOption the enableRdpOnTargetOption value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withEnableRdpOnTargetOption(String enableRdpOnTargetOption) { + this.enableRdpOnTargetOption = enableRdpOnTargetOption; + return this; + } + + /** + * Get the recoveryAzureResourceGroupId property: The target resource group Id. + * + * @return the recoveryAzureResourceGroupId value. + */ + public String recoveryAzureResourceGroupId() { + return this.recoveryAzureResourceGroupId; + } + + /** + * Set the recoveryAzureResourceGroupId property: The target resource group Id. + * + * @param recoveryAzureResourceGroupId the recoveryAzureResourceGroupId value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withRecoveryAzureResourceGroupId(String recoveryAzureResourceGroupId) { + this.recoveryAzureResourceGroupId = recoveryAzureResourceGroupId; + return this; + } + + /** + * Get the recoveryAvailabilitySetId property: The recovery availability set Id. + * + * @return the recoveryAvailabilitySetId value. + */ + public String recoveryAvailabilitySetId() { + return this.recoveryAvailabilitySetId; + } + + /** + * Set the recoveryAvailabilitySetId property: The recovery availability set Id. + * + * @param recoveryAvailabilitySetId the recoveryAvailabilitySetId value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withRecoveryAvailabilitySetId(String recoveryAvailabilitySetId) { + this.recoveryAvailabilitySetId = recoveryAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withTargetProximityPlacementGroupId( + String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @return the useManagedDisks value. + */ + public String useManagedDisks() { + return this.useManagedDisks; + } + + /** + * Set the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @param useManagedDisks the useManagedDisks value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withUseManagedDisks(String useManagedDisks) { + this.useManagedDisks = useManagedDisks; + return this; + } + + /** + * Get the licenseType property: License Type of the VM to be used. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: License Type of the VM to be used. + * + * @param licenseType the licenseType value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public String sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withSqlServerLicenseType(String sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the lastRecoveryPointReceived property: The last recovery point received time. + * + * @return the lastRecoveryPointReceived value. + */ + public OffsetDateTime lastRecoveryPointReceived() { + return this.lastRecoveryPointReceived; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the seedManagedDiskTags property: The tags for the seed managed disks. + * + * @return the seedManagedDiskTags value. + */ + public Map seedManagedDiskTags() { + return this.seedManagedDiskTags; + } + + /** + * Set the seedManagedDiskTags property: The tags for the seed managed disks. + * + * @param seedManagedDiskTags the seedManagedDiskTags value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withSeedManagedDiskTags(Map seedManagedDiskTags) { + this.seedManagedDiskTags = seedManagedDiskTags; + return this; + } + + /** + * Get the targetManagedDiskTags property: The tags for the target managed disks. + * + * @return the targetManagedDiskTags value. + */ + public Map targetManagedDiskTags() { + return this.targetManagedDiskTags; + } + + /** + * Set the targetManagedDiskTags property: The tags for the target managed disks. + * + * @param targetManagedDiskTags the targetManagedDiskTags value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withTargetManagedDiskTags(Map targetManagedDiskTags) { + this.targetManagedDiskTags = targetManagedDiskTags; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Get the protectedManagedDisks property: The list of protected managed disks. + * + * @return the protectedManagedDisks value. + */ + public List protectedManagedDisks() { + return this.protectedManagedDisks; + } + + /** + * Set the protectedManagedDisks property: The list of protected managed disks. + * + * @param protectedManagedDisks the protectedManagedDisks value to set. + * @return the HyperVReplicaAzureReplicationDetails object itself. + */ + public HyperVReplicaAzureReplicationDetails withProtectedManagedDisks( + List protectedManagedDisks) { + this.protectedManagedDisks = protectedManagedDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (azureVmDiskDetails() != null) { + azureVmDiskDetails().forEach(e -> e.validate()); + } + if (initialReplicationDetails() != null) { + initialReplicationDetails().validate(); + } + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (oSDetails() != null) { + oSDetails().validate(); + } + if (protectedManagedDisks() != null) { + protectedManagedDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureReprotectInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureReprotectInput.java new file mode 100644 index 000000000000..37d4588d465e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureReprotectInput.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Azure specific reprotect input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureReprotectInput extends ReverseReplicationProviderSpecificInput { + /* + * The Hyper-V host Vm Id. + */ + @JsonProperty(value = "hvHostVmId") + private String hvHostVmId; + + /* + * The Vm Name. + */ + @JsonProperty(value = "vmName") + private String vmName; + + /* + * The OS type associated with vm. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The OS disk VHD id associated with vm. + */ + @JsonProperty(value = "vHDId") + private String vHDId; + + /* + * The storage account name. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * The storage account to be used for logging during replication. + */ + @JsonProperty(value = "logStorageAccountId") + private String logStorageAccountId; + + /** Creates an instance of HyperVReplicaAzureReprotectInput class. */ + public HyperVReplicaAzureReprotectInput() { + } + + /** + * Get the hvHostVmId property: The Hyper-V host Vm Id. + * + * @return the hvHostVmId value. + */ + public String hvHostVmId() { + return this.hvHostVmId; + } + + /** + * Set the hvHostVmId property: The Hyper-V host Vm Id. + * + * @param hvHostVmId the hvHostVmId value to set. + * @return the HyperVReplicaAzureReprotectInput object itself. + */ + public HyperVReplicaAzureReprotectInput withHvHostVmId(String hvHostVmId) { + this.hvHostVmId = hvHostVmId; + return this; + } + + /** + * Get the vmName property: The Vm Name. + * + * @return the vmName value. + */ + public String vmName() { + return this.vmName; + } + + /** + * Set the vmName property: The Vm Name. + * + * @param vmName the vmName value to set. + * @return the HyperVReplicaAzureReprotectInput object itself. + */ + public HyperVReplicaAzureReprotectInput withVmName(String vmName) { + this.vmName = vmName; + return this; + } + + /** + * Get the osType property: The OS type associated with vm. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type associated with vm. + * + * @param osType the osType value to set. + * @return the HyperVReplicaAzureReprotectInput object itself. + */ + public HyperVReplicaAzureReprotectInput withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the vHDId property: The OS disk VHD id associated with vm. + * + * @return the vHDId value. + */ + public String vHDId() { + return this.vHDId; + } + + /** + * Set the vHDId property: The OS disk VHD id associated with vm. + * + * @param vHDId the vHDId value to set. + * @return the HyperVReplicaAzureReprotectInput object itself. + */ + public HyperVReplicaAzureReprotectInput withVHDId(String vHDId) { + this.vHDId = vHDId; + return this; + } + + /** + * Get the storageAccountId property: The storage account name. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The storage account name. + * + * @param storageAccountId the storageAccountId value to set. + * @return the HyperVReplicaAzureReprotectInput object itself. + */ + public HyperVReplicaAzureReprotectInput withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the logStorageAccountId property: The storage account to be used for logging during replication. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The storage account to be used for logging during replication. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the HyperVReplicaAzureReprotectInput object itself. + */ + public HyperVReplicaAzureReprotectInput withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureRpRecoveryPointType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureRpRecoveryPointType.java new file mode 100644 index 000000000000..54dac66354e0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureRpRecoveryPointType.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recovery point type. */ +public final class HyperVReplicaAzureRpRecoveryPointType + extends ExpandableStringEnum { + /** Static value Latest for HyperVReplicaAzureRpRecoveryPointType. */ + public static final HyperVReplicaAzureRpRecoveryPointType LATEST = fromString("Latest"); + + /** Static value LatestApplicationConsistent for HyperVReplicaAzureRpRecoveryPointType. */ + public static final HyperVReplicaAzureRpRecoveryPointType LATEST_APPLICATION_CONSISTENT = + fromString("LatestApplicationConsistent"); + + /** Static value LatestProcessed for HyperVReplicaAzureRpRecoveryPointType. */ + public static final HyperVReplicaAzureRpRecoveryPointType LATEST_PROCESSED = fromString("LatestProcessed"); + + /** + * Creates or finds a HyperVReplicaAzureRpRecoveryPointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HyperVReplicaAzureRpRecoveryPointType. + */ + @JsonCreator + public static HyperVReplicaAzureRpRecoveryPointType fromString(String name) { + return fromString(name, HyperVReplicaAzureRpRecoveryPointType.class); + } + + /** + * Gets known HyperVReplicaAzureRpRecoveryPointType values. + * + * @return known HyperVReplicaAzureRpRecoveryPointType values. + */ + public static Collection values() { + return values(HyperVReplicaAzureRpRecoveryPointType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureTestFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureTestFailoverInput.java new file mode 100644 index 000000000000..2deee826fb5d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureTestFailoverInput.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** HvrA provider specific input for test failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureTestFailoverInput extends TestFailoverProviderSpecificInput { + /* + * Primary kek certificate pfx. + */ + @JsonProperty(value = "primaryKekCertificatePfx") + private String primaryKekCertificatePfx; + + /* + * Secondary kek certificate pfx. + */ + @JsonProperty(value = "secondaryKekCertificatePfx") + private String secondaryKekCertificatePfx; + + /* + * The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery + * point, null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** Creates an instance of HyperVReplicaAzureTestFailoverInput class. */ + public HyperVReplicaAzureTestFailoverInput() { + } + + /** + * Get the primaryKekCertificatePfx property: Primary kek certificate pfx. + * + * @return the primaryKekCertificatePfx value. + */ + public String primaryKekCertificatePfx() { + return this.primaryKekCertificatePfx; + } + + /** + * Set the primaryKekCertificatePfx property: Primary kek certificate pfx. + * + * @param primaryKekCertificatePfx the primaryKekCertificatePfx value to set. + * @return the HyperVReplicaAzureTestFailoverInput object itself. + */ + public HyperVReplicaAzureTestFailoverInput withPrimaryKekCertificatePfx(String primaryKekCertificatePfx) { + this.primaryKekCertificatePfx = primaryKekCertificatePfx; + return this; + } + + /** + * Get the secondaryKekCertificatePfx property: Secondary kek certificate pfx. + * + * @return the secondaryKekCertificatePfx value. + */ + public String secondaryKekCertificatePfx() { + return this.secondaryKekCertificatePfx; + } + + /** + * Set the secondaryKekCertificatePfx property: Secondary kek certificate pfx. + * + * @param secondaryKekCertificatePfx the secondaryKekCertificatePfx value to set. + * @return the HyperVReplicaAzureTestFailoverInput object itself. + */ + public HyperVReplicaAzureTestFailoverInput withSecondaryKekCertificatePfx(String secondaryKekCertificatePfx) { + this.secondaryKekCertificatePfx = secondaryKekCertificatePfx; + return this; + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the HyperVReplicaAzureTestFailoverInput object itself. + */ + public HyperVReplicaAzureTestFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUnplannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUnplannedFailoverInput.java new file mode 100644 index 000000000000..e76601a34413 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUnplannedFailoverInput.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** HvrA provider specific input for unplanned failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureUnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { + /* + * Primary kek certificate pfx. + */ + @JsonProperty(value = "primaryKekCertificatePfx") + private String primaryKekCertificatePfx; + + /* + * Secondary kek certificate pfx. + */ + @JsonProperty(value = "secondaryKekCertificatePfx") + private String secondaryKekCertificatePfx; + + /* + * The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, + * null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** Creates an instance of HyperVReplicaAzureUnplannedFailoverInput class. */ + public HyperVReplicaAzureUnplannedFailoverInput() { + } + + /** + * Get the primaryKekCertificatePfx property: Primary kek certificate pfx. + * + * @return the primaryKekCertificatePfx value. + */ + public String primaryKekCertificatePfx() { + return this.primaryKekCertificatePfx; + } + + /** + * Set the primaryKekCertificatePfx property: Primary kek certificate pfx. + * + * @param primaryKekCertificatePfx the primaryKekCertificatePfx value to set. + * @return the HyperVReplicaAzureUnplannedFailoverInput object itself. + */ + public HyperVReplicaAzureUnplannedFailoverInput withPrimaryKekCertificatePfx(String primaryKekCertificatePfx) { + this.primaryKekCertificatePfx = primaryKekCertificatePfx; + return this; + } + + /** + * Get the secondaryKekCertificatePfx property: Secondary kek certificate pfx. + * + * @return the secondaryKekCertificatePfx value. + */ + public String secondaryKekCertificatePfx() { + return this.secondaryKekCertificatePfx; + } + + /** + * Set the secondaryKekCertificatePfx property: Secondary kek certificate pfx. + * + * @param secondaryKekCertificatePfx the secondaryKekCertificatePfx value to set. + * @return the HyperVReplicaAzureUnplannedFailoverInput object itself. + */ + public HyperVReplicaAzureUnplannedFailoverInput withSecondaryKekCertificatePfx(String secondaryKekCertificatePfx) { + this.secondaryKekCertificatePfx = secondaryKekCertificatePfx; + return this; + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the HyperVReplicaAzureUnplannedFailoverInput object itself. + */ + public HyperVReplicaAzureUnplannedFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java new file mode 100644 index 000000000000..fa2666567e61 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** HyperV replica Azure input to update replication protected item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureUpdateReplicationProtectedItemInput + extends UpdateReplicationProtectedItemProviderInput { + /* + * The recovery Azure resource group Id for classic deployment. + */ + @JsonProperty(value = "recoveryAzureV1ResourceGroupId") + private String recoveryAzureV1ResourceGroupId; + + /* + * The recovery Azure resource group Id for resource manager deployment. + */ + @JsonProperty(value = "recoveryAzureV2ResourceGroupId") + private String recoveryAzureV2ResourceGroupId; + + /* + * A value indicating whether managed disks should be used during failover. + */ + @JsonProperty(value = "useManagedDisks") + private String useManagedDisks; + + /* + * The dictionary of disk resource Id to disk encryption set ARM Id. + */ + @JsonProperty(value = "diskIdToDiskEncryptionMap") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map diskIdToDiskEncryptionMap; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The tags for the target managed disks. + */ + @JsonProperty(value = "targetManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetManagedDiskTags; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private SqlServerLicenseType sqlServerLicenseType; + + /* + * The list of disk update properties. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /** Creates an instance of HyperVReplicaAzureUpdateReplicationProtectedItemInput class. */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput() { + } + + /** + * Get the recoveryAzureV1ResourceGroupId property: The recovery Azure resource group Id for classic deployment. + * + * @return the recoveryAzureV1ResourceGroupId value. + */ + public String recoveryAzureV1ResourceGroupId() { + return this.recoveryAzureV1ResourceGroupId; + } + + /** + * Set the recoveryAzureV1ResourceGroupId property: The recovery Azure resource group Id for classic deployment. + * + * @param recoveryAzureV1ResourceGroupId the recoveryAzureV1ResourceGroupId value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withRecoveryAzureV1ResourceGroupId( + String recoveryAzureV1ResourceGroupId) { + this.recoveryAzureV1ResourceGroupId = recoveryAzureV1ResourceGroupId; + return this; + } + + /** + * Get the recoveryAzureV2ResourceGroupId property: The recovery Azure resource group Id for resource manager + * deployment. + * + * @return the recoveryAzureV2ResourceGroupId value. + */ + public String recoveryAzureV2ResourceGroupId() { + return this.recoveryAzureV2ResourceGroupId; + } + + /** + * Set the recoveryAzureV2ResourceGroupId property: The recovery Azure resource group Id for resource manager + * deployment. + * + * @param recoveryAzureV2ResourceGroupId the recoveryAzureV2ResourceGroupId value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withRecoveryAzureV2ResourceGroupId( + String recoveryAzureV2ResourceGroupId) { + this.recoveryAzureV2ResourceGroupId = recoveryAzureV2ResourceGroupId; + return this; + } + + /** + * Get the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @return the useManagedDisks value. + */ + public String useManagedDisks() { + return this.useManagedDisks; + } + + /** + * Set the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @param useManagedDisks the useManagedDisks value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withUseManagedDisks(String useManagedDisks) { + this.useManagedDisks = useManagedDisks; + return this; + } + + /** + * Get the diskIdToDiskEncryptionMap property: The dictionary of disk resource Id to disk encryption set ARM Id. + * + * @return the diskIdToDiskEncryptionMap value. + */ + public Map diskIdToDiskEncryptionMap() { + return this.diskIdToDiskEncryptionMap; + } + + /** + * Set the diskIdToDiskEncryptionMap property: The dictionary of disk resource Id to disk encryption set ARM Id. + * + * @param diskIdToDiskEncryptionMap the diskIdToDiskEncryptionMap value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withDiskIdToDiskEncryptionMap( + Map diskIdToDiskEncryptionMap) { + this.diskIdToDiskEncryptionMap = diskIdToDiskEncryptionMap; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withTargetProximityPlacementGroupId( + String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withTargetAvailabilityZone( + String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the targetManagedDiskTags property: The tags for the target managed disks. + * + * @return the targetManagedDiskTags value. + */ + public Map targetManagedDiskTags() { + return this.targetManagedDiskTags; + } + + /** + * Set the targetManagedDiskTags property: The tags for the target managed disks. + * + * @param targetManagedDiskTags the targetManagedDiskTags value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withTargetManagedDiskTags( + Map targetManagedDiskTags) { + this.targetManagedDiskTags = targetManagedDiskTags; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public SqlServerLicenseType sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withSqlServerLicenseType( + SqlServerLicenseType sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the vmDisks property: The list of disk update properties. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of disk update properties. + * + * @param vmDisks the vmDisks value to set. + * @return the HyperVReplicaAzureUpdateReplicationProtectedItemInput object itself. + */ + public HyperVReplicaAzureUpdateReplicationProtectedItemInput withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBaseEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBaseEventDetails.java new file mode 100644 index 000000000000..9fa7eae71983 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBaseEventDetails.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Abstract model class for event details of a HyperVReplica E2E event. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaBaseEventDetails") +@Fluent +public final class HyperVReplicaBaseEventDetails extends EventProviderSpecificDetails { + /* + * The container friendly name. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * The fabric friendly name. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /* + * The remote container name. + */ + @JsonProperty(value = "remoteContainerName") + private String remoteContainerName; + + /* + * The remote fabric name. + */ + @JsonProperty(value = "remoteFabricName") + private String remoteFabricName; + + /** Creates an instance of HyperVReplicaBaseEventDetails class. */ + public HyperVReplicaBaseEventDetails() { + } + + /** + * Get the containerName property: The container friendly name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The container friendly name. + * + * @param containerName the containerName value to set. + * @return the HyperVReplicaBaseEventDetails object itself. + */ + public HyperVReplicaBaseEventDetails withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the fabricName property: The fabric friendly name. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set the fabricName property: The fabric friendly name. + * + * @param fabricName the fabricName value to set. + * @return the HyperVReplicaBaseEventDetails object itself. + */ + public HyperVReplicaBaseEventDetails withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get the remoteContainerName property: The remote container name. + * + * @return the remoteContainerName value. + */ + public String remoteContainerName() { + return this.remoteContainerName; + } + + /** + * Set the remoteContainerName property: The remote container name. + * + * @param remoteContainerName the remoteContainerName value to set. + * @return the HyperVReplicaBaseEventDetails object itself. + */ + public HyperVReplicaBaseEventDetails withRemoteContainerName(String remoteContainerName) { + this.remoteContainerName = remoteContainerName; + return this; + } + + /** + * Get the remoteFabricName property: The remote fabric name. + * + * @return the remoteFabricName value. + */ + public String remoteFabricName() { + return this.remoteFabricName; + } + + /** + * Set the remoteFabricName property: The remote fabric name. + * + * @param remoteFabricName the remoteFabricName value to set. + * @return the HyperVReplicaBaseEventDetails object itself. + */ + public HyperVReplicaBaseEventDetails withRemoteFabricName(String remoteFabricName) { + this.remoteFabricName = remoteFabricName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBasePolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBasePolicyDetails.java new file mode 100644 index 000000000000..ac11e2ad7b5e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBasePolicyDetails.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Base class for HyperVReplica policy details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaBasePolicyDetails") +@Fluent +public final class HyperVReplicaBasePolicyDetails extends PolicyProviderSpecificDetails { + /* + * A value indicating the number of recovery points. + */ + @JsonProperty(value = "recoveryPoints") + private Integer recoveryPoints; + + /* + * A value indicating the application consistent frequency. + */ + @JsonProperty(value = "applicationConsistentSnapshotFrequencyInHours") + private Integer applicationConsistentSnapshotFrequencyInHours; + + /* + * A value indicating whether compression has to be enabled. + */ + @JsonProperty(value = "compression") + private String compression; + + /* + * A value indicating whether IR is online. + */ + @JsonProperty(value = "initialReplicationMethod") + private String initialReplicationMethod; + + /* + * A value indicating the online IR start time. + */ + @JsonProperty(value = "onlineReplicationStartTime") + private String onlineReplicationStartTime; + + /* + * A value indicating the offline IR import path. + */ + @JsonProperty(value = "offlineReplicationImportPath") + private String offlineReplicationImportPath; + + /* + * A value indicating the offline IR export path. + */ + @JsonProperty(value = "offlineReplicationExportPath") + private String offlineReplicationExportPath; + + /* + * A value indicating the recovery HTTPS port. + */ + @JsonProperty(value = "replicationPort") + private Integer replicationPort; + + /* + * A value indicating the authentication type. + */ + @JsonProperty(value = "allowedAuthenticationType") + private Integer allowedAuthenticationType; + + /* + * A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. + */ + @JsonProperty(value = "replicaDeletionOption") + private String replicaDeletionOption; + + /** Creates an instance of HyperVReplicaBasePolicyDetails class. */ + public HyperVReplicaBasePolicyDetails() { + } + + /** + * Get the recoveryPoints property: A value indicating the number of recovery points. + * + * @return the recoveryPoints value. + */ + public Integer recoveryPoints() { + return this.recoveryPoints; + } + + /** + * Set the recoveryPoints property: A value indicating the number of recovery points. + * + * @param recoveryPoints the recoveryPoints value to set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withRecoveryPoints(Integer recoveryPoints) { + this.recoveryPoints = recoveryPoints; + return this; + } + + /** + * Get the applicationConsistentSnapshotFrequencyInHours property: A value indicating the application consistent + * frequency. + * + * @return the applicationConsistentSnapshotFrequencyInHours value. + */ + public Integer applicationConsistentSnapshotFrequencyInHours() { + return this.applicationConsistentSnapshotFrequencyInHours; + } + + /** + * Set the applicationConsistentSnapshotFrequencyInHours property: A value indicating the application consistent + * frequency. + * + * @param applicationConsistentSnapshotFrequencyInHours the applicationConsistentSnapshotFrequencyInHours value to + * set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withApplicationConsistentSnapshotFrequencyInHours( + Integer applicationConsistentSnapshotFrequencyInHours) { + this.applicationConsistentSnapshotFrequencyInHours = applicationConsistentSnapshotFrequencyInHours; + return this; + } + + /** + * Get the compression property: A value indicating whether compression has to be enabled. + * + * @return the compression value. + */ + public String compression() { + return this.compression; + } + + /** + * Set the compression property: A value indicating whether compression has to be enabled. + * + * @param compression the compression value to set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withCompression(String compression) { + this.compression = compression; + return this; + } + + /** + * Get the initialReplicationMethod property: A value indicating whether IR is online. + * + * @return the initialReplicationMethod value. + */ + public String initialReplicationMethod() { + return this.initialReplicationMethod; + } + + /** + * Set the initialReplicationMethod property: A value indicating whether IR is online. + * + * @param initialReplicationMethod the initialReplicationMethod value to set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withInitialReplicationMethod(String initialReplicationMethod) { + this.initialReplicationMethod = initialReplicationMethod; + return this; + } + + /** + * Get the onlineReplicationStartTime property: A value indicating the online IR start time. + * + * @return the onlineReplicationStartTime value. + */ + public String onlineReplicationStartTime() { + return this.onlineReplicationStartTime; + } + + /** + * Set the onlineReplicationStartTime property: A value indicating the online IR start time. + * + * @param onlineReplicationStartTime the onlineReplicationStartTime value to set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withOnlineReplicationStartTime(String onlineReplicationStartTime) { + this.onlineReplicationStartTime = onlineReplicationStartTime; + return this; + } + + /** + * Get the offlineReplicationImportPath property: A value indicating the offline IR import path. + * + * @return the offlineReplicationImportPath value. + */ + public String offlineReplicationImportPath() { + return this.offlineReplicationImportPath; + } + + /** + * Set the offlineReplicationImportPath property: A value indicating the offline IR import path. + * + * @param offlineReplicationImportPath the offlineReplicationImportPath value to set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withOfflineReplicationImportPath(String offlineReplicationImportPath) { + this.offlineReplicationImportPath = offlineReplicationImportPath; + return this; + } + + /** + * Get the offlineReplicationExportPath property: A value indicating the offline IR export path. + * + * @return the offlineReplicationExportPath value. + */ + public String offlineReplicationExportPath() { + return this.offlineReplicationExportPath; + } + + /** + * Set the offlineReplicationExportPath property: A value indicating the offline IR export path. + * + * @param offlineReplicationExportPath the offlineReplicationExportPath value to set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withOfflineReplicationExportPath(String offlineReplicationExportPath) { + this.offlineReplicationExportPath = offlineReplicationExportPath; + return this; + } + + /** + * Get the replicationPort property: A value indicating the recovery HTTPS port. + * + * @return the replicationPort value. + */ + public Integer replicationPort() { + return this.replicationPort; + } + + /** + * Set the replicationPort property: A value indicating the recovery HTTPS port. + * + * @param replicationPort the replicationPort value to set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withReplicationPort(Integer replicationPort) { + this.replicationPort = replicationPort; + return this; + } + + /** + * Get the allowedAuthenticationType property: A value indicating the authentication type. + * + * @return the allowedAuthenticationType value. + */ + public Integer allowedAuthenticationType() { + return this.allowedAuthenticationType; + } + + /** + * Set the allowedAuthenticationType property: A value indicating the authentication type. + * + * @param allowedAuthenticationType the allowedAuthenticationType value to set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withAllowedAuthenticationType(Integer allowedAuthenticationType) { + this.allowedAuthenticationType = allowedAuthenticationType; + return this; + } + + /** + * Get the replicaDeletionOption property: A value indicating whether the VM has to be auto deleted. Supported + * Values: String.Empty, None, OnRecoveryCloud. + * + * @return the replicaDeletionOption value. + */ + public String replicaDeletionOption() { + return this.replicaDeletionOption; + } + + /** + * Set the replicaDeletionOption property: A value indicating whether the VM has to be auto deleted. Supported + * Values: String.Empty, None, OnRecoveryCloud. + * + * @param replicaDeletionOption the replicaDeletionOption value to set. + * @return the HyperVReplicaBasePolicyDetails object itself. + */ + public HyperVReplicaBasePolicyDetails withReplicaDeletionOption(String replicaDeletionOption) { + this.replicaDeletionOption = replicaDeletionOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBaseReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBaseReplicationDetails.java new file mode 100644 index 000000000000..1dca5fc1ca79 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBaseReplicationDetails.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.time.OffsetDateTime; +import java.util.List; + +/** Hyper V replica provider specific settings base class. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaBaseReplicationDetails") +@Fluent +public final class HyperVReplicaBaseReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * The Last replication time. + */ + @JsonProperty(value = "lastReplicatedTime") + private OffsetDateTime lastReplicatedTime; + + /* + * The PE Network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The virtual machine Id. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * The protection state for the vm. + */ + @JsonProperty(value = "vmProtectionState") + private String vmProtectionState; + + /* + * The protection state description for the vm. + */ + @JsonProperty(value = "vmProtectionStateDescription") + private String vmProtectionStateDescription; + + /* + * Initial replication details. + */ + @JsonProperty(value = "initialReplicationDetails") + private InitialReplicationDetails initialReplicationDetails; + + /* + * VM disk details. + */ + @JsonProperty(value = "vMDiskDetails") + private List vMDiskDetails; + + /** Creates an instance of HyperVReplicaBaseReplicationDetails class. */ + public HyperVReplicaBaseReplicationDetails() { + } + + /** + * Get the lastReplicatedTime property: The Last replication time. + * + * @return the lastReplicatedTime value. + */ + public OffsetDateTime lastReplicatedTime() { + return this.lastReplicatedTime; + } + + /** + * Set the lastReplicatedTime property: The Last replication time. + * + * @param lastReplicatedTime the lastReplicatedTime value to set. + * @return the HyperVReplicaBaseReplicationDetails object itself. + */ + public HyperVReplicaBaseReplicationDetails withLastReplicatedTime(OffsetDateTime lastReplicatedTime) { + this.lastReplicatedTime = lastReplicatedTime; + return this; + } + + /** + * Get the vmNics property: The PE Network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The PE Network details. + * + * @param vmNics the vmNics value to set. + * @return the HyperVReplicaBaseReplicationDetails object itself. + */ + public HyperVReplicaBaseReplicationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the vmId property: The virtual machine Id. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: The virtual machine Id. + * + * @param vmId the vmId value to set. + * @return the HyperVReplicaBaseReplicationDetails object itself. + */ + public HyperVReplicaBaseReplicationDetails withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the vmProtectionState property: The protection state for the vm. + * + * @return the vmProtectionState value. + */ + public String vmProtectionState() { + return this.vmProtectionState; + } + + /** + * Set the vmProtectionState property: The protection state for the vm. + * + * @param vmProtectionState the vmProtectionState value to set. + * @return the HyperVReplicaBaseReplicationDetails object itself. + */ + public HyperVReplicaBaseReplicationDetails withVmProtectionState(String vmProtectionState) { + this.vmProtectionState = vmProtectionState; + return this; + } + + /** + * Get the vmProtectionStateDescription property: The protection state description for the vm. + * + * @return the vmProtectionStateDescription value. + */ + public String vmProtectionStateDescription() { + return this.vmProtectionStateDescription; + } + + /** + * Set the vmProtectionStateDescription property: The protection state description for the vm. + * + * @param vmProtectionStateDescription the vmProtectionStateDescription value to set. + * @return the HyperVReplicaBaseReplicationDetails object itself. + */ + public HyperVReplicaBaseReplicationDetails withVmProtectionStateDescription(String vmProtectionStateDescription) { + this.vmProtectionStateDescription = vmProtectionStateDescription; + return this; + } + + /** + * Get the initialReplicationDetails property: Initial replication details. + * + * @return the initialReplicationDetails value. + */ + public InitialReplicationDetails initialReplicationDetails() { + return this.initialReplicationDetails; + } + + /** + * Set the initialReplicationDetails property: Initial replication details. + * + * @param initialReplicationDetails the initialReplicationDetails value to set. + * @return the HyperVReplicaBaseReplicationDetails object itself. + */ + public HyperVReplicaBaseReplicationDetails withInitialReplicationDetails( + InitialReplicationDetails initialReplicationDetails) { + this.initialReplicationDetails = initialReplicationDetails; + return this; + } + + /** + * Get the vMDiskDetails property: VM disk details. + * + * @return the vMDiskDetails value. + */ + public List vMDiskDetails() { + return this.vMDiskDetails; + } + + /** + * Set the vMDiskDetails property: VM disk details. + * + * @param vMDiskDetails the vMDiskDetails value to set. + * @return the HyperVReplicaBaseReplicationDetails object itself. + */ + public HyperVReplicaBaseReplicationDetails withVMDiskDetails(List vMDiskDetails) { + this.vMDiskDetails = vMDiskDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (initialReplicationDetails() != null) { + initialReplicationDetails().validate(); + } + if (vMDiskDetails() != null) { + vMDiskDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyDetails.java new file mode 100644 index 000000000000..d143df1eff4f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyDetails.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Hyper-V Replica Blue specific protection profile details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplica2012R2") +@Fluent +public final class HyperVReplicaBluePolicyDetails extends PolicyProviderSpecificDetails { + /* + * A value indicating the replication interval. + */ + @JsonProperty(value = "replicationFrequencyInSeconds") + private Integer replicationFrequencyInSeconds; + + /* + * A value indicating the number of recovery points. + */ + @JsonProperty(value = "recoveryPoints") + private Integer recoveryPoints; + + /* + * A value indicating the application consistent frequency. + */ + @JsonProperty(value = "applicationConsistentSnapshotFrequencyInHours") + private Integer applicationConsistentSnapshotFrequencyInHours; + + /* + * A value indicating whether compression has to be enabled. + */ + @JsonProperty(value = "compression") + private String compression; + + /* + * A value indicating whether IR is online. + */ + @JsonProperty(value = "initialReplicationMethod") + private String initialReplicationMethod; + + /* + * A value indicating the online IR start time. + */ + @JsonProperty(value = "onlineReplicationStartTime") + private String onlineReplicationStartTime; + + /* + * A value indicating the offline IR import path. + */ + @JsonProperty(value = "offlineReplicationImportPath") + private String offlineReplicationImportPath; + + /* + * A value indicating the offline IR export path. + */ + @JsonProperty(value = "offlineReplicationExportPath") + private String offlineReplicationExportPath; + + /* + * A value indicating the recovery HTTPS port. + */ + @JsonProperty(value = "replicationPort") + private Integer replicationPort; + + /* + * A value indicating the authentication type. + */ + @JsonProperty(value = "allowedAuthenticationType") + private Integer allowedAuthenticationType; + + /* + * A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + */ + @JsonProperty(value = "replicaDeletionOption") + private String replicaDeletionOption; + + /** Creates an instance of HyperVReplicaBluePolicyDetails class. */ + public HyperVReplicaBluePolicyDetails() { + } + + /** + * Get the replicationFrequencyInSeconds property: A value indicating the replication interval. + * + * @return the replicationFrequencyInSeconds value. + */ + public Integer replicationFrequencyInSeconds() { + return this.replicationFrequencyInSeconds; + } + + /** + * Set the replicationFrequencyInSeconds property: A value indicating the replication interval. + * + * @param replicationFrequencyInSeconds the replicationFrequencyInSeconds value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withReplicationFrequencyInSeconds(Integer replicationFrequencyInSeconds) { + this.replicationFrequencyInSeconds = replicationFrequencyInSeconds; + return this; + } + + /** + * Get the recoveryPoints property: A value indicating the number of recovery points. + * + * @return the recoveryPoints value. + */ + public Integer recoveryPoints() { + return this.recoveryPoints; + } + + /** + * Set the recoveryPoints property: A value indicating the number of recovery points. + * + * @param recoveryPoints the recoveryPoints value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withRecoveryPoints(Integer recoveryPoints) { + this.recoveryPoints = recoveryPoints; + return this; + } + + /** + * Get the applicationConsistentSnapshotFrequencyInHours property: A value indicating the application consistent + * frequency. + * + * @return the applicationConsistentSnapshotFrequencyInHours value. + */ + public Integer applicationConsistentSnapshotFrequencyInHours() { + return this.applicationConsistentSnapshotFrequencyInHours; + } + + /** + * Set the applicationConsistentSnapshotFrequencyInHours property: A value indicating the application consistent + * frequency. + * + * @param applicationConsistentSnapshotFrequencyInHours the applicationConsistentSnapshotFrequencyInHours value to + * set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withApplicationConsistentSnapshotFrequencyInHours( + Integer applicationConsistentSnapshotFrequencyInHours) { + this.applicationConsistentSnapshotFrequencyInHours = applicationConsistentSnapshotFrequencyInHours; + return this; + } + + /** + * Get the compression property: A value indicating whether compression has to be enabled. + * + * @return the compression value. + */ + public String compression() { + return this.compression; + } + + /** + * Set the compression property: A value indicating whether compression has to be enabled. + * + * @param compression the compression value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withCompression(String compression) { + this.compression = compression; + return this; + } + + /** + * Get the initialReplicationMethod property: A value indicating whether IR is online. + * + * @return the initialReplicationMethod value. + */ + public String initialReplicationMethod() { + return this.initialReplicationMethod; + } + + /** + * Set the initialReplicationMethod property: A value indicating whether IR is online. + * + * @param initialReplicationMethod the initialReplicationMethod value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withInitialReplicationMethod(String initialReplicationMethod) { + this.initialReplicationMethod = initialReplicationMethod; + return this; + } + + /** + * Get the onlineReplicationStartTime property: A value indicating the online IR start time. + * + * @return the onlineReplicationStartTime value. + */ + public String onlineReplicationStartTime() { + return this.onlineReplicationStartTime; + } + + /** + * Set the onlineReplicationStartTime property: A value indicating the online IR start time. + * + * @param onlineReplicationStartTime the onlineReplicationStartTime value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withOnlineReplicationStartTime(String onlineReplicationStartTime) { + this.onlineReplicationStartTime = onlineReplicationStartTime; + return this; + } + + /** + * Get the offlineReplicationImportPath property: A value indicating the offline IR import path. + * + * @return the offlineReplicationImportPath value. + */ + public String offlineReplicationImportPath() { + return this.offlineReplicationImportPath; + } + + /** + * Set the offlineReplicationImportPath property: A value indicating the offline IR import path. + * + * @param offlineReplicationImportPath the offlineReplicationImportPath value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withOfflineReplicationImportPath(String offlineReplicationImportPath) { + this.offlineReplicationImportPath = offlineReplicationImportPath; + return this; + } + + /** + * Get the offlineReplicationExportPath property: A value indicating the offline IR export path. + * + * @return the offlineReplicationExportPath value. + */ + public String offlineReplicationExportPath() { + return this.offlineReplicationExportPath; + } + + /** + * Set the offlineReplicationExportPath property: A value indicating the offline IR export path. + * + * @param offlineReplicationExportPath the offlineReplicationExportPath value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withOfflineReplicationExportPath(String offlineReplicationExportPath) { + this.offlineReplicationExportPath = offlineReplicationExportPath; + return this; + } + + /** + * Get the replicationPort property: A value indicating the recovery HTTPS port. + * + * @return the replicationPort value. + */ + public Integer replicationPort() { + return this.replicationPort; + } + + /** + * Set the replicationPort property: A value indicating the recovery HTTPS port. + * + * @param replicationPort the replicationPort value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withReplicationPort(Integer replicationPort) { + this.replicationPort = replicationPort; + return this; + } + + /** + * Get the allowedAuthenticationType property: A value indicating the authentication type. + * + * @return the allowedAuthenticationType value. + */ + public Integer allowedAuthenticationType() { + return this.allowedAuthenticationType; + } + + /** + * Set the allowedAuthenticationType property: A value indicating the authentication type. + * + * @param allowedAuthenticationType the allowedAuthenticationType value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withAllowedAuthenticationType(Integer allowedAuthenticationType) { + this.allowedAuthenticationType = allowedAuthenticationType; + return this; + } + + /** + * Get the replicaDeletionOption property: A value indicating whether the VM has to be auto deleted. Supported + * Values: String.Empty, None, OnRecoveryCloud. + * + * @return the replicaDeletionOption value. + */ + public String replicaDeletionOption() { + return this.replicaDeletionOption; + } + + /** + * Set the replicaDeletionOption property: A value indicating whether the VM has to be auto deleted. Supported + * Values: String.Empty, None, OnRecoveryCloud. + * + * @param replicaDeletionOption the replicaDeletionOption value to set. + * @return the HyperVReplicaBluePolicyDetails object itself. + */ + public HyperVReplicaBluePolicyDetails withReplicaDeletionOption(String replicaDeletionOption) { + this.replicaDeletionOption = replicaDeletionOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyInput.java new file mode 100644 index 000000000000..6066a84122f9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyInput.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.recoveryservicessiterecovery.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 Replica Blue policy input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplica2012R2") +@Fluent +public final class HyperVReplicaBluePolicyInput extends HyperVReplicaPolicyInput { + /* + * A value indicating the replication interval. + */ + @JsonProperty(value = "replicationFrequencyInSeconds") + private Integer replicationFrequencyInSeconds; + + /** Creates an instance of HyperVReplicaBluePolicyInput class. */ + public HyperVReplicaBluePolicyInput() { + } + + /** + * Get the replicationFrequencyInSeconds property: A value indicating the replication interval. + * + * @return the replicationFrequencyInSeconds value. + */ + public Integer replicationFrequencyInSeconds() { + return this.replicationFrequencyInSeconds; + } + + /** + * Set the replicationFrequencyInSeconds property: A value indicating the replication interval. + * + * @param replicationFrequencyInSeconds the replicationFrequencyInSeconds value to set. + * @return the HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput withReplicationFrequencyInSeconds(Integer replicationFrequencyInSeconds) { + this.replicationFrequencyInSeconds = replicationFrequencyInSeconds; + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withRecoveryPoints(Integer recoveryPoints) { + super.withRecoveryPoints(recoveryPoints); + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withApplicationConsistentSnapshotFrequencyInHours( + Integer applicationConsistentSnapshotFrequencyInHours) { + super.withApplicationConsistentSnapshotFrequencyInHours(applicationConsistentSnapshotFrequencyInHours); + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withCompression(String compression) { + super.withCompression(compression); + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withInitialReplicationMethod(String initialReplicationMethod) { + super.withInitialReplicationMethod(initialReplicationMethod); + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withOnlineReplicationStartTime(String onlineReplicationStartTime) { + super.withOnlineReplicationStartTime(onlineReplicationStartTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withOfflineReplicationImportPath(String offlineReplicationImportPath) { + super.withOfflineReplicationImportPath(offlineReplicationImportPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withOfflineReplicationExportPath(String offlineReplicationExportPath) { + super.withOfflineReplicationExportPath(offlineReplicationExportPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withReplicationPort(Integer replicationPort) { + super.withReplicationPort(replicationPort); + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withAllowedAuthenticationType(Integer allowedAuthenticationType) { + super.withAllowedAuthenticationType(allowedAuthenticationType); + return this; + } + + /** {@inheritDoc} */ + @Override + public HyperVReplicaBluePolicyInput withReplicaDeletion(String replicaDeletion) { + super.withReplicaDeletion(replicaDeletion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBlueReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBlueReplicationDetails.java new file mode 100644 index 000000000000..d23054ae2e60 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBlueReplicationDetails.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.time.OffsetDateTime; +import java.util.List; + +/** HyperV replica 2012 R2 (Blue) replication details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplica2012R2") +@Fluent +public final class HyperVReplicaBlueReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * The Last replication time. + */ + @JsonProperty(value = "lastReplicatedTime") + private OffsetDateTime lastReplicatedTime; + + /* + * The PE Network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The virtual machine Id. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * The protection state for the vm. + */ + @JsonProperty(value = "vmProtectionState") + private String vmProtectionState; + + /* + * The protection state description for the vm. + */ + @JsonProperty(value = "vmProtectionStateDescription") + private String vmProtectionStateDescription; + + /* + * Initial replication details. + */ + @JsonProperty(value = "initialReplicationDetails") + private InitialReplicationDetails initialReplicationDetails; + + /* + * VM disk details. + */ + @JsonProperty(value = "vMDiskDetails") + private List vMDiskDetails; + + /** Creates an instance of HyperVReplicaBlueReplicationDetails class. */ + public HyperVReplicaBlueReplicationDetails() { + } + + /** + * Get the lastReplicatedTime property: The Last replication time. + * + * @return the lastReplicatedTime value. + */ + public OffsetDateTime lastReplicatedTime() { + return this.lastReplicatedTime; + } + + /** + * Set the lastReplicatedTime property: The Last replication time. + * + * @param lastReplicatedTime the lastReplicatedTime value to set. + * @return the HyperVReplicaBlueReplicationDetails object itself. + */ + public HyperVReplicaBlueReplicationDetails withLastReplicatedTime(OffsetDateTime lastReplicatedTime) { + this.lastReplicatedTime = lastReplicatedTime; + return this; + } + + /** + * Get the vmNics property: The PE Network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The PE Network details. + * + * @param vmNics the vmNics value to set. + * @return the HyperVReplicaBlueReplicationDetails object itself. + */ + public HyperVReplicaBlueReplicationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the vmId property: The virtual machine Id. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: The virtual machine Id. + * + * @param vmId the vmId value to set. + * @return the HyperVReplicaBlueReplicationDetails object itself. + */ + public HyperVReplicaBlueReplicationDetails withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the vmProtectionState property: The protection state for the vm. + * + * @return the vmProtectionState value. + */ + public String vmProtectionState() { + return this.vmProtectionState; + } + + /** + * Set the vmProtectionState property: The protection state for the vm. + * + * @param vmProtectionState the vmProtectionState value to set. + * @return the HyperVReplicaBlueReplicationDetails object itself. + */ + public HyperVReplicaBlueReplicationDetails withVmProtectionState(String vmProtectionState) { + this.vmProtectionState = vmProtectionState; + return this; + } + + /** + * Get the vmProtectionStateDescription property: The protection state description for the vm. + * + * @return the vmProtectionStateDescription value. + */ + public String vmProtectionStateDescription() { + return this.vmProtectionStateDescription; + } + + /** + * Set the vmProtectionStateDescription property: The protection state description for the vm. + * + * @param vmProtectionStateDescription the vmProtectionStateDescription value to set. + * @return the HyperVReplicaBlueReplicationDetails object itself. + */ + public HyperVReplicaBlueReplicationDetails withVmProtectionStateDescription(String vmProtectionStateDescription) { + this.vmProtectionStateDescription = vmProtectionStateDescription; + return this; + } + + /** + * Get the initialReplicationDetails property: Initial replication details. + * + * @return the initialReplicationDetails value. + */ + public InitialReplicationDetails initialReplicationDetails() { + return this.initialReplicationDetails; + } + + /** + * Set the initialReplicationDetails property: Initial replication details. + * + * @param initialReplicationDetails the initialReplicationDetails value to set. + * @return the HyperVReplicaBlueReplicationDetails object itself. + */ + public HyperVReplicaBlueReplicationDetails withInitialReplicationDetails( + InitialReplicationDetails initialReplicationDetails) { + this.initialReplicationDetails = initialReplicationDetails; + return this; + } + + /** + * Get the vMDiskDetails property: VM disk details. + * + * @return the vMDiskDetails value. + */ + public List vMDiskDetails() { + return this.vMDiskDetails; + } + + /** + * Set the vMDiskDetails property: VM disk details. + * + * @param vMDiskDetails the vMDiskDetails value to set. + * @return the HyperVReplicaBlueReplicationDetails object itself. + */ + public HyperVReplicaBlueReplicationDetails withVMDiskDetails(List vMDiskDetails) { + this.vMDiskDetails = vMDiskDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (initialReplicationDetails() != null) { + initialReplicationDetails().validate(); + } + if (vMDiskDetails() != null) { + vMDiskDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyDetails.java new file mode 100644 index 000000000000..355992583bc2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyDetails.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Hyper-V Replica Blue specific protection profile details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplica2012") +@Fluent +public final class HyperVReplicaPolicyDetails extends PolicyProviderSpecificDetails { + /* + * A value indicating the number of recovery points. + */ + @JsonProperty(value = "recoveryPoints") + private Integer recoveryPoints; + + /* + * A value indicating the application consistent frequency. + */ + @JsonProperty(value = "applicationConsistentSnapshotFrequencyInHours") + private Integer applicationConsistentSnapshotFrequencyInHours; + + /* + * A value indicating whether compression has to be enabled. + */ + @JsonProperty(value = "compression") + private String compression; + + /* + * A value indicating whether IR is online. + */ + @JsonProperty(value = "initialReplicationMethod") + private String initialReplicationMethod; + + /* + * A value indicating the online IR start time. + */ + @JsonProperty(value = "onlineReplicationStartTime") + private String onlineReplicationStartTime; + + /* + * A value indicating the offline IR import path. + */ + @JsonProperty(value = "offlineReplicationImportPath") + private String offlineReplicationImportPath; + + /* + * A value indicating the offline IR export path. + */ + @JsonProperty(value = "offlineReplicationExportPath") + private String offlineReplicationExportPath; + + /* + * A value indicating the recovery HTTPS port. + */ + @JsonProperty(value = "replicationPort") + private Integer replicationPort; + + /* + * A value indicating the authentication type. + */ + @JsonProperty(value = "allowedAuthenticationType") + private Integer allowedAuthenticationType; + + /* + * A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud + */ + @JsonProperty(value = "replicaDeletionOption") + private String replicaDeletionOption; + + /** Creates an instance of HyperVReplicaPolicyDetails class. */ + public HyperVReplicaPolicyDetails() { + } + + /** + * Get the recoveryPoints property: A value indicating the number of recovery points. + * + * @return the recoveryPoints value. + */ + public Integer recoveryPoints() { + return this.recoveryPoints; + } + + /** + * Set the recoveryPoints property: A value indicating the number of recovery points. + * + * @param recoveryPoints the recoveryPoints value to set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withRecoveryPoints(Integer recoveryPoints) { + this.recoveryPoints = recoveryPoints; + return this; + } + + /** + * Get the applicationConsistentSnapshotFrequencyInHours property: A value indicating the application consistent + * frequency. + * + * @return the applicationConsistentSnapshotFrequencyInHours value. + */ + public Integer applicationConsistentSnapshotFrequencyInHours() { + return this.applicationConsistentSnapshotFrequencyInHours; + } + + /** + * Set the applicationConsistentSnapshotFrequencyInHours property: A value indicating the application consistent + * frequency. + * + * @param applicationConsistentSnapshotFrequencyInHours the applicationConsistentSnapshotFrequencyInHours value to + * set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withApplicationConsistentSnapshotFrequencyInHours( + Integer applicationConsistentSnapshotFrequencyInHours) { + this.applicationConsistentSnapshotFrequencyInHours = applicationConsistentSnapshotFrequencyInHours; + return this; + } + + /** + * Get the compression property: A value indicating whether compression has to be enabled. + * + * @return the compression value. + */ + public String compression() { + return this.compression; + } + + /** + * Set the compression property: A value indicating whether compression has to be enabled. + * + * @param compression the compression value to set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withCompression(String compression) { + this.compression = compression; + return this; + } + + /** + * Get the initialReplicationMethod property: A value indicating whether IR is online. + * + * @return the initialReplicationMethod value. + */ + public String initialReplicationMethod() { + return this.initialReplicationMethod; + } + + /** + * Set the initialReplicationMethod property: A value indicating whether IR is online. + * + * @param initialReplicationMethod the initialReplicationMethod value to set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withInitialReplicationMethod(String initialReplicationMethod) { + this.initialReplicationMethod = initialReplicationMethod; + return this; + } + + /** + * Get the onlineReplicationStartTime property: A value indicating the online IR start time. + * + * @return the onlineReplicationStartTime value. + */ + public String onlineReplicationStartTime() { + return this.onlineReplicationStartTime; + } + + /** + * Set the onlineReplicationStartTime property: A value indicating the online IR start time. + * + * @param onlineReplicationStartTime the onlineReplicationStartTime value to set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withOnlineReplicationStartTime(String onlineReplicationStartTime) { + this.onlineReplicationStartTime = onlineReplicationStartTime; + return this; + } + + /** + * Get the offlineReplicationImportPath property: A value indicating the offline IR import path. + * + * @return the offlineReplicationImportPath value. + */ + public String offlineReplicationImportPath() { + return this.offlineReplicationImportPath; + } + + /** + * Set the offlineReplicationImportPath property: A value indicating the offline IR import path. + * + * @param offlineReplicationImportPath the offlineReplicationImportPath value to set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withOfflineReplicationImportPath(String offlineReplicationImportPath) { + this.offlineReplicationImportPath = offlineReplicationImportPath; + return this; + } + + /** + * Get the offlineReplicationExportPath property: A value indicating the offline IR export path. + * + * @return the offlineReplicationExportPath value. + */ + public String offlineReplicationExportPath() { + return this.offlineReplicationExportPath; + } + + /** + * Set the offlineReplicationExportPath property: A value indicating the offline IR export path. + * + * @param offlineReplicationExportPath the offlineReplicationExportPath value to set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withOfflineReplicationExportPath(String offlineReplicationExportPath) { + this.offlineReplicationExportPath = offlineReplicationExportPath; + return this; + } + + /** + * Get the replicationPort property: A value indicating the recovery HTTPS port. + * + * @return the replicationPort value. + */ + public Integer replicationPort() { + return this.replicationPort; + } + + /** + * Set the replicationPort property: A value indicating the recovery HTTPS port. + * + * @param replicationPort the replicationPort value to set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withReplicationPort(Integer replicationPort) { + this.replicationPort = replicationPort; + return this; + } + + /** + * Get the allowedAuthenticationType property: A value indicating the authentication type. + * + * @return the allowedAuthenticationType value. + */ + public Integer allowedAuthenticationType() { + return this.allowedAuthenticationType; + } + + /** + * Set the allowedAuthenticationType property: A value indicating the authentication type. + * + * @param allowedAuthenticationType the allowedAuthenticationType value to set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withAllowedAuthenticationType(Integer allowedAuthenticationType) { + this.allowedAuthenticationType = allowedAuthenticationType; + return this; + } + + /** + * Get the replicaDeletionOption property: A value indicating whether the VM has to be auto deleted. Supported + * Values: String.Empty, None, OnRecoveryCloud. + * + * @return the replicaDeletionOption value. + */ + public String replicaDeletionOption() { + return this.replicaDeletionOption; + } + + /** + * Set the replicaDeletionOption property: A value indicating whether the VM has to be auto deleted. Supported + * Values: String.Empty, None, OnRecoveryCloud. + * + * @param replicaDeletionOption the replicaDeletionOption value to set. + * @return the HyperVReplicaPolicyDetails object itself. + */ + public HyperVReplicaPolicyDetails withReplicaDeletionOption(String replicaDeletionOption) { + this.replicaDeletionOption = replicaDeletionOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyInput.java new file mode 100644 index 000000000000..8e92c830ce7e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Hyper-V Replica specific policy Input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = HyperVReplicaPolicyInput.class) +@JsonTypeName("HyperVReplica2012") +@JsonSubTypes({@JsonSubTypes.Type(name = "HyperVReplica2012R2", value = HyperVReplicaBluePolicyInput.class)}) +@Fluent +public class HyperVReplicaPolicyInput extends PolicyProviderSpecificInput { + /* + * A value indicating the number of recovery points. + */ + @JsonProperty(value = "recoveryPoints") + private Integer recoveryPoints; + + /* + * A value indicating the application consistent frequency. + */ + @JsonProperty(value = "applicationConsistentSnapshotFrequencyInHours") + private Integer applicationConsistentSnapshotFrequencyInHours; + + /* + * A value indicating whether compression has to be enabled. + */ + @JsonProperty(value = "compression") + private String compression; + + /* + * A value indicating whether IR is online. + */ + @JsonProperty(value = "initialReplicationMethod") + private String initialReplicationMethod; + + /* + * A value indicating the online IR start time. + */ + @JsonProperty(value = "onlineReplicationStartTime") + private String onlineReplicationStartTime; + + /* + * A value indicating the offline IR import path. + */ + @JsonProperty(value = "offlineReplicationImportPath") + private String offlineReplicationImportPath; + + /* + * A value indicating the offline IR export path. + */ + @JsonProperty(value = "offlineReplicationExportPath") + private String offlineReplicationExportPath; + + /* + * A value indicating the recovery HTTPS port. + */ + @JsonProperty(value = "replicationPort") + private Integer replicationPort; + + /* + * A value indicating the authentication type. + */ + @JsonProperty(value = "allowedAuthenticationType") + private Integer allowedAuthenticationType; + + /* + * A value indicating whether the VM has to be auto deleted. + */ + @JsonProperty(value = "replicaDeletion") + private String replicaDeletion; + + /** Creates an instance of HyperVReplicaPolicyInput class. */ + public HyperVReplicaPolicyInput() { + } + + /** + * Get the recoveryPoints property: A value indicating the number of recovery points. + * + * @return the recoveryPoints value. + */ + public Integer recoveryPoints() { + return this.recoveryPoints; + } + + /** + * Set the recoveryPoints property: A value indicating the number of recovery points. + * + * @param recoveryPoints the recoveryPoints value to set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withRecoveryPoints(Integer recoveryPoints) { + this.recoveryPoints = recoveryPoints; + return this; + } + + /** + * Get the applicationConsistentSnapshotFrequencyInHours property: A value indicating the application consistent + * frequency. + * + * @return the applicationConsistentSnapshotFrequencyInHours value. + */ + public Integer applicationConsistentSnapshotFrequencyInHours() { + return this.applicationConsistentSnapshotFrequencyInHours; + } + + /** + * Set the applicationConsistentSnapshotFrequencyInHours property: A value indicating the application consistent + * frequency. + * + * @param applicationConsistentSnapshotFrequencyInHours the applicationConsistentSnapshotFrequencyInHours value to + * set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withApplicationConsistentSnapshotFrequencyInHours( + Integer applicationConsistentSnapshotFrequencyInHours) { + this.applicationConsistentSnapshotFrequencyInHours = applicationConsistentSnapshotFrequencyInHours; + return this; + } + + /** + * Get the compression property: A value indicating whether compression has to be enabled. + * + * @return the compression value. + */ + public String compression() { + return this.compression; + } + + /** + * Set the compression property: A value indicating whether compression has to be enabled. + * + * @param compression the compression value to set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withCompression(String compression) { + this.compression = compression; + return this; + } + + /** + * Get the initialReplicationMethod property: A value indicating whether IR is online. + * + * @return the initialReplicationMethod value. + */ + public String initialReplicationMethod() { + return this.initialReplicationMethod; + } + + /** + * Set the initialReplicationMethod property: A value indicating whether IR is online. + * + * @param initialReplicationMethod the initialReplicationMethod value to set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withInitialReplicationMethod(String initialReplicationMethod) { + this.initialReplicationMethod = initialReplicationMethod; + return this; + } + + /** + * Get the onlineReplicationStartTime property: A value indicating the online IR start time. + * + * @return the onlineReplicationStartTime value. + */ + public String onlineReplicationStartTime() { + return this.onlineReplicationStartTime; + } + + /** + * Set the onlineReplicationStartTime property: A value indicating the online IR start time. + * + * @param onlineReplicationStartTime the onlineReplicationStartTime value to set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withOnlineReplicationStartTime(String onlineReplicationStartTime) { + this.onlineReplicationStartTime = onlineReplicationStartTime; + return this; + } + + /** + * Get the offlineReplicationImportPath property: A value indicating the offline IR import path. + * + * @return the offlineReplicationImportPath value. + */ + public String offlineReplicationImportPath() { + return this.offlineReplicationImportPath; + } + + /** + * Set the offlineReplicationImportPath property: A value indicating the offline IR import path. + * + * @param offlineReplicationImportPath the offlineReplicationImportPath value to set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withOfflineReplicationImportPath(String offlineReplicationImportPath) { + this.offlineReplicationImportPath = offlineReplicationImportPath; + return this; + } + + /** + * Get the offlineReplicationExportPath property: A value indicating the offline IR export path. + * + * @return the offlineReplicationExportPath value. + */ + public String offlineReplicationExportPath() { + return this.offlineReplicationExportPath; + } + + /** + * Set the offlineReplicationExportPath property: A value indicating the offline IR export path. + * + * @param offlineReplicationExportPath the offlineReplicationExportPath value to set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withOfflineReplicationExportPath(String offlineReplicationExportPath) { + this.offlineReplicationExportPath = offlineReplicationExportPath; + return this; + } + + /** + * Get the replicationPort property: A value indicating the recovery HTTPS port. + * + * @return the replicationPort value. + */ + public Integer replicationPort() { + return this.replicationPort; + } + + /** + * Set the replicationPort property: A value indicating the recovery HTTPS port. + * + * @param replicationPort the replicationPort value to set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withReplicationPort(Integer replicationPort) { + this.replicationPort = replicationPort; + return this; + } + + /** + * Get the allowedAuthenticationType property: A value indicating the authentication type. + * + * @return the allowedAuthenticationType value. + */ + public Integer allowedAuthenticationType() { + return this.allowedAuthenticationType; + } + + /** + * Set the allowedAuthenticationType property: A value indicating the authentication type. + * + * @param allowedAuthenticationType the allowedAuthenticationType value to set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withAllowedAuthenticationType(Integer allowedAuthenticationType) { + this.allowedAuthenticationType = allowedAuthenticationType; + return this; + } + + /** + * Get the replicaDeletion property: A value indicating whether the VM has to be auto deleted. + * + * @return the replicaDeletion value. + */ + public String replicaDeletion() { + return this.replicaDeletion; + } + + /** + * Set the replicaDeletion property: A value indicating whether the VM has to be auto deleted. + * + * @param replicaDeletion the replicaDeletion value to set. + * @return the HyperVReplicaPolicyInput object itself. + */ + public HyperVReplicaPolicyInput withReplicaDeletion(String replicaDeletion) { + this.replicaDeletion = replicaDeletion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaReplicationDetails.java new file mode 100644 index 000000000000..3317a92f6e92 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaReplicationDetails.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.time.OffsetDateTime; +import java.util.List; + +/** HyperV replica 2012 replication details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplica2012") +@Fluent +public final class HyperVReplicaReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * The Last replication time. + */ + @JsonProperty(value = "lastReplicatedTime") + private OffsetDateTime lastReplicatedTime; + + /* + * The PE Network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The virtual machine Id. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * The protection state for the vm. + */ + @JsonProperty(value = "vmProtectionState") + private String vmProtectionState; + + /* + * The protection state description for the vm. + */ + @JsonProperty(value = "vmProtectionStateDescription") + private String vmProtectionStateDescription; + + /* + * Initial replication details. + */ + @JsonProperty(value = "initialReplicationDetails") + private InitialReplicationDetails initialReplicationDetails; + + /* + * VM disk details. + */ + @JsonProperty(value = "vMDiskDetails") + private List vMDiskDetails; + + /** Creates an instance of HyperVReplicaReplicationDetails class. */ + public HyperVReplicaReplicationDetails() { + } + + /** + * Get the lastReplicatedTime property: The Last replication time. + * + * @return the lastReplicatedTime value. + */ + public OffsetDateTime lastReplicatedTime() { + return this.lastReplicatedTime; + } + + /** + * Set the lastReplicatedTime property: The Last replication time. + * + * @param lastReplicatedTime the lastReplicatedTime value to set. + * @return the HyperVReplicaReplicationDetails object itself. + */ + public HyperVReplicaReplicationDetails withLastReplicatedTime(OffsetDateTime lastReplicatedTime) { + this.lastReplicatedTime = lastReplicatedTime; + return this; + } + + /** + * Get the vmNics property: The PE Network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The PE Network details. + * + * @param vmNics the vmNics value to set. + * @return the HyperVReplicaReplicationDetails object itself. + */ + public HyperVReplicaReplicationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the vmId property: The virtual machine Id. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: The virtual machine Id. + * + * @param vmId the vmId value to set. + * @return the HyperVReplicaReplicationDetails object itself. + */ + public HyperVReplicaReplicationDetails withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the vmProtectionState property: The protection state for the vm. + * + * @return the vmProtectionState value. + */ + public String vmProtectionState() { + return this.vmProtectionState; + } + + /** + * Set the vmProtectionState property: The protection state for the vm. + * + * @param vmProtectionState the vmProtectionState value to set. + * @return the HyperVReplicaReplicationDetails object itself. + */ + public HyperVReplicaReplicationDetails withVmProtectionState(String vmProtectionState) { + this.vmProtectionState = vmProtectionState; + return this; + } + + /** + * Get the vmProtectionStateDescription property: The protection state description for the vm. + * + * @return the vmProtectionStateDescription value. + */ + public String vmProtectionStateDescription() { + return this.vmProtectionStateDescription; + } + + /** + * Set the vmProtectionStateDescription property: The protection state description for the vm. + * + * @param vmProtectionStateDescription the vmProtectionStateDescription value to set. + * @return the HyperVReplicaReplicationDetails object itself. + */ + public HyperVReplicaReplicationDetails withVmProtectionStateDescription(String vmProtectionStateDescription) { + this.vmProtectionStateDescription = vmProtectionStateDescription; + return this; + } + + /** + * Get the initialReplicationDetails property: Initial replication details. + * + * @return the initialReplicationDetails value. + */ + public InitialReplicationDetails initialReplicationDetails() { + return this.initialReplicationDetails; + } + + /** + * Set the initialReplicationDetails property: Initial replication details. + * + * @param initialReplicationDetails the initialReplicationDetails value to set. + * @return the HyperVReplicaReplicationDetails object itself. + */ + public HyperVReplicaReplicationDetails withInitialReplicationDetails( + InitialReplicationDetails initialReplicationDetails) { + this.initialReplicationDetails = initialReplicationDetails; + return this; + } + + /** + * Get the vMDiskDetails property: VM disk details. + * + * @return the vMDiskDetails value. + */ + public List vMDiskDetails() { + return this.vMDiskDetails; + } + + /** + * Set the vMDiskDetails property: VM disk details. + * + * @param vMDiskDetails the vMDiskDetails value to set. + * @return the HyperVReplicaReplicationDetails object itself. + */ + public HyperVReplicaReplicationDetails withVMDiskDetails(List vMDiskDetails) { + this.vMDiskDetails = vMDiskDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (initialReplicationDetails() != null) { + initialReplicationDetails().validate(); + } + if (vMDiskDetails() != null) { + vMDiskDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVSiteDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVSiteDetails.java new file mode 100644 index 000000000000..d1de0a7e558f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVSiteDetails.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; + +/** HyperVSite fabric specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVSite") +@Fluent +public final class HyperVSiteDetails extends FabricSpecificDetails { + /* + * The list of Hyper-V hosts associated with the fabric. + */ + @JsonProperty(value = "hyperVHosts") + private List hyperVHosts; + + /** Creates an instance of HyperVSiteDetails class. */ + public HyperVSiteDetails() { + } + + /** + * Get the hyperVHosts property: The list of Hyper-V hosts associated with the fabric. + * + * @return the hyperVHosts value. + */ + public List hyperVHosts() { + return this.hyperVHosts; + } + + /** + * Set the hyperVHosts property: The list of Hyper-V hosts associated with the fabric. + * + * @param hyperVHosts the hyperVHosts value to set. + * @return the HyperVSiteDetails object itself. + */ + public HyperVSiteDetails withHyperVHosts(List hyperVHosts) { + this.hyperVHosts = hyperVHosts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (hyperVHosts() != null) { + hyperVHosts().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVVirtualMachineDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVVirtualMachineDetails.java new file mode 100644 index 000000000000..c9177383d3ee --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVVirtualMachineDetails.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +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.List; + +/** Single Host fabric provider specific VM settings. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = HyperVVirtualMachineDetails.class) +@JsonTypeName("HyperVVirtualMachine") +@JsonSubTypes({@JsonSubTypes.Type(name = "VmmVirtualMachine", value = VmmVirtualMachineDetails.class)}) +@Fluent +public class HyperVVirtualMachineDetails extends ConfigurationSettings { + /* + * The source id of the object. + */ + @JsonProperty(value = "sourceItemId") + private String sourceItemId; + + /* + * The id of the object in fabric. + */ + @JsonProperty(value = "generation") + private String generation; + + /* + * The Last replication time. + */ + @JsonProperty(value = "osDetails") + private OSDetails osDetails; + + /* + * The Last successful failover time. + */ + @JsonProperty(value = "diskDetails") + private List diskDetails; + + /* + * A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus + * enum. + */ + @JsonProperty(value = "hasPhysicalDisk") + private PresenceStatus hasPhysicalDisk; + + /* + * A value indicating whether the VM has a fibre channel adapter attached. String value of + * SrsDataContract.PresenceStatus enum. + */ + @JsonProperty(value = "hasFibreChannelAdapter") + private PresenceStatus hasFibreChannelAdapter; + + /* + * A value indicating whether the VM has a shared VHD attached. String value of SrsDataContract.PresenceStatus + * enum. + */ + @JsonProperty(value = "hasSharedVhd") + private PresenceStatus hasSharedVhd; + + /* + * The Id of the hyper-v host in fabric. + */ + @JsonProperty(value = "hyperVHostId") + private String hyperVHostId; + + /** Creates an instance of HyperVVirtualMachineDetails class. */ + public HyperVVirtualMachineDetails() { + } + + /** + * Get the sourceItemId property: The source id of the object. + * + * @return the sourceItemId value. + */ + public String sourceItemId() { + return this.sourceItemId; + } + + /** + * Set the sourceItemId property: The source id of the object. + * + * @param sourceItemId the sourceItemId value to set. + * @return the HyperVVirtualMachineDetails object itself. + */ + public HyperVVirtualMachineDetails withSourceItemId(String sourceItemId) { + this.sourceItemId = sourceItemId; + return this; + } + + /** + * Get the generation property: The id of the object in fabric. + * + * @return the generation value. + */ + public String generation() { + return this.generation; + } + + /** + * Set the generation property: The id of the object in fabric. + * + * @param generation the generation value to set. + * @return the HyperVVirtualMachineDetails object itself. + */ + public HyperVVirtualMachineDetails withGeneration(String generation) { + this.generation = generation; + return this; + } + + /** + * Get the osDetails property: The Last replication time. + * + * @return the osDetails value. + */ + public OSDetails osDetails() { + return this.osDetails; + } + + /** + * Set the osDetails property: The Last replication time. + * + * @param osDetails the osDetails value to set. + * @return the HyperVVirtualMachineDetails object itself. + */ + public HyperVVirtualMachineDetails withOsDetails(OSDetails osDetails) { + this.osDetails = osDetails; + return this; + } + + /** + * Get the diskDetails property: The Last successful failover time. + * + * @return the diskDetails value. + */ + public List diskDetails() { + return this.diskDetails; + } + + /** + * Set the diskDetails property: The Last successful failover time. + * + * @param diskDetails the diskDetails value to set. + * @return the HyperVVirtualMachineDetails object itself. + */ + public HyperVVirtualMachineDetails withDiskDetails(List diskDetails) { + this.diskDetails = diskDetails; + return this; + } + + /** + * Get the hasPhysicalDisk property: A value indicating whether the VM has a physical disk attached. String value of + * SrsDataContract.PresenceStatus enum. + * + * @return the hasPhysicalDisk value. + */ + public PresenceStatus hasPhysicalDisk() { + return this.hasPhysicalDisk; + } + + /** + * Set the hasPhysicalDisk property: A value indicating whether the VM has a physical disk attached. String value of + * SrsDataContract.PresenceStatus enum. + * + * @param hasPhysicalDisk the hasPhysicalDisk value to set. + * @return the HyperVVirtualMachineDetails object itself. + */ + public HyperVVirtualMachineDetails withHasPhysicalDisk(PresenceStatus hasPhysicalDisk) { + this.hasPhysicalDisk = hasPhysicalDisk; + return this; + } + + /** + * Get the hasFibreChannelAdapter property: A value indicating whether the VM has a fibre channel adapter attached. + * String value of SrsDataContract.PresenceStatus enum. + * + * @return the hasFibreChannelAdapter value. + */ + public PresenceStatus hasFibreChannelAdapter() { + return this.hasFibreChannelAdapter; + } + + /** + * Set the hasFibreChannelAdapter property: A value indicating whether the VM has a fibre channel adapter attached. + * String value of SrsDataContract.PresenceStatus enum. + * + * @param hasFibreChannelAdapter the hasFibreChannelAdapter value to set. + * @return the HyperVVirtualMachineDetails object itself. + */ + public HyperVVirtualMachineDetails withHasFibreChannelAdapter(PresenceStatus hasFibreChannelAdapter) { + this.hasFibreChannelAdapter = hasFibreChannelAdapter; + return this; + } + + /** + * Get the hasSharedVhd property: A value indicating whether the VM has a shared VHD attached. String value of + * SrsDataContract.PresenceStatus enum. + * + * @return the hasSharedVhd value. + */ + public PresenceStatus hasSharedVhd() { + return this.hasSharedVhd; + } + + /** + * Set the hasSharedVhd property: A value indicating whether the VM has a shared VHD attached. String value of + * SrsDataContract.PresenceStatus enum. + * + * @param hasSharedVhd the hasSharedVhd value to set. + * @return the HyperVVirtualMachineDetails object itself. + */ + public HyperVVirtualMachineDetails withHasSharedVhd(PresenceStatus hasSharedVhd) { + this.hasSharedVhd = hasSharedVhd; + return this; + } + + /** + * Get the hyperVHostId property: The Id of the hyper-v host in fabric. + * + * @return the hyperVHostId value. + */ + public String hyperVHostId() { + return this.hyperVHostId; + } + + /** + * Set the hyperVHostId property: The Id of the hyper-v host in fabric. + * + * @param hyperVHostId the hyperVHostId value to set. + * @return the HyperVVirtualMachineDetails object itself. + */ + public HyperVVirtualMachineDetails withHyperVHostId(String hyperVHostId) { + this.hyperVHostId = hyperVHostId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (osDetails() != null) { + osDetails().validate(); + } + if (diskDetails() != null) { + diskDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderDetails.java new file mode 100644 index 000000000000..ea4c32b1a243 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderDetails.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity provider details. */ +@Fluent +public final class IdentityProviderDetails { + /* + * The tenant Id for the service principal with which the on-premise management/data plane components would + * communicate with our Azure services. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * The application/client Id for the service principal with which the on-premise management/data plane components + * would communicate with our Azure services. + */ + @JsonProperty(value = "applicationId") + private String applicationId; + + /* + * The object Id of the service principal with which the on-premise management/data plane components would + * communicate with our Azure services. + */ + @JsonProperty(value = "objectId") + private String objectId; + + /* + * The intended Audience of the service principal with which the on-premise management/data plane components would + * communicate with our Azure services. + */ + @JsonProperty(value = "audience") + private String audience; + + /* + * The base authority for Azure Active Directory authentication. + */ + @JsonProperty(value = "aadAuthority") + private String aadAuthority; + + /** Creates an instance of IdentityProviderDetails class. */ + public IdentityProviderDetails() { + } + + /** + * Get the tenantId property: The tenant Id for the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant Id for the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * + * @param tenantId the tenantId value to set. + * @return the IdentityProviderDetails object itself. + */ + public IdentityProviderDetails withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the applicationId property: The application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: The application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param applicationId the applicationId value to set. + * @return the IdentityProviderDetails object itself. + */ + public IdentityProviderDetails withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Get the objectId property: The object Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The object Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param objectId the objectId value to set. + * @return the IdentityProviderDetails object itself. + */ + public IdentityProviderDetails withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the audience property: The intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience property: The intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param audience the audience value to set. + * @return the IdentityProviderDetails object itself. + */ + public IdentityProviderDetails withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the aadAuthority property: The base authority for Azure Active Directory authentication. + * + * @return the aadAuthority value. + */ + public String aadAuthority() { + return this.aadAuthority; + } + + /** + * Set the aadAuthority property: The base authority for Azure Active Directory authentication. + * + * @param aadAuthority the aadAuthority value to set. + * @return the IdentityProviderDetails object itself. + */ + public IdentityProviderDetails withAadAuthority(String aadAuthority) { + this.aadAuthority = aadAuthority; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderInput.java new file mode 100644 index 000000000000..cb89ad8ad20c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderInput.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity provider input. */ +@Fluent +public final class IdentityProviderInput { + /* + * The tenant Id for the service principal with which the on-premise management/data plane components would + * communicate with our Azure services. + */ + @JsonProperty(value = "tenantId", required = true) + private String tenantId; + + /* + * The application/client Id for the service principal with which the on-premise management/data plane components + * would communicate with our Azure services. + */ + @JsonProperty(value = "applicationId", required = true) + private String applicationId; + + /* + * The object Id of the service principal with which the on-premise management/data plane components would + * communicate with our Azure services. + */ + @JsonProperty(value = "objectId", required = true) + private String objectId; + + /* + * The intended Audience of the service principal with which the on-premise management/data plane components would + * communicate with our Azure services. + */ + @JsonProperty(value = "audience", required = true) + private String audience; + + /* + * The base authority for Azure Active Directory authentication. + */ + @JsonProperty(value = "aadAuthority", required = true) + private String aadAuthority; + + /** Creates an instance of IdentityProviderInput class. */ + public IdentityProviderInput() { + } + + /** + * Get the tenantId property: The tenant Id for the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant Id for the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * + * @param tenantId the tenantId value to set. + * @return the IdentityProviderInput object itself. + */ + public IdentityProviderInput withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the applicationId property: The application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: The application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param applicationId the applicationId value to set. + * @return the IdentityProviderInput object itself. + */ + public IdentityProviderInput withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Get the objectId property: The object Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The object Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param objectId the objectId value to set. + * @return the IdentityProviderInput object itself. + */ + public IdentityProviderInput withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the audience property: The intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience property: The intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param audience the audience value to set. + * @return the IdentityProviderInput object itself. + */ + public IdentityProviderInput withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the aadAuthority property: The base authority for Azure Active Directory authentication. + * + * @return the aadAuthority value. + */ + public String aadAuthority() { + return this.aadAuthority; + } + + /** + * Set the aadAuthority property: The base authority for Azure Active Directory authentication. + * + * @param aadAuthority the aadAuthority value to set. + * @return the IdentityProviderInput object itself. + */ + public IdentityProviderInput 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 IdentityProviderInput")); + } + if (applicationId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property applicationId in model IdentityProviderInput")); + } + if (objectId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property objectId in model IdentityProviderInput")); + } + if (audience() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property audience in model IdentityProviderInput")); + } + if (aadAuthority() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property aadAuthority in model IdentityProviderInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IdentityProviderInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAgentDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAgentDetails.java new file mode 100644 index 000000000000..8fde05852978 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAgentDetails.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The details of the InMage agent. */ +@Fluent +public final class InMageAgentDetails { + /* + * The agent version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * A value indicating whether installed agent needs to be updated. + */ + @JsonProperty(value = "agentUpdateStatus") + private String agentUpdateStatus; + + /* + * A value indicating whether reboot is required after update is applied. + */ + @JsonProperty(value = "postUpdateRebootStatus") + private String postUpdateRebootStatus; + + /* + * Agent expiry date. + */ + @JsonProperty(value = "agentExpiryDate") + private OffsetDateTime agentExpiryDate; + + /** Creates an instance of InMageAgentDetails class. */ + public InMageAgentDetails() { + } + + /** + * Get the agentVersion property: The agent version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The agent version. + * + * @param agentVersion the agentVersion value to set. + * @return the InMageAgentDetails object itself. + */ + public InMageAgentDetails withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the agentUpdateStatus property: A value indicating whether installed agent needs to be updated. + * + * @return the agentUpdateStatus value. + */ + public String agentUpdateStatus() { + return this.agentUpdateStatus; + } + + /** + * Set the agentUpdateStatus property: A value indicating whether installed agent needs to be updated. + * + * @param agentUpdateStatus the agentUpdateStatus value to set. + * @return the InMageAgentDetails object itself. + */ + public InMageAgentDetails withAgentUpdateStatus(String agentUpdateStatus) { + this.agentUpdateStatus = agentUpdateStatus; + return this; + } + + /** + * Get the postUpdateRebootStatus property: A value indicating whether reboot is required after update is applied. + * + * @return the postUpdateRebootStatus value. + */ + public String postUpdateRebootStatus() { + return this.postUpdateRebootStatus; + } + + /** + * Set the postUpdateRebootStatus property: A value indicating whether reboot is required after update is applied. + * + * @param postUpdateRebootStatus the postUpdateRebootStatus value to set. + * @return the InMageAgentDetails object itself. + */ + public InMageAgentDetails withPostUpdateRebootStatus(String postUpdateRebootStatus) { + this.postUpdateRebootStatus = postUpdateRebootStatus; + return this; + } + + /** + * Get the agentExpiryDate property: Agent expiry date. + * + * @return the agentExpiryDate value. + */ + public OffsetDateTime agentExpiryDate() { + return this.agentExpiryDate; + } + + /** + * Set the agentExpiryDate property: Agent expiry date. + * + * @param agentExpiryDate the agentExpiryDate value to set. + * @return the InMageAgentDetails object itself. + */ + public InMageAgentDetails withAgentExpiryDate(OffsetDateTime agentExpiryDate) { + this.agentExpiryDate = agentExpiryDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ApplyRecoveryPointInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ApplyRecoveryPointInput.java new file mode 100644 index 000000000000..96f0d0440fb1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ApplyRecoveryPointInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** ApplyRecoveryPoint input specific to InMageAzureV2 provider. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Immutable +public final class InMageAzureV2ApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { + /** Creates an instance of InMageAzureV2ApplyRecoveryPointInput class. */ + public InMageAzureV2ApplyRecoveryPointInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2DiskInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2DiskInputDetails.java new file mode 100644 index 000000000000..5291c4cbaf3b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2DiskInputDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk input details. */ +@Fluent +public final class InMageAzureV2DiskInputDetails { + /* + * The DiskId. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The LogStorageAccountId. + */ + @JsonProperty(value = "logStorageAccountId") + private String logStorageAccountId; + + /* + * The DiskType. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /* + * The DiskEncryptionSet ARM ID. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** Creates an instance of InMageAzureV2DiskInputDetails class. */ + public InMageAzureV2DiskInputDetails() { + } + + /** + * Get the diskId property: The DiskId. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The DiskId. + * + * @param diskId the diskId value to set. + * @return the InMageAzureV2DiskInputDetails object itself. + */ + public InMageAzureV2DiskInputDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the logStorageAccountId property: The LogStorageAccountId. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The LogStorageAccountId. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the InMageAzureV2DiskInputDetails object itself. + */ + public InMageAzureV2DiskInputDetails withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Get the diskType property: The DiskType. + * + * @return the diskType value. + */ + public DiskAccountType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The DiskType. + * + * @param diskType the diskType value to set. + * @return the InMageAzureV2DiskInputDetails object itself. + */ + public InMageAzureV2DiskInputDetails withDiskType(DiskAccountType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM ID. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The DiskEncryptionSet ARM ID. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the InMageAzureV2DiskInputDetails object itself. + */ + public InMageAzureV2DiskInputDetails withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EnableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EnableProtectionInput.java new file mode 100644 index 000000000000..164d96f109df --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EnableProtectionInput.java @@ -0,0 +1,724 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** VMware Azure specific enable protection input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2EnableProtectionInput extends EnableProtectionProviderSpecificInput { + /* + * The Master target Id. + */ + @JsonProperty(value = "masterTargetId") + private String masterTargetId; + + /* + * The Process Server Id. + */ + @JsonProperty(value = "processServerId") + private String processServerId; + + /* + * The storage account Id. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * The CS account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /* + * The multi VM group Id. + */ + @JsonProperty(value = "multiVmGroupId") + private String multiVmGroupId; + + /* + * The multi VM group name. + */ + @JsonProperty(value = "multiVmGroupName") + private String multiVmGroupName; + + /* + * The disks to include list. + */ + @JsonProperty(value = "disksToInclude") + private List disksToInclude; + + /* + * The selected target Azure network Id. + */ + @JsonProperty(value = "targetAzureNetworkId") + private String targetAzureNetworkId; + + /* + * The selected target Azure subnet Id. + */ + @JsonProperty(value = "targetAzureSubnetId") + private String targetAzureSubnetId; + + /* + * The selected option to enable RDP\SSH on target VM after failover. String value of + * SrsDataContract.EnableRDPOnTargetOption enum. + */ + @JsonProperty(value = "enableRdpOnTargetOption") + private String enableRdpOnTargetOption; + + /* + * The target azure VM Name. + */ + @JsonProperty(value = "targetAzureVmName") + private String targetAzureVmName; + + /* + * The storage account to be used for logging during replication. + */ + @JsonProperty(value = "logStorageAccountId") + private String logStorageAccountId; + + /* + * The Id of the target resource group (for classic deployment) in which the failover VM is to be created. + */ + @JsonProperty(value = "targetAzureV1ResourceGroupId") + private String targetAzureV1ResourceGroupId; + + /* + * The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. + */ + @JsonProperty(value = "targetAzureV2ResourceGroupId") + private String targetAzureV2ResourceGroupId; + + /* + * The DiskType. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /* + * The target availability set ARM Id for resource manager deployment. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The proximity placement group ARM Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * License type. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private SqlServerLicenseType sqlServerLicenseType; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /* + * The DiskEncryptionSet ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The tags for the seed managed disks. + */ + @JsonProperty(value = "seedManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map seedManagedDiskTags; + + /* + * The tags for the target managed disks. + */ + @JsonProperty(value = "targetManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetManagedDiskTags; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /** Creates an instance of InMageAzureV2EnableProtectionInput class. */ + public InMageAzureV2EnableProtectionInput() { + } + + /** + * Get the masterTargetId property: The Master target Id. + * + * @return the masterTargetId value. + */ + public String masterTargetId() { + return this.masterTargetId; + } + + /** + * Set the masterTargetId property: The Master target Id. + * + * @param masterTargetId the masterTargetId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withMasterTargetId(String masterTargetId) { + this.masterTargetId = masterTargetId; + return this; + } + + /** + * Get the processServerId property: The Process Server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The Process Server Id. + * + * @param processServerId the processServerId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the storageAccountId property: The storage account Id. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The storage account Id. + * + * @param storageAccountId the storageAccountId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the runAsAccountId property: The CS account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The CS account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Get the multiVmGroupId property: The multi VM group Id. + * + * @return the multiVmGroupId value. + */ + public String multiVmGroupId() { + return this.multiVmGroupId; + } + + /** + * Set the multiVmGroupId property: The multi VM group Id. + * + * @param multiVmGroupId the multiVmGroupId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withMultiVmGroupId(String multiVmGroupId) { + this.multiVmGroupId = multiVmGroupId; + return this; + } + + /** + * Get the multiVmGroupName property: The multi VM group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Set the multiVmGroupName property: The multi VM group name. + * + * @param multiVmGroupName the multiVmGroupName value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withMultiVmGroupName(String multiVmGroupName) { + this.multiVmGroupName = multiVmGroupName; + return this; + } + + /** + * Get the disksToInclude property: The disks to include list. + * + * @return the disksToInclude value. + */ + public List disksToInclude() { + return this.disksToInclude; + } + + /** + * Set the disksToInclude property: The disks to include list. + * + * @param disksToInclude the disksToInclude value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withDisksToInclude(List disksToInclude) { + this.disksToInclude = disksToInclude; + return this; + } + + /** + * Get the targetAzureNetworkId property: The selected target Azure network Id. + * + * @return the targetAzureNetworkId value. + */ + public String targetAzureNetworkId() { + return this.targetAzureNetworkId; + } + + /** + * Set the targetAzureNetworkId property: The selected target Azure network Id. + * + * @param targetAzureNetworkId the targetAzureNetworkId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetAzureNetworkId(String targetAzureNetworkId) { + this.targetAzureNetworkId = targetAzureNetworkId; + return this; + } + + /** + * Get the targetAzureSubnetId property: The selected target Azure subnet Id. + * + * @return the targetAzureSubnetId value. + */ + public String targetAzureSubnetId() { + return this.targetAzureSubnetId; + } + + /** + * Set the targetAzureSubnetId property: The selected target Azure subnet Id. + * + * @param targetAzureSubnetId the targetAzureSubnetId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetAzureSubnetId(String targetAzureSubnetId) { + this.targetAzureSubnetId = targetAzureSubnetId; + return this; + } + + /** + * Get the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target VM after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @return the enableRdpOnTargetOption value. + */ + public String enableRdpOnTargetOption() { + return this.enableRdpOnTargetOption; + } + + /** + * Set the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target VM after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @param enableRdpOnTargetOption the enableRdpOnTargetOption value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withEnableRdpOnTargetOption(String enableRdpOnTargetOption) { + this.enableRdpOnTargetOption = enableRdpOnTargetOption; + return this; + } + + /** + * Get the targetAzureVmName property: The target azure VM Name. + * + * @return the targetAzureVmName value. + */ + public String targetAzureVmName() { + return this.targetAzureVmName; + } + + /** + * Set the targetAzureVmName property: The target azure VM Name. + * + * @param targetAzureVmName the targetAzureVmName value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetAzureVmName(String targetAzureVmName) { + this.targetAzureVmName = targetAzureVmName; + return this; + } + + /** + * Get the logStorageAccountId property: The storage account to be used for logging during replication. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The storage account to be used for logging during replication. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Get the targetAzureV1ResourceGroupId property: The Id of the target resource group (for classic deployment) in + * which the failover VM is to be created. + * + * @return the targetAzureV1ResourceGroupId value. + */ + public String targetAzureV1ResourceGroupId() { + return this.targetAzureV1ResourceGroupId; + } + + /** + * Set the targetAzureV1ResourceGroupId property: The Id of the target resource group (for classic deployment) in + * which the failover VM is to be created. + * + * @param targetAzureV1ResourceGroupId the targetAzureV1ResourceGroupId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetAzureV1ResourceGroupId(String targetAzureV1ResourceGroupId) { + this.targetAzureV1ResourceGroupId = targetAzureV1ResourceGroupId; + return this; + } + + /** + * Get the targetAzureV2ResourceGroupId property: The Id of the target resource group (for resource manager + * deployment) in which the failover VM is to be created. + * + * @return the targetAzureV2ResourceGroupId value. + */ + public String targetAzureV2ResourceGroupId() { + return this.targetAzureV2ResourceGroupId; + } + + /** + * Set the targetAzureV2ResourceGroupId property: The Id of the target resource group (for resource manager + * deployment) in which the failover VM is to be created. + * + * @param targetAzureV2ResourceGroupId the targetAzureV2ResourceGroupId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetAzureV2ResourceGroupId(String targetAzureV2ResourceGroupId) { + this.targetAzureV2ResourceGroupId = targetAzureV2ResourceGroupId; + return this; + } + + /** + * Get the diskType property: The DiskType. + * + * @return the diskType value. + */ + public DiskAccountType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The DiskType. + * + * @param diskType the diskType value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withDiskType(DiskAccountType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the targetAvailabilitySetId property: The target availability set ARM Id for resource manager deployment. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The target availability set ARM Id for resource manager deployment. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The proximity placement group ARM Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The proximity placement group ARM Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetProximityPlacementGroupId( + String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the licenseType property: License type. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: License type. + * + * @param licenseType the licenseType value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public SqlServerLicenseType sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withSqlServerLicenseType(SqlServerLicenseType sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the targetVmSize property: The target VM size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Set the targetVmSize property: The target VM size. + * + * @param targetVmSize the targetVmSize value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetVmSize(String targetVmSize) { + this.targetVmSize = targetVmSize; + return this; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the seedManagedDiskTags property: The tags for the seed managed disks. + * + * @return the seedManagedDiskTags value. + */ + public Map seedManagedDiskTags() { + return this.seedManagedDiskTags; + } + + /** + * Set the seedManagedDiskTags property: The tags for the seed managed disks. + * + * @param seedManagedDiskTags the seedManagedDiskTags value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withSeedManagedDiskTags(Map seedManagedDiskTags) { + this.seedManagedDiskTags = seedManagedDiskTags; + return this; + } + + /** + * Get the targetManagedDiskTags property: The tags for the target managed disks. + * + * @return the targetManagedDiskTags value. + */ + public Map targetManagedDiskTags() { + return this.targetManagedDiskTags; + } + + /** + * Set the targetManagedDiskTags property: The tags for the target managed disks. + * + * @param targetManagedDiskTags the targetManagedDiskTags value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetManagedDiskTags(Map targetManagedDiskTags) { + this.targetManagedDiskTags = targetManagedDiskTags; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (disksToInclude() != null) { + disksToInclude().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EventDetails.java new file mode 100644 index 000000000000..764681459a4e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EventDetails.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Model class for event details of a VMwareAzureV2 event. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2EventDetails extends EventProviderSpecificDetails { + /* + * InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. + */ + @JsonProperty(value = "eventType") + private String eventType; + + /* + * InMage Event Category. + */ + @JsonProperty(value = "category") + private String category; + + /* + * InMage Event Component. + */ + @JsonProperty(value = "component") + private String component; + + /* + * Corrective Action string for the event. + */ + @JsonProperty(value = "correctiveAction") + private String correctiveAction; + + /* + * InMage Event Details. + */ + @JsonProperty(value = "details") + private String details; + + /* + * InMage Event Summary. + */ + @JsonProperty(value = "summary") + private String summary; + + /* + * VMware Site name. + */ + @JsonProperty(value = "siteName") + private String siteName; + + /** Creates an instance of InMageAzureV2EventDetails class. */ + public InMageAzureV2EventDetails() { + } + + /** + * Get the eventType property: InMage Event type. Takes one of the values of + * InMageDataContract.InMageMonitoringEventType. + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Set the eventType property: InMage Event type. Takes one of the values of + * InMageDataContract.InMageMonitoringEventType. + * + * @param eventType the eventType value to set. + * @return the InMageAzureV2EventDetails object itself. + */ + public InMageAzureV2EventDetails withEventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the category property: InMage Event Category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: InMage Event Category. + * + * @param category the category value to set. + * @return the InMageAzureV2EventDetails object itself. + */ + public InMageAzureV2EventDetails withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the component property: InMage Event Component. + * + * @return the component value. + */ + public String component() { + return this.component; + } + + /** + * Set the component property: InMage Event Component. + * + * @param component the component value to set. + * @return the InMageAzureV2EventDetails object itself. + */ + public InMageAzureV2EventDetails withComponent(String component) { + this.component = component; + return this; + } + + /** + * Get the correctiveAction property: Corrective Action string for the event. + * + * @return the correctiveAction value. + */ + public String correctiveAction() { + return this.correctiveAction; + } + + /** + * Set the correctiveAction property: Corrective Action string for the event. + * + * @param correctiveAction the correctiveAction value to set. + * @return the InMageAzureV2EventDetails object itself. + */ + public InMageAzureV2EventDetails withCorrectiveAction(String correctiveAction) { + this.correctiveAction = correctiveAction; + return this; + } + + /** + * Get the details property: InMage Event Details. + * + * @return the details value. + */ + public String details() { + return this.details; + } + + /** + * Set the details property: InMage Event Details. + * + * @param details the details value to set. + * @return the InMageAzureV2EventDetails object itself. + */ + public InMageAzureV2EventDetails withDetails(String details) { + this.details = details; + return this; + } + + /** + * Get the summary property: InMage Event Summary. + * + * @return the summary value. + */ + public String summary() { + return this.summary; + } + + /** + * Set the summary property: InMage Event Summary. + * + * @param summary the summary value to set. + * @return the InMageAzureV2EventDetails object itself. + */ + public InMageAzureV2EventDetails withSummary(String summary) { + this.summary = summary; + return this; + } + + /** + * Get the siteName property: VMware Site name. + * + * @return the siteName value. + */ + public String siteName() { + return this.siteName; + } + + /** + * Set the siteName property: VMware Site name. + * + * @param siteName the siteName value to set. + * @return the InMageAzureV2EventDetails object itself. + */ + public InMageAzureV2EventDetails withSiteName(String siteName) { + this.siteName = siteName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ManagedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ManagedDiskDetails.java new file mode 100644 index 000000000000..ac2ac2f0d90f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ManagedDiskDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageAzureV2 Managed disk details. */ +@Fluent +public final class InMageAzureV2ManagedDiskDetails { + /* + * The disk id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * Seed managed disk Id. + */ + @JsonProperty(value = "seedManagedDiskId") + private String seedManagedDiskId; + + /* + * The replica disk type. + */ + @JsonProperty(value = "replicaDiskType") + private String replicaDiskType; + + /* + * The DiskEncryptionSet ARM ID. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /* + * The target disk name. + */ + @JsonProperty(value = "targetDiskName") + private String targetDiskName; + + /** Creates an instance of InMageAzureV2ManagedDiskDetails class. */ + public InMageAzureV2ManagedDiskDetails() { + } + + /** + * Get the diskId property: The disk id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk id. + * + * @param diskId the diskId value to set. + * @return the InMageAzureV2ManagedDiskDetails object itself. + */ + public InMageAzureV2ManagedDiskDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the seedManagedDiskId property: Seed managed disk Id. + * + * @return the seedManagedDiskId value. + */ + public String seedManagedDiskId() { + return this.seedManagedDiskId; + } + + /** + * Set the seedManagedDiskId property: Seed managed disk Id. + * + * @param seedManagedDiskId the seedManagedDiskId value to set. + * @return the InMageAzureV2ManagedDiskDetails object itself. + */ + public InMageAzureV2ManagedDiskDetails withSeedManagedDiskId(String seedManagedDiskId) { + this.seedManagedDiskId = seedManagedDiskId; + return this; + } + + /** + * Get the replicaDiskType property: The replica disk type. + * + * @return the replicaDiskType value. + */ + public String replicaDiskType() { + return this.replicaDiskType; + } + + /** + * Set the replicaDiskType property: The replica disk type. + * + * @param replicaDiskType the replicaDiskType value to set. + * @return the InMageAzureV2ManagedDiskDetails object itself. + */ + public InMageAzureV2ManagedDiskDetails withReplicaDiskType(String replicaDiskType) { + this.replicaDiskType = replicaDiskType; + return this; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM ID. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The DiskEncryptionSet ARM ID. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the InMageAzureV2ManagedDiskDetails object itself. + */ + public InMageAzureV2ManagedDiskDetails withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Get the targetDiskName property: The target disk name. + * + * @return the targetDiskName value. + */ + public String targetDiskName() { + return this.targetDiskName; + } + + /** + * Set the targetDiskName property: The target disk name. + * + * @param targetDiskName the targetDiskName value to set. + * @return the InMageAzureV2ManagedDiskDetails object itself. + */ + public InMageAzureV2ManagedDiskDetails withTargetDiskName(String targetDiskName) { + this.targetDiskName = targetDiskName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyDetails.java new file mode 100644 index 000000000000..b8086507cdbd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyDetails.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMage Azure v2 specific protection profile details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2PolicyDetails extends PolicyProviderSpecificDetails { + /* + * The crash consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /* + * The recovery point threshold in minutes. + */ + @JsonProperty(value = "recoveryPointThresholdInMinutes") + private Integer recoveryPointThresholdInMinutes; + + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistory") + private Integer recoveryPointHistory; + + /* + * The app consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. + */ + @JsonProperty(value = "multiVmSyncStatus") + private String multiVmSyncStatus; + + /** Creates an instance of InMageAzureV2PolicyDetails class. */ + public InMageAzureV2PolicyDetails() { + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the InMageAzureV2PolicyDetails object itself. + */ + public InMageAzureV2PolicyDetails withCrashConsistentFrequencyInMinutes(Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @return the recoveryPointThresholdInMinutes value. + */ + public Integer recoveryPointThresholdInMinutes() { + return this.recoveryPointThresholdInMinutes; + } + + /** + * Set the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @param recoveryPointThresholdInMinutes the recoveryPointThresholdInMinutes value to set. + * @return the InMageAzureV2PolicyDetails object itself. + */ + public InMageAzureV2PolicyDetails withRecoveryPointThresholdInMinutes(Integer recoveryPointThresholdInMinutes) { + this.recoveryPointThresholdInMinutes = recoveryPointThresholdInMinutes; + return this; + } + + /** + * Get the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @return the recoveryPointHistory value. + */ + public Integer recoveryPointHistory() { + return this.recoveryPointHistory; + } + + /** + * Set the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @param recoveryPointHistory the recoveryPointHistory value to set. + * @return the InMageAzureV2PolicyDetails object itself. + */ + public InMageAzureV2PolicyDetails withRecoveryPointHistory(Integer recoveryPointHistory) { + this.recoveryPointHistory = recoveryPointHistory; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the InMageAzureV2PolicyDetails object itself. + */ + public InMageAzureV2PolicyDetails withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. + * + * @return the multiVmSyncStatus value. + */ + public String multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the InMageAzureV2PolicyDetails object itself. + */ + public InMageAzureV2PolicyDetails withMultiVmSyncStatus(String multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyInput.java new file mode 100644 index 000000000000..65ae42e35218 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyInput.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 Azure specific policy Input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2PolicyInput extends PolicyProviderSpecificInput { + /* + * The recovery point threshold in minutes. + */ + @JsonProperty(value = "recoveryPointThresholdInMinutes") + private Integer recoveryPointThresholdInMinutes; + + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistory") + private Integer recoveryPointHistory; + + /* + * The crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /* + * The app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. + */ + @JsonProperty(value = "multiVmSyncStatus", required = true) + private SetMultiVmSyncStatus multiVmSyncStatus; + + /** Creates an instance of InMageAzureV2PolicyInput class. */ + public InMageAzureV2PolicyInput() { + } + + /** + * Get the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @return the recoveryPointThresholdInMinutes value. + */ + public Integer recoveryPointThresholdInMinutes() { + return this.recoveryPointThresholdInMinutes; + } + + /** + * Set the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @param recoveryPointThresholdInMinutes the recoveryPointThresholdInMinutes value to set. + * @return the InMageAzureV2PolicyInput object itself. + */ + public InMageAzureV2PolicyInput withRecoveryPointThresholdInMinutes(Integer recoveryPointThresholdInMinutes) { + this.recoveryPointThresholdInMinutes = recoveryPointThresholdInMinutes; + return this; + } + + /** + * Get the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @return the recoveryPointHistory value. + */ + public Integer recoveryPointHistory() { + return this.recoveryPointHistory; + } + + /** + * Set the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @param recoveryPointHistory the recoveryPointHistory value to set. + * @return the InMageAzureV2PolicyInput object itself. + */ + public InMageAzureV2PolicyInput withRecoveryPointHistory(Integer recoveryPointHistory) { + this.recoveryPointHistory = recoveryPointHistory; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the InMageAzureV2PolicyInput object itself. + */ + public InMageAzureV2PolicyInput withCrashConsistentFrequencyInMinutes(Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the InMageAzureV2PolicyInput object itself. + */ + public InMageAzureV2PolicyInput withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. Value should be + * 'Enabled' or 'Disabled'. + * + * @return the multiVmSyncStatus value. + */ + public SetMultiVmSyncStatus multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. Value should be + * 'Enabled' or 'Disabled'. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the InMageAzureV2PolicyInput object itself. + */ + public InMageAzureV2PolicyInput withMultiVmSyncStatus(SetMultiVmSyncStatus multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (multiVmSyncStatus() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property multiVmSyncStatus in model InMageAzureV2PolicyInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageAzureV2PolicyInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ProtectedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ProtectedDiskDetails.java new file mode 100644 index 000000000000..a3d049a88b75 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ProtectedDiskDetails.java @@ -0,0 +1,625 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** InMageAzureV2 protected disk details. */ +@Fluent +public final class InMageAzureV2ProtectedDiskDetails { + /* + * The disk id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The disk name. + */ + @JsonProperty(value = "diskName") + private String diskName; + + /* + * The protection stage. + */ + @JsonProperty(value = "protectionStage") + private String protectionStage; + + /* + * The health error code for the disk. + */ + @JsonProperty(value = "healthErrorCode") + private String healthErrorCode; + + /* + * The RPO in seconds. + */ + @JsonProperty(value = "rpoInSeconds") + private Long rpoInSeconds; + + /* + * A value indicating whether resync is required for this disk. + */ + @JsonProperty(value = "resyncRequired") + private String resyncRequired; + + /* + * The resync progress percentage. + */ + @JsonProperty(value = "resyncProgressPercentage") + private Integer resyncProgressPercentage; + + /* + * The resync duration in seconds. + */ + @JsonProperty(value = "resyncDurationInSeconds") + private Long resyncDurationInSeconds; + + /* + * The disk capacity in bytes. + */ + @JsonProperty(value = "diskCapacityInBytes") + private Long diskCapacityInBytes; + + /* + * The disk file system capacity in bytes. + */ + @JsonProperty(value = "fileSystemCapacityInBytes") + private Long fileSystemCapacityInBytes; + + /* + * The source data transit in MB. + */ + @JsonProperty(value = "sourceDataInMegaBytes") + private Double sourceDataInMegaBytes; + + /* + * The PS data transit in MB. + */ + @JsonProperty(value = "psDataInMegaBytes") + private Double psDataInMegaBytes; + + /* + * The target data transit in MB. + */ + @JsonProperty(value = "targetDataInMegaBytes") + private Double targetDataInMegaBytes; + + /* + * A value indicating whether disk is resized. + */ + @JsonProperty(value = "diskResized") + private String diskResized; + + /* + * The last RPO calculated time. + */ + @JsonProperty(value = "lastRpoCalculatedTime") + private OffsetDateTime lastRpoCalculatedTime; + + /* + * The resync processed bytes. + */ + @JsonProperty(value = "resyncProcessedBytes") + private Long resyncProcessedBytes; + + /* + * The resync total transferred bytes. + */ + @JsonProperty(value = "resyncTotalTransferredBytes") + private Long resyncTotalTransferredBytes; + + /* + * The resync last 15 minutes transferred bytes. + */ + @JsonProperty(value = "resyncLast15MinutesTransferredBytes") + private Long resyncLast15MinutesTransferredBytes; + + /* + * The last data transfer time in UTC. + */ + @JsonProperty(value = "resyncLastDataTransferTimeUTC") + private OffsetDateTime resyncLastDataTransferTimeUtc; + + /* + * The resync start time. + */ + @JsonProperty(value = "resyncStartTime") + private OffsetDateTime resyncStartTime; + + /* + * The Progress Health. + */ + @JsonProperty(value = "progressHealth") + private String progressHealth; + + /* + * The Progress Status. + */ + @JsonProperty(value = "progressStatus") + private String progressStatus; + + /* + * The seconds to take for switch provider. + */ + @JsonProperty(value = "secondsToTakeSwitchProvider") + private Long secondsToTakeSwitchProvider; + + /** Creates an instance of InMageAzureV2ProtectedDiskDetails class. */ + public InMageAzureV2ProtectedDiskDetails() { + } + + /** + * Get the diskId property: The disk id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk id. + * + * @param diskId the diskId value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the diskName property: The disk name. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Set the diskName property: The disk name. + * + * @param diskName the diskName value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withDiskName(String diskName) { + this.diskName = diskName; + return this; + } + + /** + * Get the protectionStage property: The protection stage. + * + * @return the protectionStage value. + */ + public String protectionStage() { + return this.protectionStage; + } + + /** + * Set the protectionStage property: The protection stage. + * + * @param protectionStage the protectionStage value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withProtectionStage(String protectionStage) { + this.protectionStage = protectionStage; + return this; + } + + /** + * Get the healthErrorCode property: The health error code for the disk. + * + * @return the healthErrorCode value. + */ + public String healthErrorCode() { + return this.healthErrorCode; + } + + /** + * Set the healthErrorCode property: The health error code for the disk. + * + * @param healthErrorCode the healthErrorCode value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withHealthErrorCode(String healthErrorCode) { + this.healthErrorCode = healthErrorCode; + return this; + } + + /** + * Get the rpoInSeconds property: The RPO in seconds. + * + * @return the rpoInSeconds value. + */ + public Long rpoInSeconds() { + return this.rpoInSeconds; + } + + /** + * Set the rpoInSeconds property: The RPO in seconds. + * + * @param rpoInSeconds the rpoInSeconds value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withRpoInSeconds(Long rpoInSeconds) { + this.rpoInSeconds = rpoInSeconds; + return this; + } + + /** + * Get the resyncRequired property: A value indicating whether resync is required for this disk. + * + * @return the resyncRequired value. + */ + public String resyncRequired() { + return this.resyncRequired; + } + + /** + * Set the resyncRequired property: A value indicating whether resync is required for this disk. + * + * @param resyncRequired the resyncRequired value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withResyncRequired(String resyncRequired) { + this.resyncRequired = resyncRequired; + return this; + } + + /** + * Get the resyncProgressPercentage property: The resync progress percentage. + * + * @return the resyncProgressPercentage value. + */ + public Integer resyncProgressPercentage() { + return this.resyncProgressPercentage; + } + + /** + * Set the resyncProgressPercentage property: The resync progress percentage. + * + * @param resyncProgressPercentage the resyncProgressPercentage value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withResyncProgressPercentage(Integer resyncProgressPercentage) { + this.resyncProgressPercentage = resyncProgressPercentage; + return this; + } + + /** + * Get the resyncDurationInSeconds property: The resync duration in seconds. + * + * @return the resyncDurationInSeconds value. + */ + public Long resyncDurationInSeconds() { + return this.resyncDurationInSeconds; + } + + /** + * Set the resyncDurationInSeconds property: The resync duration in seconds. + * + * @param resyncDurationInSeconds the resyncDurationInSeconds value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withResyncDurationInSeconds(Long resyncDurationInSeconds) { + this.resyncDurationInSeconds = resyncDurationInSeconds; + return this; + } + + /** + * Get the diskCapacityInBytes property: The disk capacity in bytes. + * + * @return the diskCapacityInBytes value. + */ + public Long diskCapacityInBytes() { + return this.diskCapacityInBytes; + } + + /** + * Set the diskCapacityInBytes property: The disk capacity in bytes. + * + * @param diskCapacityInBytes the diskCapacityInBytes value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withDiskCapacityInBytes(Long diskCapacityInBytes) { + this.diskCapacityInBytes = diskCapacityInBytes; + return this; + } + + /** + * Get the fileSystemCapacityInBytes property: The disk file system capacity in bytes. + * + * @return the fileSystemCapacityInBytes value. + */ + public Long fileSystemCapacityInBytes() { + return this.fileSystemCapacityInBytes; + } + + /** + * Set the fileSystemCapacityInBytes property: The disk file system capacity in bytes. + * + * @param fileSystemCapacityInBytes the fileSystemCapacityInBytes value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withFileSystemCapacityInBytes(Long fileSystemCapacityInBytes) { + this.fileSystemCapacityInBytes = fileSystemCapacityInBytes; + return this; + } + + /** + * Get the sourceDataInMegaBytes property: The source data transit in MB. + * + * @return the sourceDataInMegaBytes value. + */ + public Double sourceDataInMegaBytes() { + return this.sourceDataInMegaBytes; + } + + /** + * Set the sourceDataInMegaBytes property: The source data transit in MB. + * + * @param sourceDataInMegaBytes the sourceDataInMegaBytes value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withSourceDataInMegaBytes(Double sourceDataInMegaBytes) { + this.sourceDataInMegaBytes = sourceDataInMegaBytes; + return this; + } + + /** + * Get the psDataInMegaBytes property: The PS data transit in MB. + * + * @return the psDataInMegaBytes value. + */ + public Double psDataInMegaBytes() { + return this.psDataInMegaBytes; + } + + /** + * Set the psDataInMegaBytes property: The PS data transit in MB. + * + * @param psDataInMegaBytes the psDataInMegaBytes value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withPsDataInMegaBytes(Double psDataInMegaBytes) { + this.psDataInMegaBytes = psDataInMegaBytes; + return this; + } + + /** + * Get the targetDataInMegaBytes property: The target data transit in MB. + * + * @return the targetDataInMegaBytes value. + */ + public Double targetDataInMegaBytes() { + return this.targetDataInMegaBytes; + } + + /** + * Set the targetDataInMegaBytes property: The target data transit in MB. + * + * @param targetDataInMegaBytes the targetDataInMegaBytes value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withTargetDataInMegaBytes(Double targetDataInMegaBytes) { + this.targetDataInMegaBytes = targetDataInMegaBytes; + return this; + } + + /** + * Get the diskResized property: A value indicating whether disk is resized. + * + * @return the diskResized value. + */ + public String diskResized() { + return this.diskResized; + } + + /** + * Set the diskResized property: A value indicating whether disk is resized. + * + * @param diskResized the diskResized value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withDiskResized(String diskResized) { + this.diskResized = diskResized; + return this; + } + + /** + * Get the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @return the lastRpoCalculatedTime value. + */ + public OffsetDateTime lastRpoCalculatedTime() { + return this.lastRpoCalculatedTime; + } + + /** + * Set the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @param lastRpoCalculatedTime the lastRpoCalculatedTime value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withLastRpoCalculatedTime(OffsetDateTime lastRpoCalculatedTime) { + this.lastRpoCalculatedTime = lastRpoCalculatedTime; + return this; + } + + /** + * Get the resyncProcessedBytes property: The resync processed bytes. + * + * @return the resyncProcessedBytes value. + */ + public Long resyncProcessedBytes() { + return this.resyncProcessedBytes; + } + + /** + * Set the resyncProcessedBytes property: The resync processed bytes. + * + * @param resyncProcessedBytes the resyncProcessedBytes value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withResyncProcessedBytes(Long resyncProcessedBytes) { + this.resyncProcessedBytes = resyncProcessedBytes; + return this; + } + + /** + * Get the resyncTotalTransferredBytes property: The resync total transferred bytes. + * + * @return the resyncTotalTransferredBytes value. + */ + public Long resyncTotalTransferredBytes() { + return this.resyncTotalTransferredBytes; + } + + /** + * Set the resyncTotalTransferredBytes property: The resync total transferred bytes. + * + * @param resyncTotalTransferredBytes the resyncTotalTransferredBytes value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withResyncTotalTransferredBytes(Long resyncTotalTransferredBytes) { + this.resyncTotalTransferredBytes = resyncTotalTransferredBytes; + return this; + } + + /** + * Get the resyncLast15MinutesTransferredBytes property: The resync last 15 minutes transferred bytes. + * + * @return the resyncLast15MinutesTransferredBytes value. + */ + public Long resyncLast15MinutesTransferredBytes() { + return this.resyncLast15MinutesTransferredBytes; + } + + /** + * Set the resyncLast15MinutesTransferredBytes property: The resync last 15 minutes transferred bytes. + * + * @param resyncLast15MinutesTransferredBytes the resyncLast15MinutesTransferredBytes value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withResyncLast15MinutesTransferredBytes( + Long resyncLast15MinutesTransferredBytes) { + this.resyncLast15MinutesTransferredBytes = resyncLast15MinutesTransferredBytes; + return this; + } + + /** + * Get the resyncLastDataTransferTimeUtc property: The last data transfer time in UTC. + * + * @return the resyncLastDataTransferTimeUtc value. + */ + public OffsetDateTime resyncLastDataTransferTimeUtc() { + return this.resyncLastDataTransferTimeUtc; + } + + /** + * Set the resyncLastDataTransferTimeUtc property: The last data transfer time in UTC. + * + * @param resyncLastDataTransferTimeUtc the resyncLastDataTransferTimeUtc value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withResyncLastDataTransferTimeUtc( + OffsetDateTime resyncLastDataTransferTimeUtc) { + this.resyncLastDataTransferTimeUtc = resyncLastDataTransferTimeUtc; + return this; + } + + /** + * Get the resyncStartTime property: The resync start time. + * + * @return the resyncStartTime value. + */ + public OffsetDateTime resyncStartTime() { + return this.resyncStartTime; + } + + /** + * Set the resyncStartTime property: The resync start time. + * + * @param resyncStartTime the resyncStartTime value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withResyncStartTime(OffsetDateTime resyncStartTime) { + this.resyncStartTime = resyncStartTime; + return this; + } + + /** + * Get the progressHealth property: The Progress Health. + * + * @return the progressHealth value. + */ + public String progressHealth() { + return this.progressHealth; + } + + /** + * Set the progressHealth property: The Progress Health. + * + * @param progressHealth the progressHealth value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withProgressHealth(String progressHealth) { + this.progressHealth = progressHealth; + return this; + } + + /** + * Get the progressStatus property: The Progress Status. + * + * @return the progressStatus value. + */ + public String progressStatus() { + return this.progressStatus; + } + + /** + * Set the progressStatus property: The Progress Status. + * + * @param progressStatus the progressStatus value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withProgressStatus(String progressStatus) { + this.progressStatus = progressStatus; + return this; + } + + /** + * Get the secondsToTakeSwitchProvider property: The seconds to take for switch provider. + * + * @return the secondsToTakeSwitchProvider value. + */ + public Long secondsToTakeSwitchProvider() { + return this.secondsToTakeSwitchProvider; + } + + /** + * Set the secondsToTakeSwitchProvider property: The seconds to take for switch provider. + * + * @param secondsToTakeSwitchProvider the secondsToTakeSwitchProvider value to set. + * @return the InMageAzureV2ProtectedDiskDetails object itself. + */ + public InMageAzureV2ProtectedDiskDetails withSecondsToTakeSwitchProvider(Long secondsToTakeSwitchProvider) { + this.secondsToTakeSwitchProvider = secondsToTakeSwitchProvider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2RecoveryPointDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2RecoveryPointDetails.java new file mode 100644 index 000000000000..7e9914f91616 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2RecoveryPointDetails.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.recoveryservicessiterecovery.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; + +/** InMage Azure V2 provider specific recovery point details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2RecoveryPointDetails extends ProviderSpecificRecoveryPointDetails { + /* + * A value indicating whether the recovery point is multi VM consistent. + */ + @JsonProperty(value = "isMultiVmSyncPoint") + private String isMultiVmSyncPoint; + + /** Creates an instance of InMageAzureV2RecoveryPointDetails class. */ + public InMageAzureV2RecoveryPointDetails() { + } + + /** + * Get the isMultiVmSyncPoint property: A value indicating whether the recovery point is multi VM consistent. + * + * @return the isMultiVmSyncPoint value. + */ + public String isMultiVmSyncPoint() { + return this.isMultiVmSyncPoint; + } + + /** + * Set the isMultiVmSyncPoint property: A value indicating whether the recovery point is multi VM consistent. + * + * @param isMultiVmSyncPoint the isMultiVmSyncPoint value to set. + * @return the InMageAzureV2RecoveryPointDetails object itself. + */ + public InMageAzureV2RecoveryPointDetails withIsMultiVmSyncPoint(String isMultiVmSyncPoint) { + this.isMultiVmSyncPoint = isMultiVmSyncPoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReplicationDetails.java new file mode 100644 index 000000000000..a85b0ca1b544 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReplicationDetails.java @@ -0,0 +1,1813 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +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; +import java.util.Map; + +/** InMageAzureV2 provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2ReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * The infrastructure VM Id. + */ + @JsonProperty(value = "infrastructureVmId") + private String infrastructureVmId; + + /* + * The vCenter infrastructure Id. + */ + @JsonProperty(value = "vCenterInfrastructureId") + private String vCenterInfrastructureId; + + /* + * The protection stage. + */ + @JsonProperty(value = "protectionStage") + private String protectionStage; + + /* + * The virtual machine Id. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * The protection state for the vm. + */ + @JsonProperty(value = "vmProtectionState") + private String vmProtectionState; + + /* + * The protection state description for the vm. + */ + @JsonProperty(value = "vmProtectionStateDescription") + private String vmProtectionStateDescription; + + /* + * The resync progress percentage. + */ + @JsonProperty(value = "resyncProgressPercentage") + private Integer resyncProgressPercentage; + + /* + * The RPO in seconds. + */ + @JsonProperty(value = "rpoInSeconds") + private Long rpoInSeconds; + + /* + * The compressed data change rate in MB. + */ + @JsonProperty(value = "compressedDataRateInMB") + private Double compressedDataRateInMB; + + /* + * The uncompressed data change rate in MB. + */ + @JsonProperty(value = "uncompressedDataRateInMB") + private Double uncompressedDataRateInMB; + + /* + * The source IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The agent version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * Agent expiry date. + */ + @JsonProperty(value = "agentExpiryDate") + private OffsetDateTime agentExpiryDate; + + /* + * A value indicating whether installed agent needs to be updated. + */ + @JsonProperty(value = "isAgentUpdateRequired") + private String isAgentUpdateRequired; + + /* + * A value indicating whether the source server requires a restart after update. + */ + @JsonProperty(value = "isRebootAfterUpdateRequired") + private String isRebootAfterUpdateRequired; + + /* + * The last heartbeat received from the source server. + */ + @JsonProperty(value = "lastHeartbeat") + private OffsetDateTime lastHeartbeat; + + /* + * The process server Id. + */ + @JsonProperty(value = "processServerId") + private String processServerId; + + /* + * The process server name. + */ + @JsonProperty(value = "processServerName") + private String processServerName; + + /* + * The multi vm group Id. + */ + @JsonProperty(value = "multiVmGroupId") + private String multiVmGroupId; + + /* + * The multi vm group name. + */ + @JsonProperty(value = "multiVmGroupName") + private String multiVmGroupName; + + /* + * A value indicating whether multi vm sync is enabled or disabled. + */ + @JsonProperty(value = "multiVmSyncStatus") + private String multiVmSyncStatus; + + /* + * The list of protected disks. + */ + @JsonProperty(value = "protectedDisks") + private List protectedDisks; + + /* + * A value indicating whether any disk is resized for this VM. + */ + @JsonProperty(value = "diskResized") + private String diskResized; + + /* + * The master target Id. + */ + @JsonProperty(value = "masterTargetId") + private String masterTargetId; + + /* + * The CPU count of the VM on the primary side. + */ + @JsonProperty(value = "sourceVmCpuCount") + private Integer sourceVmCpuCount; + + /* + * The RAM size of the VM on the primary side. + */ + @JsonProperty(value = "sourceVmRamSizeInMB") + private Integer sourceVmRamSizeInMB; + + /* + * The type of the OS on the VM. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The OS disk VHD name. + */ + @JsonProperty(value = "vhdName") + private String vhdName; + + /* + * The id of the disk containing the OS. + */ + @JsonProperty(value = "osDiskId") + private String osDiskId; + + /* + * Azure VM Disk details. + */ + @JsonProperty(value = "azureVMDiskDetails") + private List azureVMDiskDetails; + + /* + * Recovery Azure given name. + */ + @JsonProperty(value = "recoveryAzureVMName") + private String recoveryAzureVMName; + + /* + * The Recovery Azure VM size. + */ + @JsonProperty(value = "recoveryAzureVMSize") + private String recoveryAzureVMSize; + + /* + * The recovery Azure storage account. + */ + @JsonProperty(value = "recoveryAzureStorageAccount") + private String recoveryAzureStorageAccount; + + /* + * The ARM id of the log storage account used for replication. This will be set to null if no log storage account + * was provided during enable protection. + */ + @JsonProperty(value = "recoveryAzureLogStorageAccountId") + private String recoveryAzureLogStorageAccountId; + + /* + * The PE Network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The selected recovery azure network Id. + */ + @JsonProperty(value = "selectedRecoveryAzureNetworkId") + private String selectedRecoveryAzureNetworkId; + + /* + * The test failover virtual network. + */ + @JsonProperty(value = "selectedTfoAzureNetworkId") + private String selectedTfoAzureNetworkId; + + /* + * The selected source nic Id which will be used as the primary nic during failover. + */ + @JsonProperty(value = "selectedSourceNicId") + private String selectedSourceNicId; + + /* + * A value indicating the discovery type of the machine. Value can be vCenter or physical. + */ + @JsonProperty(value = "discoveryType") + private String discoveryType; + + /* + * The selected option to enable RDP\SSH on target vm after failover. String value of + * SrsDataContract.EnableRDPOnTargetOption enum. + */ + @JsonProperty(value = "enableRdpOnTargetOption") + private String enableRdpOnTargetOption; + + /* + * The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + */ + @JsonProperty(value = "datastores") + private List datastores; + + /* + * The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it + * will be populated with the ARM Id of the Azure VM. + */ + @JsonProperty(value = "targetVmId") + private String targetVmId; + + /* + * The target resource group Id. + */ + @JsonProperty(value = "recoveryAzureResourceGroupId") + private String recoveryAzureResourceGroupId; + + /* + * The recovery availability set Id. + */ + @JsonProperty(value = "recoveryAvailabilitySetId") + private String recoveryAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * A value indicating whether managed disks should be used during failover. + */ + @JsonProperty(value = "useManagedDisks") + private String useManagedDisks; + + /* + * License Type of the VM to be used. + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private String sqlServerLicenseType; + + /* + * The validation errors of the on-premise machine Value can be list of validation errors. + */ + @JsonProperty(value = "validationErrors") + private List validationErrors; + + /* + * The last RPO calculated time. + */ + @JsonProperty(value = "lastRpoCalculatedTime") + private OffsetDateTime lastRpoCalculatedTime; + + /* + * The last update time received from on-prem components. + */ + @JsonProperty(value = "lastUpdateReceivedTime") + private OffsetDateTime lastUpdateReceivedTime; + + /* + * The replica id of the protected item. + */ + @JsonProperty(value = "replicaId") + private String replicaId; + + /* + * The OS Version of the protected item. + */ + @JsonProperty(value = "osVersion") + private String osVersion; + + /* + * The list of protected managed disks. + */ + @JsonProperty(value = "protectedManagedDisks") + private List protectedManagedDisks; + + /* + * The last recovery point received time. + */ + @JsonProperty(value = "lastRecoveryPointReceived", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastRecoveryPointReceived; + + /* + * The firmware type of this protected item. + */ + @JsonProperty(value = "firmwareType") + private String firmwareType; + + /* + * The target generation for this protected item. + */ + @JsonProperty(value = "azureVmGeneration") + private String azureVmGeneration; + + /* + * A value indicating whether additional IR stats are available or not. + */ + @JsonProperty(value = "isAdditionalStatsAvailable") + private Boolean isAdditionalStatsAvailable; + + /* + * The total transferred data in bytes. + */ + @JsonProperty(value = "totalDataTransferred") + private Long totalDataTransferred; + + /* + * The progress health. + */ + @JsonProperty(value = "totalProgressHealth") + private String totalProgressHealth; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The tags for the seed managed disks. + */ + @JsonProperty(value = "seedManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map seedManagedDiskTags; + + /* + * The tags for the target managed disks. + */ + @JsonProperty(value = "targetManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetManagedDiskTags; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /* + * The switch provider blocking error information. + */ + @JsonProperty(value = "switchProviderBlockingErrorDetails") + private List switchProviderBlockingErrorDetails; + + /* + * The switch provider blocking error information. + */ + @JsonProperty(value = "switchProviderDetails") + private InMageAzureV2SwitchProviderDetails switchProviderDetails; + + /** Creates an instance of InMageAzureV2ReplicationDetails class. */ + public InMageAzureV2ReplicationDetails() { + } + + /** + * Get the infrastructureVmId property: The infrastructure VM Id. + * + * @return the infrastructureVmId value. + */ + public String infrastructureVmId() { + return this.infrastructureVmId; + } + + /** + * Set the infrastructureVmId property: The infrastructure VM Id. + * + * @param infrastructureVmId the infrastructureVmId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withInfrastructureVmId(String infrastructureVmId) { + this.infrastructureVmId = infrastructureVmId; + return this; + } + + /** + * Get the vCenterInfrastructureId property: The vCenter infrastructure Id. + * + * @return the vCenterInfrastructureId value. + */ + public String vCenterInfrastructureId() { + return this.vCenterInfrastructureId; + } + + /** + * Set the vCenterInfrastructureId property: The vCenter infrastructure Id. + * + * @param vCenterInfrastructureId the vCenterInfrastructureId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withVCenterInfrastructureId(String vCenterInfrastructureId) { + this.vCenterInfrastructureId = vCenterInfrastructureId; + return this; + } + + /** + * Get the protectionStage property: The protection stage. + * + * @return the protectionStage value. + */ + public String protectionStage() { + return this.protectionStage; + } + + /** + * Set the protectionStage property: The protection stage. + * + * @param protectionStage the protectionStage value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withProtectionStage(String protectionStage) { + this.protectionStage = protectionStage; + return this; + } + + /** + * Get the vmId property: The virtual machine Id. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: The virtual machine Id. + * + * @param vmId the vmId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the vmProtectionState property: The protection state for the vm. + * + * @return the vmProtectionState value. + */ + public String vmProtectionState() { + return this.vmProtectionState; + } + + /** + * Set the vmProtectionState property: The protection state for the vm. + * + * @param vmProtectionState the vmProtectionState value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withVmProtectionState(String vmProtectionState) { + this.vmProtectionState = vmProtectionState; + return this; + } + + /** + * Get the vmProtectionStateDescription property: The protection state description for the vm. + * + * @return the vmProtectionStateDescription value. + */ + public String vmProtectionStateDescription() { + return this.vmProtectionStateDescription; + } + + /** + * Set the vmProtectionStateDescription property: The protection state description for the vm. + * + * @param vmProtectionStateDescription the vmProtectionStateDescription value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withVmProtectionStateDescription(String vmProtectionStateDescription) { + this.vmProtectionStateDescription = vmProtectionStateDescription; + return this; + } + + /** + * Get the resyncProgressPercentage property: The resync progress percentage. + * + * @return the resyncProgressPercentage value. + */ + public Integer resyncProgressPercentage() { + return this.resyncProgressPercentage; + } + + /** + * Set the resyncProgressPercentage property: The resync progress percentage. + * + * @param resyncProgressPercentage the resyncProgressPercentage value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withResyncProgressPercentage(Integer resyncProgressPercentage) { + this.resyncProgressPercentage = resyncProgressPercentage; + return this; + } + + /** + * Get the rpoInSeconds property: The RPO in seconds. + * + * @return the rpoInSeconds value. + */ + public Long rpoInSeconds() { + return this.rpoInSeconds; + } + + /** + * Set the rpoInSeconds property: The RPO in seconds. + * + * @param rpoInSeconds the rpoInSeconds value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withRpoInSeconds(Long rpoInSeconds) { + this.rpoInSeconds = rpoInSeconds; + return this; + } + + /** + * Get the compressedDataRateInMB property: The compressed data change rate in MB. + * + * @return the compressedDataRateInMB value. + */ + public Double compressedDataRateInMB() { + return this.compressedDataRateInMB; + } + + /** + * Set the compressedDataRateInMB property: The compressed data change rate in MB. + * + * @param compressedDataRateInMB the compressedDataRateInMB value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withCompressedDataRateInMB(Double compressedDataRateInMB) { + this.compressedDataRateInMB = compressedDataRateInMB; + return this; + } + + /** + * Get the uncompressedDataRateInMB property: The uncompressed data change rate in MB. + * + * @return the uncompressedDataRateInMB value. + */ + public Double uncompressedDataRateInMB() { + return this.uncompressedDataRateInMB; + } + + /** + * Set the uncompressedDataRateInMB property: The uncompressed data change rate in MB. + * + * @param uncompressedDataRateInMB the uncompressedDataRateInMB value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withUncompressedDataRateInMB(Double uncompressedDataRateInMB) { + this.uncompressedDataRateInMB = uncompressedDataRateInMB; + return this; + } + + /** + * Get the ipAddress property: The source IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The source IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the agentVersion property: The agent version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The agent version. + * + * @param agentVersion the agentVersion value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the agentExpiryDate property: Agent expiry date. + * + * @return the agentExpiryDate value. + */ + public OffsetDateTime agentExpiryDate() { + return this.agentExpiryDate; + } + + /** + * Set the agentExpiryDate property: Agent expiry date. + * + * @param agentExpiryDate the agentExpiryDate value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withAgentExpiryDate(OffsetDateTime agentExpiryDate) { + this.agentExpiryDate = agentExpiryDate; + return this; + } + + /** + * Get the isAgentUpdateRequired property: A value indicating whether installed agent needs to be updated. + * + * @return the isAgentUpdateRequired value. + */ + public String isAgentUpdateRequired() { + return this.isAgentUpdateRequired; + } + + /** + * Set the isAgentUpdateRequired property: A value indicating whether installed agent needs to be updated. + * + * @param isAgentUpdateRequired the isAgentUpdateRequired value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withIsAgentUpdateRequired(String isAgentUpdateRequired) { + this.isAgentUpdateRequired = isAgentUpdateRequired; + return this; + } + + /** + * Get the isRebootAfterUpdateRequired property: A value indicating whether the source server requires a restart + * after update. + * + * @return the isRebootAfterUpdateRequired value. + */ + public String isRebootAfterUpdateRequired() { + return this.isRebootAfterUpdateRequired; + } + + /** + * Set the isRebootAfterUpdateRequired property: A value indicating whether the source server requires a restart + * after update. + * + * @param isRebootAfterUpdateRequired the isRebootAfterUpdateRequired value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withIsRebootAfterUpdateRequired(String isRebootAfterUpdateRequired) { + this.isRebootAfterUpdateRequired = isRebootAfterUpdateRequired; + return this; + } + + /** + * Get the lastHeartbeat property: The last heartbeat received from the source server. + * + * @return the lastHeartbeat value. + */ + public OffsetDateTime lastHeartbeat() { + return this.lastHeartbeat; + } + + /** + * Set the lastHeartbeat property: The last heartbeat received from the source server. + * + * @param lastHeartbeat the lastHeartbeat value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withLastHeartbeat(OffsetDateTime lastHeartbeat) { + this.lastHeartbeat = lastHeartbeat; + return this; + } + + /** + * Get the processServerId property: The process server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The process server Id. + * + * @param processServerId the processServerId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the processServerName property: The process server name. + * + * @return the processServerName value. + */ + public String processServerName() { + return this.processServerName; + } + + /** + * Set the processServerName property: The process server name. + * + * @param processServerName the processServerName value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withProcessServerName(String processServerName) { + this.processServerName = processServerName; + return this; + } + + /** + * Get the multiVmGroupId property: The multi vm group Id. + * + * @return the multiVmGroupId value. + */ + public String multiVmGroupId() { + return this.multiVmGroupId; + } + + /** + * Set the multiVmGroupId property: The multi vm group Id. + * + * @param multiVmGroupId the multiVmGroupId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withMultiVmGroupId(String multiVmGroupId) { + this.multiVmGroupId = multiVmGroupId; + return this; + } + + /** + * Get the multiVmGroupName property: The multi vm group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Set the multiVmGroupName property: The multi vm group name. + * + * @param multiVmGroupName the multiVmGroupName value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withMultiVmGroupName(String multiVmGroupName) { + this.multiVmGroupName = multiVmGroupName; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether multi vm sync is enabled or disabled. + * + * @return the multiVmSyncStatus value. + */ + public String multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether multi vm sync is enabled or disabled. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withMultiVmSyncStatus(String multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Get the protectedDisks property: The list of protected disks. + * + * @return the protectedDisks value. + */ + public List protectedDisks() { + return this.protectedDisks; + } + + /** + * Set the protectedDisks property: The list of protected disks. + * + * @param protectedDisks the protectedDisks value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withProtectedDisks(List protectedDisks) { + this.protectedDisks = protectedDisks; + return this; + } + + /** + * Get the diskResized property: A value indicating whether any disk is resized for this VM. + * + * @return the diskResized value. + */ + public String diskResized() { + return this.diskResized; + } + + /** + * Set the diskResized property: A value indicating whether any disk is resized for this VM. + * + * @param diskResized the diskResized value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withDiskResized(String diskResized) { + this.diskResized = diskResized; + return this; + } + + /** + * Get the masterTargetId property: The master target Id. + * + * @return the masterTargetId value. + */ + public String masterTargetId() { + return this.masterTargetId; + } + + /** + * Set the masterTargetId property: The master target Id. + * + * @param masterTargetId the masterTargetId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withMasterTargetId(String masterTargetId) { + this.masterTargetId = masterTargetId; + return this; + } + + /** + * Get the sourceVmCpuCount property: The CPU count of the VM on the primary side. + * + * @return the sourceVmCpuCount value. + */ + public Integer sourceVmCpuCount() { + return this.sourceVmCpuCount; + } + + /** + * Set the sourceVmCpuCount property: The CPU count of the VM on the primary side. + * + * @param sourceVmCpuCount the sourceVmCpuCount value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withSourceVmCpuCount(Integer sourceVmCpuCount) { + this.sourceVmCpuCount = sourceVmCpuCount; + return this; + } + + /** + * Get the sourceVmRamSizeInMB property: The RAM size of the VM on the primary side. + * + * @return the sourceVmRamSizeInMB value. + */ + public Integer sourceVmRamSizeInMB() { + return this.sourceVmRamSizeInMB; + } + + /** + * Set the sourceVmRamSizeInMB property: The RAM size of the VM on the primary side. + * + * @param sourceVmRamSizeInMB the sourceVmRamSizeInMB value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withSourceVmRamSizeInMB(Integer sourceVmRamSizeInMB) { + this.sourceVmRamSizeInMB = sourceVmRamSizeInMB; + return this; + } + + /** + * Get the osType property: The type of the OS on the VM. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The type of the OS on the VM. + * + * @param osType the osType value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the vhdName property: The OS disk VHD name. + * + * @return the vhdName value. + */ + public String vhdName() { + return this.vhdName; + } + + /** + * Set the vhdName property: The OS disk VHD name. + * + * @param vhdName the vhdName value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withVhdName(String vhdName) { + this.vhdName = vhdName; + return this; + } + + /** + * Get the osDiskId property: The id of the disk containing the OS. + * + * @return the osDiskId value. + */ + public String osDiskId() { + return this.osDiskId; + } + + /** + * Set the osDiskId property: The id of the disk containing the OS. + * + * @param osDiskId the osDiskId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withOsDiskId(String osDiskId) { + this.osDiskId = osDiskId; + return this; + } + + /** + * Get the azureVMDiskDetails property: Azure VM Disk details. + * + * @return the azureVMDiskDetails value. + */ + public List azureVMDiskDetails() { + return this.azureVMDiskDetails; + } + + /** + * Set the azureVMDiskDetails property: Azure VM Disk details. + * + * @param azureVMDiskDetails the azureVMDiskDetails value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withAzureVMDiskDetails(List azureVMDiskDetails) { + this.azureVMDiskDetails = azureVMDiskDetails; + return this; + } + + /** + * Get the recoveryAzureVMName property: Recovery Azure given name. + * + * @return the recoveryAzureVMName value. + */ + public String recoveryAzureVMName() { + return this.recoveryAzureVMName; + } + + /** + * Set the recoveryAzureVMName property: Recovery Azure given name. + * + * @param recoveryAzureVMName the recoveryAzureVMName value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withRecoveryAzureVMName(String recoveryAzureVMName) { + this.recoveryAzureVMName = recoveryAzureVMName; + return this; + } + + /** + * Get the recoveryAzureVMSize property: The Recovery Azure VM size. + * + * @return the recoveryAzureVMSize value. + */ + public String recoveryAzureVMSize() { + return this.recoveryAzureVMSize; + } + + /** + * Set the recoveryAzureVMSize property: The Recovery Azure VM size. + * + * @param recoveryAzureVMSize the recoveryAzureVMSize value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withRecoveryAzureVMSize(String recoveryAzureVMSize) { + this.recoveryAzureVMSize = recoveryAzureVMSize; + return this; + } + + /** + * Get the recoveryAzureStorageAccount property: The recovery Azure storage account. + * + * @return the recoveryAzureStorageAccount value. + */ + public String recoveryAzureStorageAccount() { + return this.recoveryAzureStorageAccount; + } + + /** + * Set the recoveryAzureStorageAccount property: The recovery Azure storage account. + * + * @param recoveryAzureStorageAccount the recoveryAzureStorageAccount value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withRecoveryAzureStorageAccount(String recoveryAzureStorageAccount) { + this.recoveryAzureStorageAccount = recoveryAzureStorageAccount; + return this; + } + + /** + * Get the recoveryAzureLogStorageAccountId property: The ARM id of the log storage account used for replication. + * This will be set to null if no log storage account was provided during enable protection. + * + * @return the recoveryAzureLogStorageAccountId value. + */ + public String recoveryAzureLogStorageAccountId() { + return this.recoveryAzureLogStorageAccountId; + } + + /** + * Set the recoveryAzureLogStorageAccountId property: The ARM id of the log storage account used for replication. + * This will be set to null if no log storage account was provided during enable protection. + * + * @param recoveryAzureLogStorageAccountId the recoveryAzureLogStorageAccountId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withRecoveryAzureLogStorageAccountId( + String recoveryAzureLogStorageAccountId) { + this.recoveryAzureLogStorageAccountId = recoveryAzureLogStorageAccountId; + return this; + } + + /** + * Get the vmNics property: The PE Network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The PE Network details. + * + * @param vmNics the vmNics value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the selectedRecoveryAzureNetworkId property: The selected recovery azure network Id. + * + * @return the selectedRecoveryAzureNetworkId value. + */ + public String selectedRecoveryAzureNetworkId() { + return this.selectedRecoveryAzureNetworkId; + } + + /** + * Set the selectedRecoveryAzureNetworkId property: The selected recovery azure network Id. + * + * @param selectedRecoveryAzureNetworkId the selectedRecoveryAzureNetworkId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withSelectedRecoveryAzureNetworkId(String selectedRecoveryAzureNetworkId) { + this.selectedRecoveryAzureNetworkId = selectedRecoveryAzureNetworkId; + return this; + } + + /** + * Get the selectedTfoAzureNetworkId property: The test failover virtual network. + * + * @return the selectedTfoAzureNetworkId value. + */ + public String selectedTfoAzureNetworkId() { + return this.selectedTfoAzureNetworkId; + } + + /** + * Set the selectedTfoAzureNetworkId property: The test failover virtual network. + * + * @param selectedTfoAzureNetworkId the selectedTfoAzureNetworkId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withSelectedTfoAzureNetworkId(String selectedTfoAzureNetworkId) { + this.selectedTfoAzureNetworkId = selectedTfoAzureNetworkId; + return this; + } + + /** + * Get the selectedSourceNicId property: The selected source nic Id which will be used as the primary nic during + * failover. + * + * @return the selectedSourceNicId value. + */ + public String selectedSourceNicId() { + return this.selectedSourceNicId; + } + + /** + * Set the selectedSourceNicId property: The selected source nic Id which will be used as the primary nic during + * failover. + * + * @param selectedSourceNicId the selectedSourceNicId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withSelectedSourceNicId(String selectedSourceNicId) { + this.selectedSourceNicId = selectedSourceNicId; + return this; + } + + /** + * Get the discoveryType property: A value indicating the discovery type of the machine. Value can be vCenter or + * physical. + * + * @return the discoveryType value. + */ + public String discoveryType() { + return this.discoveryType; + } + + /** + * Set the discoveryType property: A value indicating the discovery type of the machine. Value can be vCenter or + * physical. + * + * @param discoveryType the discoveryType value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withDiscoveryType(String discoveryType) { + this.discoveryType = discoveryType; + return this; + } + + /** + * Get the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target vm after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @return the enableRdpOnTargetOption value. + */ + public String enableRdpOnTargetOption() { + return this.enableRdpOnTargetOption; + } + + /** + * Set the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target vm after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @param enableRdpOnTargetOption the enableRdpOnTargetOption value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withEnableRdpOnTargetOption(String enableRdpOnTargetOption) { + this.enableRdpOnTargetOption = enableRdpOnTargetOption; + return this; + } + + /** + * Get the datastores property: The datastores of the on-premise machine. Value can be list of strings that contain + * datastore names. + * + * @return the datastores value. + */ + public List datastores() { + return this.datastores; + } + + /** + * Set the datastores property: The datastores of the on-premise machine. Value can be list of strings that contain + * datastore names. + * + * @param datastores the datastores value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withDatastores(List datastores) { + this.datastores = datastores; + return this; + } + + /** + * Get the targetVmId property: The ARM Id of the target Azure VM. This value will be null until the VM is failed + * over. Only after failure it will be populated with the ARM Id of the Azure VM. + * + * @return the targetVmId value. + */ + public String targetVmId() { + return this.targetVmId; + } + + /** + * Set the targetVmId property: The ARM Id of the target Azure VM. This value will be null until the VM is failed + * over. Only after failure it will be populated with the ARM Id of the Azure VM. + * + * @param targetVmId the targetVmId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withTargetVmId(String targetVmId) { + this.targetVmId = targetVmId; + return this; + } + + /** + * Get the recoveryAzureResourceGroupId property: The target resource group Id. + * + * @return the recoveryAzureResourceGroupId value. + */ + public String recoveryAzureResourceGroupId() { + return this.recoveryAzureResourceGroupId; + } + + /** + * Set the recoveryAzureResourceGroupId property: The target resource group Id. + * + * @param recoveryAzureResourceGroupId the recoveryAzureResourceGroupId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withRecoveryAzureResourceGroupId(String recoveryAzureResourceGroupId) { + this.recoveryAzureResourceGroupId = recoveryAzureResourceGroupId; + return this; + } + + /** + * Get the recoveryAvailabilitySetId property: The recovery availability set Id. + * + * @return the recoveryAvailabilitySetId value. + */ + public String recoveryAvailabilitySetId() { + return this.recoveryAvailabilitySetId; + } + + /** + * Set the recoveryAvailabilitySetId property: The recovery availability set Id. + * + * @param recoveryAvailabilitySetId the recoveryAvailabilitySetId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withRecoveryAvailabilitySetId(String recoveryAvailabilitySetId) { + this.recoveryAvailabilitySetId = recoveryAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withTargetProximityPlacementGroupId(String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @return the useManagedDisks value. + */ + public String useManagedDisks() { + return this.useManagedDisks; + } + + /** + * Set the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @param useManagedDisks the useManagedDisks value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withUseManagedDisks(String useManagedDisks) { + this.useManagedDisks = useManagedDisks; + return this; + } + + /** + * Get the licenseType property: License Type of the VM to be used. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: License Type of the VM to be used. + * + * @param licenseType the licenseType value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public String sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withSqlServerLicenseType(String sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the validationErrors property: The validation errors of the on-premise machine Value can be list of + * validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Set the validationErrors property: The validation errors of the on-premise machine Value can be list of + * validation errors. + * + * @param validationErrors the validationErrors value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withValidationErrors(List validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Get the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @return the lastRpoCalculatedTime value. + */ + public OffsetDateTime lastRpoCalculatedTime() { + return this.lastRpoCalculatedTime; + } + + /** + * Set the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @param lastRpoCalculatedTime the lastRpoCalculatedTime value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withLastRpoCalculatedTime(OffsetDateTime lastRpoCalculatedTime) { + this.lastRpoCalculatedTime = lastRpoCalculatedTime; + return this; + } + + /** + * Get the lastUpdateReceivedTime property: The last update time received from on-prem components. + * + * @return the lastUpdateReceivedTime value. + */ + public OffsetDateTime lastUpdateReceivedTime() { + return this.lastUpdateReceivedTime; + } + + /** + * Set the lastUpdateReceivedTime property: The last update time received from on-prem components. + * + * @param lastUpdateReceivedTime the lastUpdateReceivedTime value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withLastUpdateReceivedTime(OffsetDateTime lastUpdateReceivedTime) { + this.lastUpdateReceivedTime = lastUpdateReceivedTime; + return this; + } + + /** + * Get the replicaId property: The replica id of the protected item. + * + * @return the replicaId value. + */ + public String replicaId() { + return this.replicaId; + } + + /** + * Set the replicaId property: The replica id of the protected item. + * + * @param replicaId the replicaId value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withReplicaId(String replicaId) { + this.replicaId = replicaId; + return this; + } + + /** + * Get the osVersion property: The OS Version of the protected item. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Set the osVersion property: The OS Version of the protected item. + * + * @param osVersion the osVersion value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withOsVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get the protectedManagedDisks property: The list of protected managed disks. + * + * @return the protectedManagedDisks value. + */ + public List protectedManagedDisks() { + return this.protectedManagedDisks; + } + + /** + * Set the protectedManagedDisks property: The list of protected managed disks. + * + * @param protectedManagedDisks the protectedManagedDisks value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withProtectedManagedDisks( + List protectedManagedDisks) { + this.protectedManagedDisks = protectedManagedDisks; + return this; + } + + /** + * Get the lastRecoveryPointReceived property: The last recovery point received time. + * + * @return the lastRecoveryPointReceived value. + */ + public OffsetDateTime lastRecoveryPointReceived() { + return this.lastRecoveryPointReceived; + } + + /** + * Get the firmwareType property: The firmware type of this protected item. + * + * @return the firmwareType value. + */ + public String firmwareType() { + return this.firmwareType; + } + + /** + * Set the firmwareType property: The firmware type of this protected item. + * + * @param firmwareType the firmwareType value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withFirmwareType(String firmwareType) { + this.firmwareType = firmwareType; + return this; + } + + /** + * Get the azureVmGeneration property: The target generation for this protected item. + * + * @return the azureVmGeneration value. + */ + public String azureVmGeneration() { + return this.azureVmGeneration; + } + + /** + * Set the azureVmGeneration property: The target generation for this protected item. + * + * @param azureVmGeneration the azureVmGeneration value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withAzureVmGeneration(String azureVmGeneration) { + this.azureVmGeneration = azureVmGeneration; + return this; + } + + /** + * Get the isAdditionalStatsAvailable property: A value indicating whether additional IR stats are available or not. + * + * @return the isAdditionalStatsAvailable value. + */ + public Boolean isAdditionalStatsAvailable() { + return this.isAdditionalStatsAvailable; + } + + /** + * Set the isAdditionalStatsAvailable property: A value indicating whether additional IR stats are available or not. + * + * @param isAdditionalStatsAvailable the isAdditionalStatsAvailable value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withIsAdditionalStatsAvailable(Boolean isAdditionalStatsAvailable) { + this.isAdditionalStatsAvailable = isAdditionalStatsAvailable; + return this; + } + + /** + * Get the totalDataTransferred property: The total transferred data in bytes. + * + * @return the totalDataTransferred value. + */ + public Long totalDataTransferred() { + return this.totalDataTransferred; + } + + /** + * Set the totalDataTransferred property: The total transferred data in bytes. + * + * @param totalDataTransferred the totalDataTransferred value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withTotalDataTransferred(Long totalDataTransferred) { + this.totalDataTransferred = totalDataTransferred; + return this; + } + + /** + * Get the totalProgressHealth property: The progress health. + * + * @return the totalProgressHealth value. + */ + public String totalProgressHealth() { + return this.totalProgressHealth; + } + + /** + * Set the totalProgressHealth property: The progress health. + * + * @param totalProgressHealth the totalProgressHealth value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withTotalProgressHealth(String totalProgressHealth) { + this.totalProgressHealth = totalProgressHealth; + return this; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the seedManagedDiskTags property: The tags for the seed managed disks. + * + * @return the seedManagedDiskTags value. + */ + public Map seedManagedDiskTags() { + return this.seedManagedDiskTags; + } + + /** + * Set the seedManagedDiskTags property: The tags for the seed managed disks. + * + * @param seedManagedDiskTags the seedManagedDiskTags value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withSeedManagedDiskTags(Map seedManagedDiskTags) { + this.seedManagedDiskTags = seedManagedDiskTags; + return this; + } + + /** + * Get the targetManagedDiskTags property: The tags for the target managed disks. + * + * @return the targetManagedDiskTags value. + */ + public Map targetManagedDiskTags() { + return this.targetManagedDiskTags; + } + + /** + * Set the targetManagedDiskTags property: The tags for the target managed disks. + * + * @param targetManagedDiskTags the targetManagedDiskTags value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withTargetManagedDiskTags(Map targetManagedDiskTags) { + this.targetManagedDiskTags = targetManagedDiskTags; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Get the switchProviderBlockingErrorDetails property: The switch provider blocking error information. + * + * @return the switchProviderBlockingErrorDetails value. + */ + public List switchProviderBlockingErrorDetails() { + return this.switchProviderBlockingErrorDetails; + } + + /** + * Set the switchProviderBlockingErrorDetails property: The switch provider blocking error information. + * + * @param switchProviderBlockingErrorDetails the switchProviderBlockingErrorDetails value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withSwitchProviderBlockingErrorDetails( + List switchProviderBlockingErrorDetails) { + this.switchProviderBlockingErrorDetails = switchProviderBlockingErrorDetails; + return this; + } + + /** + * Get the switchProviderDetails property: The switch provider blocking error information. + * + * @return the switchProviderDetails value. + */ + public InMageAzureV2SwitchProviderDetails switchProviderDetails() { + return this.switchProviderDetails; + } + + /** + * Set the switchProviderDetails property: The switch provider blocking error information. + * + * @param switchProviderDetails the switchProviderDetails value to set. + * @return the InMageAzureV2ReplicationDetails object itself. + */ + public InMageAzureV2ReplicationDetails withSwitchProviderDetails( + InMageAzureV2SwitchProviderDetails switchProviderDetails) { + this.switchProviderDetails = switchProviderDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protectedDisks() != null) { + protectedDisks().forEach(e -> e.validate()); + } + if (azureVMDiskDetails() != null) { + azureVMDiskDetails().forEach(e -> e.validate()); + } + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + if (protectedManagedDisks() != null) { + protectedManagedDisks().forEach(e -> e.validate()); + } + if (switchProviderBlockingErrorDetails() != null) { + switchProviderBlockingErrorDetails().forEach(e -> e.validate()); + } + if (switchProviderDetails() != null) { + switchProviderDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReprotectInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReprotectInput.java new file mode 100644 index 000000000000..8ef6ea8fa63f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReprotectInput.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; + +/** InMageAzureV2 specific provider input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2ReprotectInput extends ReverseReplicationProviderSpecificInput { + /* + * The Master target Id. + */ + @JsonProperty(value = "masterTargetId") + private String masterTargetId; + + /* + * The Process Server Id. + */ + @JsonProperty(value = "processServerId") + private String processServerId; + + /* + * The storage account id. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * The CS account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /* + * The Policy Id. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * The storage account to be used for logging during replication. + */ + @JsonProperty(value = "logStorageAccountId") + private String logStorageAccountId; + + /* + * The disks to include list. + */ + @JsonProperty(value = "disksToInclude") + private List disksToInclude; + + /** Creates an instance of InMageAzureV2ReprotectInput class. */ + public InMageAzureV2ReprotectInput() { + } + + /** + * Get the masterTargetId property: The Master target Id. + * + * @return the masterTargetId value. + */ + public String masterTargetId() { + return this.masterTargetId; + } + + /** + * Set the masterTargetId property: The Master target Id. + * + * @param masterTargetId the masterTargetId value to set. + * @return the InMageAzureV2ReprotectInput object itself. + */ + public InMageAzureV2ReprotectInput withMasterTargetId(String masterTargetId) { + this.masterTargetId = masterTargetId; + return this; + } + + /** + * Get the processServerId property: The Process Server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The Process Server Id. + * + * @param processServerId the processServerId value to set. + * @return the InMageAzureV2ReprotectInput object itself. + */ + public InMageAzureV2ReprotectInput withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the storageAccountId property: The storage account id. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The storage account id. + * + * @param storageAccountId the storageAccountId value to set. + * @return the InMageAzureV2ReprotectInput object itself. + */ + public InMageAzureV2ReprotectInput withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the runAsAccountId property: The CS account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The CS account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the InMageAzureV2ReprotectInput object itself. + */ + public InMageAzureV2ReprotectInput withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Get the policyId property: The Policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: The Policy Id. + * + * @param policyId the policyId value to set. + * @return the InMageAzureV2ReprotectInput object itself. + */ + public InMageAzureV2ReprotectInput withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the logStorageAccountId property: The storage account to be used for logging during replication. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The storage account to be used for logging during replication. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the InMageAzureV2ReprotectInput object itself. + */ + public InMageAzureV2ReprotectInput withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Get the disksToInclude property: The disks to include list. + * + * @return the disksToInclude value. + */ + public List disksToInclude() { + return this.disksToInclude; + } + + /** + * Set the disksToInclude property: The disks to include list. + * + * @param disksToInclude the disksToInclude value to set. + * @return the InMageAzureV2ReprotectInput object itself. + */ + public InMageAzureV2ReprotectInput withDisksToInclude(List disksToInclude) { + this.disksToInclude = disksToInclude; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderBlockingErrorDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderBlockingErrorDetails.java new file mode 100644 index 000000000000..748f704ad55b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderBlockingErrorDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** InMageAzureV2 switch provider blocking error details. */ +@Immutable +public final class InMageAzureV2SwitchProviderBlockingErrorDetails { + /* + * The error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /* + * The error message. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * The possible causes. + */ + @JsonProperty(value = "possibleCauses", access = JsonProperty.Access.WRITE_ONLY) + private String possibleCauses; + + /* + * The recommended action. + */ + @JsonProperty(value = "recommendedAction", access = JsonProperty.Access.WRITE_ONLY) + private String recommendedAction; + + /* + * The error message parameters. + */ + @JsonProperty(value = "errorMessageParameters", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorMessageParameters; + + /* + * The error tags. + */ + @JsonProperty(value = "errorTags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorTags; + + /** Creates an instance of InMageAzureV2SwitchProviderBlockingErrorDetails class. */ + public InMageAzureV2SwitchProviderBlockingErrorDetails() { + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the possibleCauses property: The possible causes. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Get the recommendedAction property: The recommended action. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Get the errorMessageParameters property: The error message parameters. + * + * @return the errorMessageParameters value. + */ + public Map errorMessageParameters() { + return this.errorMessageParameters; + } + + /** + * Get the errorTags property: The error tags. + * + * @return the errorTags value. + */ + public Map errorTags() { + return this.errorTags; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderDetails.java new file mode 100644 index 000000000000..094d70141696 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderDetails.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageAzureV2 switch provider details. */ +@Immutable +public final class InMageAzureV2SwitchProviderDetails { + /* + * The target vault Id. + */ + @JsonProperty(value = "targetVaultId", access = JsonProperty.Access.WRITE_ONLY) + private String targetVaultId; + + /* + * The target resource Id. + */ + @JsonProperty(value = "targetResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceId; + + /* + * The target fabric Id. + */ + @JsonProperty(value = "targetFabricId", access = JsonProperty.Access.WRITE_ONLY) + private String targetFabricId; + + /* + * The target appliance Id. + */ + @JsonProperty(value = "targetApplianceId", access = JsonProperty.Access.WRITE_ONLY) + private String targetApplianceId; + + /** Creates an instance of InMageAzureV2SwitchProviderDetails class. */ + public InMageAzureV2SwitchProviderDetails() { + } + + /** + * Get the targetVaultId property: The target vault Id. + * + * @return the targetVaultId value. + */ + public String targetVaultId() { + return this.targetVaultId; + } + + /** + * Get the targetResourceId property: The target resource Id. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Get the targetFabricId property: The target fabric Id. + * + * @return the targetFabricId value. + */ + public String targetFabricId() { + return this.targetFabricId; + } + + /** + * Get the targetApplianceId property: The target appliance Id. + * + * @return the targetApplianceId value. + */ + public String targetApplianceId() { + return this.targetApplianceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderInput.java new file mode 100644 index 000000000000..57af2e00bf16 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2SwitchProviderInput.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Provider specific input for InMageAzureV2 switch provider. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2SwitchProviderInput extends SwitchProviderSpecificInput { + /* + * The target vault Id. + */ + @JsonProperty(value = "targetVaultID", required = true) + private String targetVaultId; + + /* + * The target fabric Id. + */ + @JsonProperty(value = "targetFabricID", required = true) + private String targetFabricId; + + /* + * The target appliance Id. + */ + @JsonProperty(value = "targetApplianceID", required = true) + private String targetApplianceId; + + /** Creates an instance of InMageAzureV2SwitchProviderInput class. */ + public InMageAzureV2SwitchProviderInput() { + } + + /** + * Get the targetVaultId property: The target vault Id. + * + * @return the targetVaultId value. + */ + public String targetVaultId() { + return this.targetVaultId; + } + + /** + * Set the targetVaultId property: The target vault Id. + * + * @param targetVaultId the targetVaultId value to set. + * @return the InMageAzureV2SwitchProviderInput object itself. + */ + public InMageAzureV2SwitchProviderInput withTargetVaultId(String targetVaultId) { + this.targetVaultId = targetVaultId; + return this; + } + + /** + * Get the targetFabricId property: The target fabric Id. + * + * @return the targetFabricId value. + */ + public String targetFabricId() { + return this.targetFabricId; + } + + /** + * Set the targetFabricId property: The target fabric Id. + * + * @param targetFabricId the targetFabricId value to set. + * @return the InMageAzureV2SwitchProviderInput object itself. + */ + public InMageAzureV2SwitchProviderInput withTargetFabricId(String targetFabricId) { + this.targetFabricId = targetFabricId; + return this; + } + + /** + * Get the targetApplianceId property: The target appliance Id. + * + * @return the targetApplianceId value. + */ + public String targetApplianceId() { + return this.targetApplianceId; + } + + /** + * Set the targetApplianceId property: The target appliance Id. + * + * @param targetApplianceId the targetApplianceId value to set. + * @return the InMageAzureV2SwitchProviderInput object itself. + */ + public InMageAzureV2SwitchProviderInput withTargetApplianceId(String targetApplianceId) { + this.targetApplianceId = targetApplianceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (targetVaultId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetVaultId in model InMageAzureV2SwitchProviderInput")); + } + if (targetFabricId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetFabricId in model InMageAzureV2SwitchProviderInput")); + } + if (targetApplianceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetApplianceId in model InMageAzureV2SwitchProviderInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageAzureV2SwitchProviderInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2TestFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2TestFailoverInput.java new file mode 100644 index 000000000000..d9d1def23ddd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2TestFailoverInput.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.recoveryservicessiterecovery.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; + +/** InMageAzureV2 provider specific input for test failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2TestFailoverInput extends TestFailoverProviderSpecificInput { + /* + * The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery + * point, null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** Creates an instance of InMageAzureV2TestFailoverInput class. */ + public InMageAzureV2TestFailoverInput() { + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the InMageAzureV2TestFailoverInput object itself. + */ + public InMageAzureV2TestFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UnplannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UnplannedFailoverInput.java new file mode 100644 index 000000000000..5f95e2bb12b9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UnplannedFailoverInput.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.recoveryservicessiterecovery.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; + +/** InMageAzureV2 provider specific input for unplanned failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2UnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { + /* + * The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, + * null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** Creates an instance of InMageAzureV2UnplannedFailoverInput class. */ + public InMageAzureV2UnplannedFailoverInput() { + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the InMageAzureV2UnplannedFailoverInput object itself. + */ + public InMageAzureV2UnplannedFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UpdateReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UpdateReplicationProtectedItemInput.java new file mode 100644 index 000000000000..34385993f0b4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UpdateReplicationProtectedItemInput.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** InMage Azure V2 input to update replication protected item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2UpdateReplicationProtectedItemInput + extends UpdateReplicationProtectedItemProviderInput { + /* + * The recovery Azure resource group Id for classic deployment. + */ + @JsonProperty(value = "recoveryAzureV1ResourceGroupId") + private String recoveryAzureV1ResourceGroupId; + + /* + * The recovery Azure resource group Id for resource manager deployment. + */ + @JsonProperty(value = "recoveryAzureV2ResourceGroupId") + private String recoveryAzureV2ResourceGroupId; + + /* + * A value indicating whether managed disks should be used during failover. + */ + @JsonProperty(value = "useManagedDisks") + private String useManagedDisks; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The tags for the target managed disks. + */ + @JsonProperty(value = "targetManagedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetManagedDiskTags; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private SqlServerLicenseType sqlServerLicenseType; + + /* + * The list of disk update properties. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /** Creates an instance of InMageAzureV2UpdateReplicationProtectedItemInput class. */ + public InMageAzureV2UpdateReplicationProtectedItemInput() { + } + + /** + * Get the recoveryAzureV1ResourceGroupId property: The recovery Azure resource group Id for classic deployment. + * + * @return the recoveryAzureV1ResourceGroupId value. + */ + public String recoveryAzureV1ResourceGroupId() { + return this.recoveryAzureV1ResourceGroupId; + } + + /** + * Set the recoveryAzureV1ResourceGroupId property: The recovery Azure resource group Id for classic deployment. + * + * @param recoveryAzureV1ResourceGroupId the recoveryAzureV1ResourceGroupId value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withRecoveryAzureV1ResourceGroupId( + String recoveryAzureV1ResourceGroupId) { + this.recoveryAzureV1ResourceGroupId = recoveryAzureV1ResourceGroupId; + return this; + } + + /** + * Get the recoveryAzureV2ResourceGroupId property: The recovery Azure resource group Id for resource manager + * deployment. + * + * @return the recoveryAzureV2ResourceGroupId value. + */ + public String recoveryAzureV2ResourceGroupId() { + return this.recoveryAzureV2ResourceGroupId; + } + + /** + * Set the recoveryAzureV2ResourceGroupId property: The recovery Azure resource group Id for resource manager + * deployment. + * + * @param recoveryAzureV2ResourceGroupId the recoveryAzureV2ResourceGroupId value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withRecoveryAzureV2ResourceGroupId( + String recoveryAzureV2ResourceGroupId) { + this.recoveryAzureV2ResourceGroupId = recoveryAzureV2ResourceGroupId; + return this; + } + + /** + * Get the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @return the useManagedDisks value. + */ + public String useManagedDisks() { + return this.useManagedDisks; + } + + /** + * Set the useManagedDisks property: A value indicating whether managed disks should be used during failover. + * + * @param useManagedDisks the useManagedDisks value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withUseManagedDisks(String useManagedDisks) { + this.useManagedDisks = useManagedDisks; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withTargetProximityPlacementGroupId( + String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the targetManagedDiskTags property: The tags for the target managed disks. + * + * @return the targetManagedDiskTags value. + */ + public Map targetManagedDiskTags() { + return this.targetManagedDiskTags; + } + + /** + * Set the targetManagedDiskTags property: The tags for the target managed disks. + * + * @param targetManagedDiskTags the targetManagedDiskTags value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withTargetManagedDiskTags( + Map targetManagedDiskTags) { + this.targetManagedDiskTags = targetManagedDiskTags; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public SqlServerLicenseType sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withSqlServerLicenseType( + SqlServerLicenseType sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the vmDisks property: The list of disk update properties. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of disk update properties. + * + * @param vmDisks the vmDisks value to set. + * @return the InMageAzureV2UpdateReplicationProtectedItemInput object itself. + */ + public InMageAzureV2UpdateReplicationProtectedItemInput withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageBasePolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageBasePolicyDetails.java new file mode 100644 index 000000000000..d9cf48017c31 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageBasePolicyDetails.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Base class for the policies of providers using InMage replication. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageBasePolicyDetails") +@Fluent +public final class InMageBasePolicyDetails extends PolicyProviderSpecificDetails { + /* + * The recovery point threshold in minutes. + */ + @JsonProperty(value = "recoveryPointThresholdInMinutes") + private Integer recoveryPointThresholdInMinutes; + + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistory") + private Integer recoveryPointHistory; + + /* + * The app consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. + */ + @JsonProperty(value = "multiVmSyncStatus") + private String multiVmSyncStatus; + + /** Creates an instance of InMageBasePolicyDetails class. */ + public InMageBasePolicyDetails() { + } + + /** + * Get the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @return the recoveryPointThresholdInMinutes value. + */ + public Integer recoveryPointThresholdInMinutes() { + return this.recoveryPointThresholdInMinutes; + } + + /** + * Set the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @param recoveryPointThresholdInMinutes the recoveryPointThresholdInMinutes value to set. + * @return the InMageBasePolicyDetails object itself. + */ + public InMageBasePolicyDetails withRecoveryPointThresholdInMinutes(Integer recoveryPointThresholdInMinutes) { + this.recoveryPointThresholdInMinutes = recoveryPointThresholdInMinutes; + return this; + } + + /** + * Get the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @return the recoveryPointHistory value. + */ + public Integer recoveryPointHistory() { + return this.recoveryPointHistory; + } + + /** + * Set the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @param recoveryPointHistory the recoveryPointHistory value to set. + * @return the InMageBasePolicyDetails object itself. + */ + public InMageBasePolicyDetails withRecoveryPointHistory(Integer recoveryPointHistory) { + this.recoveryPointHistory = recoveryPointHistory; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the InMageBasePolicyDetails object itself. + */ + public InMageBasePolicyDetails withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. + * + * @return the multiVmSyncStatus value. + */ + public String multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the InMageBasePolicyDetails object itself. + */ + public InMageBasePolicyDetails withMultiVmSyncStatus(String multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDisableProtectionProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDisableProtectionProviderSpecificInput.java new file mode 100644 index 000000000000..4b2534305654 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDisableProtectionProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** InMage disable protection provider specific input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class InMageDisableProtectionProviderSpecificInput extends DisableProtectionProviderSpecificInput { + /* + * A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. + */ + @JsonProperty(value = "replicaVmDeletionStatus") + private String replicaVmDeletionStatus; + + /** Creates an instance of InMageDisableProtectionProviderSpecificInput class. */ + public InMageDisableProtectionProviderSpecificInput() { + } + + /** + * Get the replicaVmDeletionStatus property: A value indicating whether the replica VM should be destroyed or + * retained. Values from Delete and Retain. + * + * @return the replicaVmDeletionStatus value. + */ + public String replicaVmDeletionStatus() { + return this.replicaVmDeletionStatus; + } + + /** + * Set the replicaVmDeletionStatus property: A value indicating whether the replica VM should be destroyed or + * retained. Values from Delete and Retain. + * + * @param replicaVmDeletionStatus the replicaVmDeletionStatus value to set. + * @return the InMageDisableProtectionProviderSpecificInput object itself. + */ + public InMageDisableProtectionProviderSpecificInput withReplicaVmDeletionStatus(String replicaVmDeletionStatus) { + this.replicaVmDeletionStatus = replicaVmDeletionStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskDetails.java new file mode 100644 index 000000000000..dcc20243679b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskDetails.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VMware/Physical specific Disk Details. */ +@Fluent +public final class InMageDiskDetails { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The disk name. + */ + @JsonProperty(value = "diskName") + private String diskName; + + /* + * The disk size in MB. + */ + @JsonProperty(value = "diskSizeInMB") + private String diskSizeInMB; + + /* + * Whether disk is system disk or data disk. + */ + @JsonProperty(value = "diskType") + private String diskType; + + /* + * Whether disk is dynamic disk or basic disk. + */ + @JsonProperty(value = "diskConfiguration") + private String diskConfiguration; + + /* + * Volumes of the disk. + */ + @JsonProperty(value = "volumeList") + private List volumeList; + + /** Creates an instance of InMageDiskDetails class. */ + public InMageDiskDetails() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk Id. + * + * @param diskId the diskId value to set. + * @return the InMageDiskDetails object itself. + */ + public InMageDiskDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the diskName property: The disk name. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Set the diskName property: The disk name. + * + * @param diskName the diskName value to set. + * @return the InMageDiskDetails object itself. + */ + public InMageDiskDetails withDiskName(String diskName) { + this.diskName = diskName; + return this; + } + + /** + * Get the diskSizeInMB property: The disk size in MB. + * + * @return the diskSizeInMB value. + */ + public String diskSizeInMB() { + return this.diskSizeInMB; + } + + /** + * Set the diskSizeInMB property: The disk size in MB. + * + * @param diskSizeInMB the diskSizeInMB value to set. + * @return the InMageDiskDetails object itself. + */ + public InMageDiskDetails withDiskSizeInMB(String diskSizeInMB) { + this.diskSizeInMB = diskSizeInMB; + return this; + } + + /** + * Get the diskType property: Whether disk is system disk or data disk. + * + * @return the diskType value. + */ + public String diskType() { + return this.diskType; + } + + /** + * Set the diskType property: Whether disk is system disk or data disk. + * + * @param diskType the diskType value to set. + * @return the InMageDiskDetails object itself. + */ + public InMageDiskDetails withDiskType(String diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the diskConfiguration property: Whether disk is dynamic disk or basic disk. + * + * @return the diskConfiguration value. + */ + public String diskConfiguration() { + return this.diskConfiguration; + } + + /** + * Set the diskConfiguration property: Whether disk is dynamic disk or basic disk. + * + * @param diskConfiguration the diskConfiguration value to set. + * @return the InMageDiskDetails object itself. + */ + public InMageDiskDetails withDiskConfiguration(String diskConfiguration) { + this.diskConfiguration = diskConfiguration; + return this; + } + + /** + * Get the volumeList property: Volumes of the disk. + * + * @return the volumeList value. + */ + public List volumeList() { + return this.volumeList; + } + + /** + * Set the volumeList property: Volumes of the disk. + * + * @param volumeList the volumeList value to set. + * @return the InMageDiskDetails object itself. + */ + public InMageDiskDetails withVolumeList(List volumeList) { + this.volumeList = volumeList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (volumeList() != null) { + volumeList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskExclusionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskExclusionInput.java new file mode 100644 index 000000000000..7840d784c684 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskExclusionInput.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DiskExclusionInput when doing enable protection of virtual machine in InMage provider. */ +@Fluent +public final class InMageDiskExclusionInput { + /* + * The volume label based option for disk exclusion. + */ + @JsonProperty(value = "volumeOptions") + private List volumeOptions; + + /* + * The guest disk signature based option for disk exclusion. + */ + @JsonProperty(value = "diskSignatureOptions") + private List diskSignatureOptions; + + /** Creates an instance of InMageDiskExclusionInput class. */ + public InMageDiskExclusionInput() { + } + + /** + * Get the volumeOptions property: The volume label based option for disk exclusion. + * + * @return the volumeOptions value. + */ + public List volumeOptions() { + return this.volumeOptions; + } + + /** + * Set the volumeOptions property: The volume label based option for disk exclusion. + * + * @param volumeOptions the volumeOptions value to set. + * @return the InMageDiskExclusionInput object itself. + */ + public InMageDiskExclusionInput withVolumeOptions(List volumeOptions) { + this.volumeOptions = volumeOptions; + return this; + } + + /** + * Get the diskSignatureOptions property: The guest disk signature based option for disk exclusion. + * + * @return the diskSignatureOptions value. + */ + public List diskSignatureOptions() { + return this.diskSignatureOptions; + } + + /** + * Set the diskSignatureOptions property: The guest disk signature based option for disk exclusion. + * + * @param diskSignatureOptions the diskSignatureOptions value to set. + * @return the InMageDiskExclusionInput object itself. + */ + public InMageDiskExclusionInput withDiskSignatureOptions( + List diskSignatureOptions) { + this.diskSignatureOptions = diskSignatureOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (volumeOptions() != null) { + volumeOptions().forEach(e -> e.validate()); + } + if (diskSignatureOptions() != null) { + diskSignatureOptions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskSignatureExclusionOptions.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskSignatureExclusionOptions.java new file mode 100644 index 000000000000..e715d5d8437a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDiskSignatureExclusionOptions.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Guest disk signature based disk exclusion option when doing enable protection of virtual machine in InMage provider. + */ +@Fluent +public final class InMageDiskSignatureExclusionOptions { + /* + * The guest signature of disk to be excluded from replication. + */ + @JsonProperty(value = "diskSignature") + private String diskSignature; + + /** Creates an instance of InMageDiskSignatureExclusionOptions class. */ + public InMageDiskSignatureExclusionOptions() { + } + + /** + * Get the diskSignature property: The guest signature of disk to be excluded from replication. + * + * @return the diskSignature value. + */ + public String diskSignature() { + return this.diskSignature; + } + + /** + * Set the diskSignature property: The guest signature of disk to be excluded from replication. + * + * @param diskSignature the diskSignature value to set. + * @return the InMageDiskSignatureExclusionOptions object itself. + */ + public InMageDiskSignatureExclusionOptions withDiskSignature(String diskSignature) { + this.diskSignature = diskSignature; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageEnableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageEnableProtectionInput.java new file mode 100644 index 000000000000..956b1a6058e2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageEnableProtectionInput.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** VMware Azure specific enable protection input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class InMageEnableProtectionInput extends EnableProtectionProviderSpecificInput { + /* + * The VM Name. + */ + @JsonProperty(value = "vmFriendlyName") + private String vmFriendlyName; + + /* + * The Master Target Id. + */ + @JsonProperty(value = "masterTargetId", required = true) + private String masterTargetId; + + /* + * The Process Server Id. + */ + @JsonProperty(value = "processServerId", required = true) + private String processServerId; + + /* + * The retention drive to use on the MT. + */ + @JsonProperty(value = "retentionDrive", required = true) + private String retentionDrive; + + /* + * The CS account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /* + * The multi VM group Id. + */ + @JsonProperty(value = "multiVmGroupId", required = true) + private String multiVmGroupId; + + /* + * The multi VM group name. + */ + @JsonProperty(value = "multiVmGroupName", required = true) + private String multiVmGroupName; + + /* + * The target datastore name. + */ + @JsonProperty(value = "datastoreName") + private String datastoreName; + + /* + * The enable disk exclusion input. + */ + @JsonProperty(value = "diskExclusionInput") + private InMageDiskExclusionInput diskExclusionInput; + + /* + * The disks to include list. + */ + @JsonProperty(value = "disksToInclude") + private List disksToInclude; + + /** Creates an instance of InMageEnableProtectionInput class. */ + public InMageEnableProtectionInput() { + } + + /** + * Get the vmFriendlyName property: The VM Name. + * + * @return the vmFriendlyName value. + */ + public String vmFriendlyName() { + return this.vmFriendlyName; + } + + /** + * Set the vmFriendlyName property: The VM Name. + * + * @param vmFriendlyName the vmFriendlyName value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withVmFriendlyName(String vmFriendlyName) { + this.vmFriendlyName = vmFriendlyName; + return this; + } + + /** + * Get the masterTargetId property: The Master Target Id. + * + * @return the masterTargetId value. + */ + public String masterTargetId() { + return this.masterTargetId; + } + + /** + * Set the masterTargetId property: The Master Target Id. + * + * @param masterTargetId the masterTargetId value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withMasterTargetId(String masterTargetId) { + this.masterTargetId = masterTargetId; + return this; + } + + /** + * Get the processServerId property: The Process Server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The Process Server Id. + * + * @param processServerId the processServerId value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the retentionDrive property: The retention drive to use on the MT. + * + * @return the retentionDrive value. + */ + public String retentionDrive() { + return this.retentionDrive; + } + + /** + * Set the retentionDrive property: The retention drive to use on the MT. + * + * @param retentionDrive the retentionDrive value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withRetentionDrive(String retentionDrive) { + this.retentionDrive = retentionDrive; + return this; + } + + /** + * Get the runAsAccountId property: The CS account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The CS account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Get the multiVmGroupId property: The multi VM group Id. + * + * @return the multiVmGroupId value. + */ + public String multiVmGroupId() { + return this.multiVmGroupId; + } + + /** + * Set the multiVmGroupId property: The multi VM group Id. + * + * @param multiVmGroupId the multiVmGroupId value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withMultiVmGroupId(String multiVmGroupId) { + this.multiVmGroupId = multiVmGroupId; + return this; + } + + /** + * Get the multiVmGroupName property: The multi VM group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Set the multiVmGroupName property: The multi VM group name. + * + * @param multiVmGroupName the multiVmGroupName value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withMultiVmGroupName(String multiVmGroupName) { + this.multiVmGroupName = multiVmGroupName; + return this; + } + + /** + * Get the datastoreName property: The target datastore name. + * + * @return the datastoreName value. + */ + public String datastoreName() { + return this.datastoreName; + } + + /** + * Set the datastoreName property: The target datastore name. + * + * @param datastoreName the datastoreName value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withDatastoreName(String datastoreName) { + this.datastoreName = datastoreName; + return this; + } + + /** + * Get the diskExclusionInput property: The enable disk exclusion input. + * + * @return the diskExclusionInput value. + */ + public InMageDiskExclusionInput diskExclusionInput() { + return this.diskExclusionInput; + } + + /** + * Set the diskExclusionInput property: The enable disk exclusion input. + * + * @param diskExclusionInput the diskExclusionInput value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withDiskExclusionInput(InMageDiskExclusionInput diskExclusionInput) { + this.diskExclusionInput = diskExclusionInput; + return this; + } + + /** + * Get the disksToInclude property: The disks to include list. + * + * @return the disksToInclude value. + */ + public List disksToInclude() { + return this.disksToInclude; + } + + /** + * Set the disksToInclude property: The disks to include list. + * + * @param disksToInclude the disksToInclude value to set. + * @return the InMageEnableProtectionInput object itself. + */ + public InMageEnableProtectionInput withDisksToInclude(List disksToInclude) { + this.disksToInclude = disksToInclude; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (masterTargetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property masterTargetId in model InMageEnableProtectionInput")); + } + if (processServerId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property processServerId in model InMageEnableProtectionInput")); + } + if (retentionDrive() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property retentionDrive in model InMageEnableProtectionInput")); + } + if (multiVmGroupId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property multiVmGroupId in model InMageEnableProtectionInput")); + } + if (multiVmGroupName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property multiVmGroupName in model InMageEnableProtectionInput")); + } + if (diskExclusionInput() != null) { + diskExclusionInput().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageEnableProtectionInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageFabricSwitchProviderBlockingErrorDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageFabricSwitchProviderBlockingErrorDetails.java new file mode 100644 index 000000000000..f28f882424d8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageFabricSwitchProviderBlockingErrorDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** InMageFabric switch provider blocking error details. */ +@Immutable +public final class InMageFabricSwitchProviderBlockingErrorDetails { + /* + * The error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /* + * The error message. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * The possible causes. + */ + @JsonProperty(value = "possibleCauses", access = JsonProperty.Access.WRITE_ONLY) + private String possibleCauses; + + /* + * The recommended action. + */ + @JsonProperty(value = "recommendedAction", access = JsonProperty.Access.WRITE_ONLY) + private String recommendedAction; + + /* + * The error message parameters. + */ + @JsonProperty(value = "errorMessageParameters", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorMessageParameters; + + /* + * The error tags. + */ + @JsonProperty(value = "errorTags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorTags; + + /** Creates an instance of InMageFabricSwitchProviderBlockingErrorDetails class. */ + public InMageFabricSwitchProviderBlockingErrorDetails() { + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the possibleCauses property: The possible causes. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Get the recommendedAction property: The recommended action. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Get the errorMessageParameters property: The error message parameters. + * + * @return the errorMessageParameters value. + */ + public Map errorMessageParameters() { + return this.errorMessageParameters; + } + + /** + * Get the errorTags property: The error tags. + * + * @return the errorTags value. + */ + public Map errorTags() { + return this.errorTags; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyDetails.java new file mode 100644 index 000000000000..9fea6c72bcf9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyDetails.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMage specific protection profile details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class InMagePolicyDetails extends PolicyProviderSpecificDetails { + /* + * The recovery point threshold in minutes. + */ + @JsonProperty(value = "recoveryPointThresholdInMinutes") + private Integer recoveryPointThresholdInMinutes; + + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistory") + private Integer recoveryPointHistory; + + /* + * The app consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. + */ + @JsonProperty(value = "multiVmSyncStatus") + private String multiVmSyncStatus; + + /** Creates an instance of InMagePolicyDetails class. */ + public InMagePolicyDetails() { + } + + /** + * Get the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @return the recoveryPointThresholdInMinutes value. + */ + public Integer recoveryPointThresholdInMinutes() { + return this.recoveryPointThresholdInMinutes; + } + + /** + * Set the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @param recoveryPointThresholdInMinutes the recoveryPointThresholdInMinutes value to set. + * @return the InMagePolicyDetails object itself. + */ + public InMagePolicyDetails withRecoveryPointThresholdInMinutes(Integer recoveryPointThresholdInMinutes) { + this.recoveryPointThresholdInMinutes = recoveryPointThresholdInMinutes; + return this; + } + + /** + * Get the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @return the recoveryPointHistory value. + */ + public Integer recoveryPointHistory() { + return this.recoveryPointHistory; + } + + /** + * Set the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @param recoveryPointHistory the recoveryPointHistory value to set. + * @return the InMagePolicyDetails object itself. + */ + public InMagePolicyDetails withRecoveryPointHistory(Integer recoveryPointHistory) { + this.recoveryPointHistory = recoveryPointHistory; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the InMagePolicyDetails object itself. + */ + public InMagePolicyDetails withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. + * + * @return the multiVmSyncStatus value. + */ + public String multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the InMagePolicyDetails object itself. + */ + public InMagePolicyDetails withMultiVmSyncStatus(String multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyInput.java new file mode 100644 index 000000000000..5ac01500b834 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyInput.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.recoveryservicessiterecovery.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 Azure specific protection profile Input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class InMagePolicyInput extends PolicyProviderSpecificInput { + /* + * The recovery point threshold in minutes. + */ + @JsonProperty(value = "recoveryPointThresholdInMinutes") + private Integer recoveryPointThresholdInMinutes; + + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistory") + private Integer recoveryPointHistory; + + /* + * The app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. + */ + @JsonProperty(value = "multiVmSyncStatus", required = true) + private SetMultiVmSyncStatus multiVmSyncStatus; + + /** Creates an instance of InMagePolicyInput class. */ + public InMagePolicyInput() { + } + + /** + * Get the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @return the recoveryPointThresholdInMinutes value. + */ + public Integer recoveryPointThresholdInMinutes() { + return this.recoveryPointThresholdInMinutes; + } + + /** + * Set the recoveryPointThresholdInMinutes property: The recovery point threshold in minutes. + * + * @param recoveryPointThresholdInMinutes the recoveryPointThresholdInMinutes value to set. + * @return the InMagePolicyInput object itself. + */ + public InMagePolicyInput withRecoveryPointThresholdInMinutes(Integer recoveryPointThresholdInMinutes) { + this.recoveryPointThresholdInMinutes = recoveryPointThresholdInMinutes; + return this; + } + + /** + * Get the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @return the recoveryPointHistory value. + */ + public Integer recoveryPointHistory() { + return this.recoveryPointHistory; + } + + /** + * Set the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @param recoveryPointHistory the recoveryPointHistory value to set. + * @return the InMagePolicyInput object itself. + */ + public InMagePolicyInput withRecoveryPointHistory(Integer recoveryPointHistory) { + this.recoveryPointHistory = recoveryPointHistory; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the InMagePolicyInput object itself. + */ + public InMagePolicyInput withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. Value should be + * 'Enabled' or 'Disabled'. + * + * @return the multiVmSyncStatus value. + */ + public SetMultiVmSyncStatus multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. Value should be + * 'Enabled' or 'Disabled'. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the InMagePolicyInput object itself. + */ + public InMagePolicyInput withMultiVmSyncStatus(SetMultiVmSyncStatus multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (multiVmSyncStatus() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property multiVmSyncStatus in model InMagePolicyInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMagePolicyInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageProtectedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageProtectedDiskDetails.java new file mode 100644 index 000000000000..a9a4bf66b6ed --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageProtectedDiskDetails.java @@ -0,0 +1,598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** InMage protected disk details. */ +@Fluent +public final class InMageProtectedDiskDetails { + /* + * The disk id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The disk name. + */ + @JsonProperty(value = "diskName") + private String diskName; + + /* + * The protection stage. + */ + @JsonProperty(value = "protectionStage") + private String protectionStage; + + /* + * The health error code for the disk. + */ + @JsonProperty(value = "healthErrorCode") + private String healthErrorCode; + + /* + * The RPO in seconds. + */ + @JsonProperty(value = "rpoInSeconds") + private Long rpoInSeconds; + + /* + * A value indicating whether resync is required for this disk. + */ + @JsonProperty(value = "resyncRequired") + private String resyncRequired; + + /* + * The resync progress percentage. + */ + @JsonProperty(value = "resyncProgressPercentage") + private Integer resyncProgressPercentage; + + /* + * The resync duration in seconds. + */ + @JsonProperty(value = "resyncDurationInSeconds") + private Long resyncDurationInSeconds; + + /* + * The disk capacity in bytes. + */ + @JsonProperty(value = "diskCapacityInBytes") + private Long diskCapacityInBytes; + + /* + * The file system capacity in bytes. + */ + @JsonProperty(value = "fileSystemCapacityInBytes") + private Long fileSystemCapacityInBytes; + + /* + * The source data transit in MB. + */ + @JsonProperty(value = "sourceDataInMB") + private Double sourceDataInMB; + + /* + * The PS data transit in MB. + */ + @JsonProperty(value = "psDataInMB") + private Double psDataInMB; + + /* + * The target data transit in MB. + */ + @JsonProperty(value = "targetDataInMB") + private Double targetDataInMB; + + /* + * A value indicating whether disk is resized. + */ + @JsonProperty(value = "diskResized") + private String diskResized; + + /* + * The last RPO calculated time. + */ + @JsonProperty(value = "lastRpoCalculatedTime") + private OffsetDateTime lastRpoCalculatedTime; + + /* + * The resync processed bytes. + */ + @JsonProperty(value = "resyncProcessedBytes") + private Long resyncProcessedBytes; + + /* + * The resync total transferred bytes. + */ + @JsonProperty(value = "resyncTotalTransferredBytes") + private Long resyncTotalTransferredBytes; + + /* + * The resync last 15 minutes transferred bytes. + */ + @JsonProperty(value = "resyncLast15MinutesTransferredBytes") + private Long resyncLast15MinutesTransferredBytes; + + /* + * The last data transfer time in UTC. + */ + @JsonProperty(value = "resyncLastDataTransferTimeUTC") + private OffsetDateTime resyncLastDataTransferTimeUtc; + + /* + * The resync start time. + */ + @JsonProperty(value = "resyncStartTime") + private OffsetDateTime resyncStartTime; + + /* + * The Progress Health. + */ + @JsonProperty(value = "progressHealth") + private String progressHealth; + + /* + * The Progress Status. + */ + @JsonProperty(value = "progressStatus") + private String progressStatus; + + /** Creates an instance of InMageProtectedDiskDetails class. */ + public InMageProtectedDiskDetails() { + } + + /** + * Get the diskId property: The disk id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk id. + * + * @param diskId the diskId value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the diskName property: The disk name. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Set the diskName property: The disk name. + * + * @param diskName the diskName value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withDiskName(String diskName) { + this.diskName = diskName; + return this; + } + + /** + * Get the protectionStage property: The protection stage. + * + * @return the protectionStage value. + */ + public String protectionStage() { + return this.protectionStage; + } + + /** + * Set the protectionStage property: The protection stage. + * + * @param protectionStage the protectionStage value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withProtectionStage(String protectionStage) { + this.protectionStage = protectionStage; + return this; + } + + /** + * Get the healthErrorCode property: The health error code for the disk. + * + * @return the healthErrorCode value. + */ + public String healthErrorCode() { + return this.healthErrorCode; + } + + /** + * Set the healthErrorCode property: The health error code for the disk. + * + * @param healthErrorCode the healthErrorCode value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withHealthErrorCode(String healthErrorCode) { + this.healthErrorCode = healthErrorCode; + return this; + } + + /** + * Get the rpoInSeconds property: The RPO in seconds. + * + * @return the rpoInSeconds value. + */ + public Long rpoInSeconds() { + return this.rpoInSeconds; + } + + /** + * Set the rpoInSeconds property: The RPO in seconds. + * + * @param rpoInSeconds the rpoInSeconds value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withRpoInSeconds(Long rpoInSeconds) { + this.rpoInSeconds = rpoInSeconds; + return this; + } + + /** + * Get the resyncRequired property: A value indicating whether resync is required for this disk. + * + * @return the resyncRequired value. + */ + public String resyncRequired() { + return this.resyncRequired; + } + + /** + * Set the resyncRequired property: A value indicating whether resync is required for this disk. + * + * @param resyncRequired the resyncRequired value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withResyncRequired(String resyncRequired) { + this.resyncRequired = resyncRequired; + return this; + } + + /** + * Get the resyncProgressPercentage property: The resync progress percentage. + * + * @return the resyncProgressPercentage value. + */ + public Integer resyncProgressPercentage() { + return this.resyncProgressPercentage; + } + + /** + * Set the resyncProgressPercentage property: The resync progress percentage. + * + * @param resyncProgressPercentage the resyncProgressPercentage value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withResyncProgressPercentage(Integer resyncProgressPercentage) { + this.resyncProgressPercentage = resyncProgressPercentage; + return this; + } + + /** + * Get the resyncDurationInSeconds property: The resync duration in seconds. + * + * @return the resyncDurationInSeconds value. + */ + public Long resyncDurationInSeconds() { + return this.resyncDurationInSeconds; + } + + /** + * Set the resyncDurationInSeconds property: The resync duration in seconds. + * + * @param resyncDurationInSeconds the resyncDurationInSeconds value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withResyncDurationInSeconds(Long resyncDurationInSeconds) { + this.resyncDurationInSeconds = resyncDurationInSeconds; + return this; + } + + /** + * Get the diskCapacityInBytes property: The disk capacity in bytes. + * + * @return the diskCapacityInBytes value. + */ + public Long diskCapacityInBytes() { + return this.diskCapacityInBytes; + } + + /** + * Set the diskCapacityInBytes property: The disk capacity in bytes. + * + * @param diskCapacityInBytes the diskCapacityInBytes value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withDiskCapacityInBytes(Long diskCapacityInBytes) { + this.diskCapacityInBytes = diskCapacityInBytes; + return this; + } + + /** + * Get the fileSystemCapacityInBytes property: The file system capacity in bytes. + * + * @return the fileSystemCapacityInBytes value. + */ + public Long fileSystemCapacityInBytes() { + return this.fileSystemCapacityInBytes; + } + + /** + * Set the fileSystemCapacityInBytes property: The file system capacity in bytes. + * + * @param fileSystemCapacityInBytes the fileSystemCapacityInBytes value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withFileSystemCapacityInBytes(Long fileSystemCapacityInBytes) { + this.fileSystemCapacityInBytes = fileSystemCapacityInBytes; + return this; + } + + /** + * Get the sourceDataInMB property: The source data transit in MB. + * + * @return the sourceDataInMB value. + */ + public Double sourceDataInMB() { + return this.sourceDataInMB; + } + + /** + * Set the sourceDataInMB property: The source data transit in MB. + * + * @param sourceDataInMB the sourceDataInMB value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withSourceDataInMB(Double sourceDataInMB) { + this.sourceDataInMB = sourceDataInMB; + return this; + } + + /** + * Get the psDataInMB property: The PS data transit in MB. + * + * @return the psDataInMB value. + */ + public Double psDataInMB() { + return this.psDataInMB; + } + + /** + * Set the psDataInMB property: The PS data transit in MB. + * + * @param psDataInMB the psDataInMB value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withPsDataInMB(Double psDataInMB) { + this.psDataInMB = psDataInMB; + return this; + } + + /** + * Get the targetDataInMB property: The target data transit in MB. + * + * @return the targetDataInMB value. + */ + public Double targetDataInMB() { + return this.targetDataInMB; + } + + /** + * Set the targetDataInMB property: The target data transit in MB. + * + * @param targetDataInMB the targetDataInMB value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withTargetDataInMB(Double targetDataInMB) { + this.targetDataInMB = targetDataInMB; + return this; + } + + /** + * Get the diskResized property: A value indicating whether disk is resized. + * + * @return the diskResized value. + */ + public String diskResized() { + return this.diskResized; + } + + /** + * Set the diskResized property: A value indicating whether disk is resized. + * + * @param diskResized the diskResized value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withDiskResized(String diskResized) { + this.diskResized = diskResized; + return this; + } + + /** + * Get the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @return the lastRpoCalculatedTime value. + */ + public OffsetDateTime lastRpoCalculatedTime() { + return this.lastRpoCalculatedTime; + } + + /** + * Set the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @param lastRpoCalculatedTime the lastRpoCalculatedTime value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withLastRpoCalculatedTime(OffsetDateTime lastRpoCalculatedTime) { + this.lastRpoCalculatedTime = lastRpoCalculatedTime; + return this; + } + + /** + * Get the resyncProcessedBytes property: The resync processed bytes. + * + * @return the resyncProcessedBytes value. + */ + public Long resyncProcessedBytes() { + return this.resyncProcessedBytes; + } + + /** + * Set the resyncProcessedBytes property: The resync processed bytes. + * + * @param resyncProcessedBytes the resyncProcessedBytes value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withResyncProcessedBytes(Long resyncProcessedBytes) { + this.resyncProcessedBytes = resyncProcessedBytes; + return this; + } + + /** + * Get the resyncTotalTransferredBytes property: The resync total transferred bytes. + * + * @return the resyncTotalTransferredBytes value. + */ + public Long resyncTotalTransferredBytes() { + return this.resyncTotalTransferredBytes; + } + + /** + * Set the resyncTotalTransferredBytes property: The resync total transferred bytes. + * + * @param resyncTotalTransferredBytes the resyncTotalTransferredBytes value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withResyncTotalTransferredBytes(Long resyncTotalTransferredBytes) { + this.resyncTotalTransferredBytes = resyncTotalTransferredBytes; + return this; + } + + /** + * Get the resyncLast15MinutesTransferredBytes property: The resync last 15 minutes transferred bytes. + * + * @return the resyncLast15MinutesTransferredBytes value. + */ + public Long resyncLast15MinutesTransferredBytes() { + return this.resyncLast15MinutesTransferredBytes; + } + + /** + * Set the resyncLast15MinutesTransferredBytes property: The resync last 15 minutes transferred bytes. + * + * @param resyncLast15MinutesTransferredBytes the resyncLast15MinutesTransferredBytes value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withResyncLast15MinutesTransferredBytes( + Long resyncLast15MinutesTransferredBytes) { + this.resyncLast15MinutesTransferredBytes = resyncLast15MinutesTransferredBytes; + return this; + } + + /** + * Get the resyncLastDataTransferTimeUtc property: The last data transfer time in UTC. + * + * @return the resyncLastDataTransferTimeUtc value. + */ + public OffsetDateTime resyncLastDataTransferTimeUtc() { + return this.resyncLastDataTransferTimeUtc; + } + + /** + * Set the resyncLastDataTransferTimeUtc property: The last data transfer time in UTC. + * + * @param resyncLastDataTransferTimeUtc the resyncLastDataTransferTimeUtc value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withResyncLastDataTransferTimeUtc(OffsetDateTime resyncLastDataTransferTimeUtc) { + this.resyncLastDataTransferTimeUtc = resyncLastDataTransferTimeUtc; + return this; + } + + /** + * Get the resyncStartTime property: The resync start time. + * + * @return the resyncStartTime value. + */ + public OffsetDateTime resyncStartTime() { + return this.resyncStartTime; + } + + /** + * Set the resyncStartTime property: The resync start time. + * + * @param resyncStartTime the resyncStartTime value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withResyncStartTime(OffsetDateTime resyncStartTime) { + this.resyncStartTime = resyncStartTime; + return this; + } + + /** + * Get the progressHealth property: The Progress Health. + * + * @return the progressHealth value. + */ + public String progressHealth() { + return this.progressHealth; + } + + /** + * Set the progressHealth property: The Progress Health. + * + * @param progressHealth the progressHealth value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withProgressHealth(String progressHealth) { + this.progressHealth = progressHealth; + return this; + } + + /** + * Get the progressStatus property: The Progress Status. + * + * @return the progressStatus value. + */ + public String progressStatus() { + return this.progressStatus; + } + + /** + * Set the progressStatus property: The Progress Status. + * + * @param progressStatus the progressStatus value to set. + * @return the InMageProtectedDiskDetails object itself. + */ + public InMageProtectedDiskDetails withProgressStatus(String progressStatus) { + this.progressStatus = progressStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmAgentUpgradeBlockingErrorDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmAgentUpgradeBlockingErrorDetails.java new file mode 100644 index 000000000000..e0f5dc1008c4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmAgentUpgradeBlockingErrorDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** InMageRcm source agent upgrade blocking error details. */ +@Immutable +public final class InMageRcmAgentUpgradeBlockingErrorDetails { + /* + * The error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /* + * The error message. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * The possible causes. + */ + @JsonProperty(value = "possibleCauses", access = JsonProperty.Access.WRITE_ONLY) + private String possibleCauses; + + /* + * The recommended action. + */ + @JsonProperty(value = "recommendedAction", access = JsonProperty.Access.WRITE_ONLY) + private String recommendedAction; + + /* + * The error message parameters. + */ + @JsonProperty(value = "errorMessageParameters", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorMessageParameters; + + /* + * The error tags. + */ + @JsonProperty(value = "errorTags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorTags; + + /** Creates an instance of InMageRcmAgentUpgradeBlockingErrorDetails class. */ + public InMageRcmAgentUpgradeBlockingErrorDetails() { + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the possibleCauses property: The possible causes. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Get the recommendedAction property: The recommended action. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Get the errorMessageParameters property: The error message parameters. + * + * @return the errorMessageParameters value. + */ + public Map errorMessageParameters() { + return this.errorMessageParameters; + } + + /** + * Get the errorTags property: The error tags. + * + * @return the errorTags value. + */ + public Map errorTags() { + return this.errorTags; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplianceDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplianceDetails.java new file mode 100644 index 000000000000..6b948f829c98 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplianceDetails.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** InMageRcm appliance details. */ +@Immutable +public final class InMageRcmApplianceDetails { + /* + * The appliance Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The appliance name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The fabric ARM Id. + */ + @JsonProperty(value = "fabricArmId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricArmId; + + /* + * The process server. + */ + @JsonProperty(value = "processServer", access = JsonProperty.Access.WRITE_ONLY) + private ProcessServerDetails processServer; + + /* + * The of RCM proxy. + */ + @JsonProperty(value = "rcmProxy", access = JsonProperty.Access.WRITE_ONLY) + private RcmProxyDetails rcmProxy; + + /* + * The push installer. + */ + @JsonProperty(value = "pushInstaller", access = JsonProperty.Access.WRITE_ONLY) + private PushInstallerDetails pushInstaller; + + /* + * The replication agent. + */ + @JsonProperty(value = "replicationAgent", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationAgentDetails replicationAgent; + + /* + * The reprotect agent. + */ + @JsonProperty(value = "reprotectAgent", access = JsonProperty.Access.WRITE_ONLY) + private ReprotectAgentDetails reprotectAgent; + + /* + * The Mars agent. + */ + @JsonProperty(value = "marsAgent", access = JsonProperty.Access.WRITE_ONLY) + private MarsAgentDetails marsAgent; + + /* + * The DRA. + */ + @JsonProperty(value = "dra", access = JsonProperty.Access.WRITE_ONLY) + private DraDetails dra; + + /* + * The switch provider blocking error information. + */ + @JsonProperty(value = "switchProviderBlockingErrorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List switchProviderBlockingErrorDetails; + + /** Creates an instance of InMageRcmApplianceDetails class. */ + public InMageRcmApplianceDetails() { + } + + /** + * Get the id property: The appliance Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The appliance name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the fabricArmId property: The fabric ARM Id. + * + * @return the fabricArmId value. + */ + public String fabricArmId() { + return this.fabricArmId; + } + + /** + * Get the processServer property: The process server. + * + * @return the processServer value. + */ + public ProcessServerDetails processServer() { + return this.processServer; + } + + /** + * Get the rcmProxy property: The of RCM proxy. + * + * @return the rcmProxy value. + */ + public RcmProxyDetails rcmProxy() { + return this.rcmProxy; + } + + /** + * Get the pushInstaller property: The push installer. + * + * @return the pushInstaller value. + */ + public PushInstallerDetails pushInstaller() { + return this.pushInstaller; + } + + /** + * Get the replicationAgent property: The replication agent. + * + * @return the replicationAgent value. + */ + public ReplicationAgentDetails replicationAgent() { + return this.replicationAgent; + } + + /** + * Get the reprotectAgent property: The reprotect agent. + * + * @return the reprotectAgent value. + */ + public ReprotectAgentDetails reprotectAgent() { + return this.reprotectAgent; + } + + /** + * Get the marsAgent property: The Mars agent. + * + * @return the marsAgent value. + */ + public MarsAgentDetails marsAgent() { + return this.marsAgent; + } + + /** + * Get the dra property: The DRA. + * + * @return the dra value. + */ + public DraDetails dra() { + return this.dra; + } + + /** + * Get the switchProviderBlockingErrorDetails property: The switch provider blocking error information. + * + * @return the switchProviderBlockingErrorDetails value. + */ + public List switchProviderBlockingErrorDetails() { + return this.switchProviderBlockingErrorDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (processServer() != null) { + processServer().validate(); + } + if (rcmProxy() != null) { + rcmProxy().validate(); + } + if (pushInstaller() != null) { + pushInstaller().validate(); + } + if (replicationAgent() != null) { + replicationAgent().validate(); + } + if (reprotectAgent() != null) { + reprotectAgent().validate(); + } + if (marsAgent() != null) { + marsAgent().validate(); + } + if (dra() != null) { + dra().validate(); + } + if (switchProviderBlockingErrorDetails() != null) { + switchProviderBlockingErrorDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplianceSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplianceSpecificDetails.java new file mode 100644 index 000000000000..67accb934a26 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplianceSpecificDetails.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.recoveryservicessiterecovery.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; + +/** InMageRcm appliance specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Immutable +public final class InMageRcmApplianceSpecificDetails extends ApplianceSpecificDetails { + /* + * The list of appliances. + */ + @JsonProperty(value = "appliances", access = JsonProperty.Access.WRITE_ONLY) + private List appliances; + + /** Creates an instance of InMageRcmApplianceSpecificDetails class. */ + public InMageRcmApplianceSpecificDetails() { + } + + /** + * Get the appliances property: The list of appliances. + * + * @return the appliances value. + */ + public List appliances() { + return this.appliances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (appliances() != null) { + appliances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplyRecoveryPointInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplyRecoveryPointInput.java new file mode 100644 index 000000000000..01efca9e698a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplyRecoveryPointInput.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.recoveryservicessiterecovery.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; + +/** ApplyRecoveryPoint input specific to InMageRcm provider. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { + /* + * The recovery point Id. + */ + @JsonProperty(value = "recoveryPointId", required = true) + private String recoveryPointId; + + /** Creates an instance of InMageRcmApplyRecoveryPointInput class. */ + public InMageRcmApplyRecoveryPointInput() { + } + + /** + * Get the recoveryPointId property: The recovery point Id. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point Id. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the InMageRcmApplyRecoveryPointInput object itself. + */ + public InMageRcmApplyRecoveryPointInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointId in model InMageRcmApplyRecoveryPointInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmApplyRecoveryPointInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDiscoveredProtectedVmDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDiscoveredProtectedVmDetails.java new file mode 100644 index 000000000000..ba675cef0c7c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDiscoveredProtectedVmDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** InMageRcm discovered protected VM details. */ +@Immutable +public final class InMageRcmDiscoveredProtectedVmDetails { + /* + * The VCenter Id. + */ + @JsonProperty(value = "vCenterId", access = JsonProperty.Access.WRITE_ONLY) + private String vCenterId; + + /* + * The VCenter fqdn. + */ + @JsonProperty(value = "vCenterFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String vCenterFqdn; + + /* + * The list of datastores. + */ + @JsonProperty(value = "datastores", access = JsonProperty.Access.WRITE_ONLY) + private List datastores; + + /* + * The list of IP addresses. + */ + @JsonProperty(value = "ipAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List ipAddresses; + + /* + * The VMware tools status. + */ + @JsonProperty(value = "vmwareToolsStatus", access = JsonProperty.Access.WRITE_ONLY) + private String vmwareToolsStatus; + + /* + * The VM power status. + */ + @JsonProperty(value = "powerStatus", access = JsonProperty.Access.WRITE_ONLY) + private String powerStatus; + + /* + * The VM fqdn. + */ + @JsonProperty(value = "vmFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String vmFqdn; + + /* + * The VM's OS name. + */ + @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) + private String osName; + + /* + * The SDS created timestamp. + */ + @JsonProperty(value = "createdTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimestamp; + + /* + * The SDS updated timestamp. + */ + @JsonProperty(value = "updatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedTimestamp; + + /* + * A value indicating whether the VM is deleted. + */ + @JsonProperty(value = "isDeleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDeleted; + + /* + * The last time when SDS information discovered in SRS. + */ + @JsonProperty(value = "lastDiscoveryTimeInUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastDiscoveryTimeInUtc; + + /** Creates an instance of InMageRcmDiscoveredProtectedVmDetails class. */ + public InMageRcmDiscoveredProtectedVmDetails() { + } + + /** + * Get the vCenterId property: The VCenter Id. + * + * @return the vCenterId value. + */ + public String vCenterId() { + return this.vCenterId; + } + + /** + * Get the vCenterFqdn property: The VCenter fqdn. + * + * @return the vCenterFqdn value. + */ + public String vCenterFqdn() { + return this.vCenterFqdn; + } + + /** + * Get the datastores property: The list of datastores. + * + * @return the datastores value. + */ + public List datastores() { + return this.datastores; + } + + /** + * Get the ipAddresses property: The list of IP addresses. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Get the vmwareToolsStatus property: The VMware tools status. + * + * @return the vmwareToolsStatus value. + */ + public String vmwareToolsStatus() { + return this.vmwareToolsStatus; + } + + /** + * Get the powerStatus property: The VM power status. + * + * @return the powerStatus value. + */ + public String powerStatus() { + return this.powerStatus; + } + + /** + * Get the vmFqdn property: The VM fqdn. + * + * @return the vmFqdn value. + */ + public String vmFqdn() { + return this.vmFqdn; + } + + /** + * Get the osName property: The VM's OS name. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Get the createdTimestamp property: The SDS created timestamp. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Get the updatedTimestamp property: The SDS updated timestamp. + * + * @return the updatedTimestamp value. + */ + public OffsetDateTime updatedTimestamp() { + return this.updatedTimestamp; + } + + /** + * Get the isDeleted property: A value indicating whether the VM is deleted. + * + * @return the isDeleted value. + */ + public Boolean isDeleted() { + return this.isDeleted; + } + + /** + * Get the lastDiscoveryTimeInUtc property: The last time when SDS information discovered in SRS. + * + * @return the lastDiscoveryTimeInUtc value. + */ + public OffsetDateTime lastDiscoveryTimeInUtc() { + return this.lastDiscoveryTimeInUtc; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDiskInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDiskInput.java new file mode 100644 index 000000000000..d23167a1bb45 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDiskInput.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm disk input. */ +@Fluent +public final class InMageRcmDiskInput { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId", required = true) + private String diskId; + + /* + * The log storage account ARM Id. + */ + @JsonProperty(value = "logStorageAccountId", required = true) + private String logStorageAccountId; + + /* + * The disk type. + */ + @JsonProperty(value = "diskType", required = true) + private DiskAccountType diskType; + + /* + * The DiskEncryptionSet ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** Creates an instance of InMageRcmDiskInput class. */ + public InMageRcmDiskInput() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk Id. + * + * @param diskId the diskId value to set. + * @return the InMageRcmDiskInput object itself. + */ + public InMageRcmDiskInput withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the logStorageAccountId property: The log storage account ARM Id. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The log storage account ARM Id. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the InMageRcmDiskInput object itself. + */ + public InMageRcmDiskInput withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Get the diskType property: The disk type. + * + * @return the diskType value. + */ + public DiskAccountType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The disk type. + * + * @param diskType the diskType value to set. + * @return the InMageRcmDiskInput object itself. + */ + public InMageRcmDiskInput withDiskType(DiskAccountType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the InMageRcmDiskInput object itself. + */ + public InMageRcmDiskInput withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + 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 InMageRcmDiskInput")); + } + if (logStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property logStorageAccountId in model InMageRcmDiskInput")); + } + if (diskType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property diskType in model InMageRcmDiskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmDiskInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDisksDefaultInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDisksDefaultInput.java new file mode 100644 index 000000000000..ef75eef1facd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDisksDefaultInput.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm disk input. */ +@Fluent +public final class InMageRcmDisksDefaultInput { + /* + * The log storage account ARM Id. + */ + @JsonProperty(value = "logStorageAccountId", required = true) + private String logStorageAccountId; + + /* + * The disk type. + */ + @JsonProperty(value = "diskType", required = true) + private DiskAccountType diskType; + + /* + * The DiskEncryptionSet ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** Creates an instance of InMageRcmDisksDefaultInput class. */ + public InMageRcmDisksDefaultInput() { + } + + /** + * Get the logStorageAccountId property: The log storage account ARM Id. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The log storage account ARM Id. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the InMageRcmDisksDefaultInput object itself. + */ + public InMageRcmDisksDefaultInput withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Get the diskType property: The disk type. + * + * @return the diskType value. + */ + public DiskAccountType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The disk type. + * + * @param diskType the diskType value to set. + * @return the InMageRcmDisksDefaultInput object itself. + */ + public InMageRcmDisksDefaultInput withDiskType(DiskAccountType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the InMageRcmDisksDefaultInput object itself. + */ + public InMageRcmDisksDefaultInput withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property logStorageAccountId in model InMageRcmDisksDefaultInput")); + } + if (diskType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property diskType in model InMageRcmDisksDefaultInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmDisksDefaultInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEnableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEnableProtectionInput.java new file mode 100644 index 000000000000..6bee99a71514 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEnableProtectionInput.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageRcm specific enable protection input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmEnableProtectionInput extends EnableProtectionProviderSpecificInput { + /* + * The ARM Id of discovered machine. + */ + @JsonProperty(value = "fabricDiscoveryMachineId", required = true) + private String fabricDiscoveryMachineId; + + /* + * The disks to include list. + */ + @JsonProperty(value = "disksToInclude") + private List disksToInclude; + + /* + * The default disk input. + */ + @JsonProperty(value = "disksDefault") + private InMageRcmDisksDefaultInput disksDefault; + + /* + * The target resource group ARM Id. + */ + @JsonProperty(value = "targetResourceGroupId", required = true) + private String targetResourceGroupId; + + /* + * The selected target network ARM Id. + */ + @JsonProperty(value = "targetNetworkId") + private String targetNetworkId; + + /* + * The selected test network ARM Id. + */ + @JsonProperty(value = "testNetworkId") + private String testNetworkId; + + /* + * The selected target subnet name. + */ + @JsonProperty(value = "targetSubnetName") + private String targetSubnetName; + + /* + * The selected test subnet name. + */ + @JsonProperty(value = "testSubnetName") + private String testSubnetName; + + /* + * The target VM name. + */ + @JsonProperty(value = "targetVmName") + private String targetVmName; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /* + * The license type. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /* + * The target availability set ARM Id. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The target boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId") + private String targetBootDiagnosticsStorageAccountId; + + /* + * The run-as account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /* + * The process server Id. + */ + @JsonProperty(value = "processServerId", required = true) + private String processServerId; + + /* + * The multi VM group name. + */ + @JsonProperty(value = "multiVmGroupName") + private String multiVmGroupName; + + /** Creates an instance of InMageRcmEnableProtectionInput class. */ + public InMageRcmEnableProtectionInput() { + } + + /** + * Get the fabricDiscoveryMachineId property: The ARM Id of discovered machine. + * + * @return the fabricDiscoveryMachineId value. + */ + public String fabricDiscoveryMachineId() { + return this.fabricDiscoveryMachineId; + } + + /** + * Set the fabricDiscoveryMachineId property: The ARM Id of discovered machine. + * + * @param fabricDiscoveryMachineId the fabricDiscoveryMachineId value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withFabricDiscoveryMachineId(String fabricDiscoveryMachineId) { + this.fabricDiscoveryMachineId = fabricDiscoveryMachineId; + return this; + } + + /** + * Get the disksToInclude property: The disks to include list. + * + * @return the disksToInclude value. + */ + public List disksToInclude() { + return this.disksToInclude; + } + + /** + * Set the disksToInclude property: The disks to include list. + * + * @param disksToInclude the disksToInclude value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withDisksToInclude(List disksToInclude) { + this.disksToInclude = disksToInclude; + return this; + } + + /** + * Get the disksDefault property: The default disk input. + * + * @return the disksDefault value. + */ + public InMageRcmDisksDefaultInput disksDefault() { + return this.disksDefault; + } + + /** + * Set the disksDefault property: The default disk input. + * + * @param disksDefault the disksDefault value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withDisksDefault(InMageRcmDisksDefaultInput disksDefault) { + this.disksDefault = disksDefault; + return this; + } + + /** + * Get the targetResourceGroupId property: The target resource group ARM Id. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: The target resource group ARM Id. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the targetNetworkId property: The selected target network ARM Id. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: The selected target network ARM Id. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: The selected test network ARM Id. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: The selected test network ARM Id. + * + * @param testNetworkId the testNetworkId value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the targetSubnetName property: The selected target subnet name. + * + * @return the targetSubnetName value. + */ + public String targetSubnetName() { + return this.targetSubnetName; + } + + /** + * Set the targetSubnetName property: The selected target subnet name. + * + * @param targetSubnetName the targetSubnetName value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTargetSubnetName(String targetSubnetName) { + this.targetSubnetName = targetSubnetName; + return this; + } + + /** + * Get the testSubnetName property: The selected test subnet name. + * + * @return the testSubnetName value. + */ + public String testSubnetName() { + return this.testSubnetName; + } + + /** + * Set the testSubnetName property: The selected test subnet name. + * + * @param testSubnetName the testSubnetName value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTestSubnetName(String testSubnetName) { + this.testSubnetName = testSubnetName; + return this; + } + + /** + * Get the targetVmName property: The target VM name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Set the targetVmName property: The target VM name. + * + * @param targetVmName the targetVmName value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTargetVmName(String targetVmName) { + this.targetVmName = targetVmName; + return this; + } + + /** + * Get the targetVmSize property: The target VM size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Set the targetVmSize property: The target VM size. + * + * @param targetVmSize the targetVmSize value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTargetVmSize(String targetVmSize) { + this.targetVmSize = targetVmSize; + return this; + } + + /** + * Get the licenseType property: The license type. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The license type. + * + * @param licenseType the licenseType value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the targetAvailabilitySetId property: The target availability set ARM Id. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The target availability set ARM Id. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTargetProximityPlacementGroupId(String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @return the targetBootDiagnosticsStorageAccountId value. + */ + public String targetBootDiagnosticsStorageAccountId() { + return this.targetBootDiagnosticsStorageAccountId; + } + + /** + * Set the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @param targetBootDiagnosticsStorageAccountId the targetBootDiagnosticsStorageAccountId value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withTargetBootDiagnosticsStorageAccountId( + String targetBootDiagnosticsStorageAccountId) { + this.targetBootDiagnosticsStorageAccountId = targetBootDiagnosticsStorageAccountId; + return this; + } + + /** + * Get the runAsAccountId property: The run-as account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The run-as account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Get the processServerId property: The process server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The process server Id. + * + * @param processServerId the processServerId value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the multiVmGroupName property: The multi VM group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Set the multiVmGroupName property: The multi VM group name. + * + * @param multiVmGroupName the multiVmGroupName value to set. + * @return the InMageRcmEnableProtectionInput object itself. + */ + public InMageRcmEnableProtectionInput withMultiVmGroupName(String multiVmGroupName) { + this.multiVmGroupName = multiVmGroupName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (fabricDiscoveryMachineId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fabricDiscoveryMachineId in model InMageRcmEnableProtectionInput")); + } + if (disksToInclude() != null) { + disksToInclude().forEach(e -> e.validate()); + } + if (disksDefault() != null) { + disksDefault().validate(); + } + if (targetResourceGroupId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceGroupId in model InMageRcmEnableProtectionInput")); + } + if (processServerId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property processServerId in model InMageRcmEnableProtectionInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmEnableProtectionInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEventDetails.java new file mode 100644 index 000000000000..c948b4c7e24d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEventDetails.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Event details for InMageRcm provider. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Immutable +public final class InMageRcmEventDetails extends EventProviderSpecificDetails { + /* + * The protected item name. + */ + @JsonProperty(value = "protectedItemName", access = JsonProperty.Access.WRITE_ONLY) + private String protectedItemName; + + /* + * The protected item name. + */ + @JsonProperty(value = "vmName", access = JsonProperty.Access.WRITE_ONLY) + private String vmName; + + /* + * The latest agent version. + */ + @JsonProperty(value = "latestAgentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String latestAgentVersion; + + /* + * The job Id. + */ + @JsonProperty(value = "jobId", access = JsonProperty.Access.WRITE_ONLY) + private String jobId; + + /* + * The fabric name. + */ + @JsonProperty(value = "fabricName", access = JsonProperty.Access.WRITE_ONLY) + private String fabricName; + + /* + * The appliance name. + */ + @JsonProperty(value = "applianceName", access = JsonProperty.Access.WRITE_ONLY) + private String applianceName; + + /* + * The server type. + */ + @JsonProperty(value = "serverType", access = JsonProperty.Access.WRITE_ONLY) + private String serverType; + + /* + * The component display name. + */ + @JsonProperty(value = "componentDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String componentDisplayName; + + /** Creates an instance of InMageRcmEventDetails class. */ + public InMageRcmEventDetails() { + } + + /** + * Get the protectedItemName property: The protected item name. + * + * @return the protectedItemName value. + */ + public String protectedItemName() { + return this.protectedItemName; + } + + /** + * Get the vmName property: The protected item name. + * + * @return the vmName value. + */ + public String vmName() { + return this.vmName; + } + + /** + * Get the latestAgentVersion property: The latest agent version. + * + * @return the latestAgentVersion value. + */ + public String latestAgentVersion() { + return this.latestAgentVersion; + } + + /** + * Get the jobId property: The job Id. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Get the fabricName property: The fabric name. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Get the applianceName property: The appliance name. + * + * @return the applianceName value. + */ + public String applianceName() { + return this.applianceName; + } + + /** + * Get the serverType property: The server type. + * + * @return the serverType value. + */ + public String serverType() { + return this.serverType; + } + + /** + * Get the componentDisplayName property: The component display name. + * + * @return the componentDisplayName value. + */ + public String componentDisplayName() { + return this.componentDisplayName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricCreationInput.java new file mode 100644 index 000000000000..c866bbe7f019 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricCreationInput.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageRcm fabric provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmFabricCreationInput extends FabricSpecificCreationInput { + /* + * The ARM Id of the VMware site. + */ + @JsonProperty(value = "vmwareSiteId", required = true) + private String vmwareSiteId; + + /* + * The ARM Id of the physical site. + */ + @JsonProperty(value = "physicalSiteId", required = true) + private String physicalSiteId; + + /* + * The identity provider input for source agent authentication. + */ + @JsonProperty(value = "sourceAgentIdentity", required = true) + private IdentityProviderInput sourceAgentIdentity; + + /** Creates an instance of InMageRcmFabricCreationInput class. */ + public InMageRcmFabricCreationInput() { + } + + /** + * Get the vmwareSiteId property: The ARM Id of the VMware site. + * + * @return the vmwareSiteId value. + */ + public String vmwareSiteId() { + return this.vmwareSiteId; + } + + /** + * Set the vmwareSiteId property: The ARM Id of the VMware site. + * + * @param vmwareSiteId the vmwareSiteId value to set. + * @return the InMageRcmFabricCreationInput object itself. + */ + public InMageRcmFabricCreationInput withVmwareSiteId(String vmwareSiteId) { + this.vmwareSiteId = vmwareSiteId; + return this; + } + + /** + * Get the physicalSiteId property: The ARM Id of the physical site. + * + * @return the physicalSiteId value. + */ + public String physicalSiteId() { + return this.physicalSiteId; + } + + /** + * Set the physicalSiteId property: The ARM Id of the physical site. + * + * @param physicalSiteId the physicalSiteId value to set. + * @return the InMageRcmFabricCreationInput object itself. + */ + public InMageRcmFabricCreationInput withPhysicalSiteId(String physicalSiteId) { + this.physicalSiteId = physicalSiteId; + return this; + } + + /** + * Get the sourceAgentIdentity property: The identity provider input for source agent authentication. + * + * @return the sourceAgentIdentity value. + */ + public IdentityProviderInput sourceAgentIdentity() { + return this.sourceAgentIdentity; + } + + /** + * Set the sourceAgentIdentity property: The identity provider input for source agent authentication. + * + * @param sourceAgentIdentity the sourceAgentIdentity value to set. + * @return the InMageRcmFabricCreationInput object itself. + */ + public InMageRcmFabricCreationInput withSourceAgentIdentity(IdentityProviderInput sourceAgentIdentity) { + this.sourceAgentIdentity = sourceAgentIdentity; + 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 InMageRcmFabricCreationInput")); + } + if (physicalSiteId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property physicalSiteId in model InMageRcmFabricCreationInput")); + } + if (sourceAgentIdentity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceAgentIdentity in model InMageRcmFabricCreationInput")); + } else { + sourceAgentIdentity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmFabricCreationInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricSpecificDetails.java new file mode 100644 index 000000000000..282843e972b2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricSpecificDetails.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.recoveryservicessiterecovery.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; +import java.util.List; + +/** InMageRcm fabric specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmFabricSpecificDetails extends FabricSpecificDetails { + /* + * The ARM Id of the VMware site. + */ + @JsonProperty(value = "vmwareSiteId", access = JsonProperty.Access.WRITE_ONLY) + private String vmwareSiteId; + + /* + * The ARM Id of the physical site. + */ + @JsonProperty(value = "physicalSiteId", access = JsonProperty.Access.WRITE_ONLY) + private String physicalSiteId; + + /* + * The service endpoint. + */ + @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceEndpoint; + + /* + * The service resource Id. + */ + @JsonProperty(value = "serviceResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceResourceId; + + /* + * The service container Id. + */ + @JsonProperty(value = "serviceContainerId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceContainerId; + + /* + * The data plane Uri. + */ + @JsonProperty(value = "dataPlaneUri", access = JsonProperty.Access.WRITE_ONLY) + private String dataPlaneUri; + + /* + * The control plane Uri. + */ + @JsonProperty(value = "controlPlaneUri", access = JsonProperty.Access.WRITE_ONLY) + private String controlPlaneUri; + + /* + * The source agent identity details. + */ + @JsonProperty(value = "sourceAgentIdentityDetails") + private IdentityProviderDetails sourceAgentIdentityDetails; + + /* + * The list of process servers. + */ + @JsonProperty(value = "processServers", access = JsonProperty.Access.WRITE_ONLY) + private List processServers; + + /* + * The list of RCM proxies. + */ + @JsonProperty(value = "rcmProxies", access = JsonProperty.Access.WRITE_ONLY) + private List rcmProxies; + + /* + * The list of push installers. + */ + @JsonProperty(value = "pushInstallers", access = JsonProperty.Access.WRITE_ONLY) + private List pushInstallers; + + /* + * The list of replication agents. + */ + @JsonProperty(value = "replicationAgents", access = JsonProperty.Access.WRITE_ONLY) + private List replicationAgents; + + /* + * The list of reprotect agents. + */ + @JsonProperty(value = "reprotectAgents", access = JsonProperty.Access.WRITE_ONLY) + private List reprotectAgents; + + /* + * The list of Mars agents. + */ + @JsonProperty(value = "marsAgents", access = JsonProperty.Access.WRITE_ONLY) + private List marsAgents; + + /* + * The list of DRAs. + */ + @JsonProperty(value = "dras", access = JsonProperty.Access.WRITE_ONLY) + private List dras; + + /* + * The list of agent details. + */ + @JsonProperty(value = "agentDetails", access = JsonProperty.Access.WRITE_ONLY) + private List agentDetails; + + /** Creates an instance of InMageRcmFabricSpecificDetails class. */ + public InMageRcmFabricSpecificDetails() { + } + + /** + * Get the vmwareSiteId property: The ARM Id of the VMware site. + * + * @return the vmwareSiteId value. + */ + public String vmwareSiteId() { + return this.vmwareSiteId; + } + + /** + * Get the physicalSiteId property: The ARM Id of the physical site. + * + * @return the physicalSiteId value. + */ + public String physicalSiteId() { + return this.physicalSiteId; + } + + /** + * Get the serviceEndpoint property: The service endpoint. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.serviceEndpoint; + } + + /** + * Get the serviceResourceId property: The service resource Id. + * + * @return the serviceResourceId value. + */ + public String serviceResourceId() { + return this.serviceResourceId; + } + + /** + * Get the serviceContainerId property: The service container Id. + * + * @return the serviceContainerId value. + */ + public String serviceContainerId() { + return this.serviceContainerId; + } + + /** + * Get the dataPlaneUri property: The data plane Uri. + * + * @return the dataPlaneUri value. + */ + public String dataPlaneUri() { + return this.dataPlaneUri; + } + + /** + * Get the controlPlaneUri property: The control plane Uri. + * + * @return the controlPlaneUri value. + */ + public String controlPlaneUri() { + return this.controlPlaneUri; + } + + /** + * Get the sourceAgentIdentityDetails property: The source agent identity details. + * + * @return the sourceAgentIdentityDetails value. + */ + public IdentityProviderDetails sourceAgentIdentityDetails() { + return this.sourceAgentIdentityDetails; + } + + /** + * Set the sourceAgentIdentityDetails property: The source agent identity details. + * + * @param sourceAgentIdentityDetails the sourceAgentIdentityDetails value to set. + * @return the InMageRcmFabricSpecificDetails object itself. + */ + public InMageRcmFabricSpecificDetails withSourceAgentIdentityDetails( + IdentityProviderDetails sourceAgentIdentityDetails) { + this.sourceAgentIdentityDetails = sourceAgentIdentityDetails; + return this; + } + + /** + * Get the processServers property: The list of process servers. + * + * @return the processServers value. + */ + public List processServers() { + return this.processServers; + } + + /** + * Get the rcmProxies property: The list of RCM proxies. + * + * @return the rcmProxies value. + */ + public List rcmProxies() { + return this.rcmProxies; + } + + /** + * Get the pushInstallers property: The list of push installers. + * + * @return the pushInstallers value. + */ + public List pushInstallers() { + return this.pushInstallers; + } + + /** + * Get the replicationAgents property: The list of replication agents. + * + * @return the replicationAgents value. + */ + public List replicationAgents() { + return this.replicationAgents; + } + + /** + * Get the reprotectAgents property: The list of reprotect agents. + * + * @return the reprotectAgents value. + */ + public List reprotectAgents() { + return this.reprotectAgents; + } + + /** + * Get the marsAgents property: The list of Mars agents. + * + * @return the marsAgents value. + */ + public List marsAgents() { + return this.marsAgents; + } + + /** + * Get the dras property: The list of DRAs. + * + * @return the dras value. + */ + public List dras() { + return this.dras; + } + + /** + * Get the agentDetails property: The list of agent details. + * + * @return the agentDetails value. + */ + public List agentDetails() { + return this.agentDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sourceAgentIdentityDetails() != null) { + sourceAgentIdentityDetails().validate(); + } + if (processServers() != null) { + processServers().forEach(e -> e.validate()); + } + if (rcmProxies() != null) { + rcmProxies().forEach(e -> e.validate()); + } + if (pushInstallers() != null) { + pushInstallers().forEach(e -> e.validate()); + } + if (replicationAgents() != null) { + replicationAgents().forEach(e -> e.validate()); + } + if (reprotectAgents() != null) { + reprotectAgents().forEach(e -> e.validate()); + } + if (marsAgents() != null) { + marsAgents().forEach(e -> e.validate()); + } + if (dras() != null) { + dras().forEach(e -> e.validate()); + } + if (agentDetails() != null) { + agentDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricSwitchProviderBlockingErrorDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricSwitchProviderBlockingErrorDetails.java new file mode 100644 index 000000000000..96e5a3b05376 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricSwitchProviderBlockingErrorDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** InMageRcmFabric switch provider blocking error details. */ +@Immutable +public final class InMageRcmFabricSwitchProviderBlockingErrorDetails { + /* + * The error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /* + * The error message. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * The possible causes. + */ + @JsonProperty(value = "possibleCauses", access = JsonProperty.Access.WRITE_ONLY) + private String possibleCauses; + + /* + * The recommended action. + */ + @JsonProperty(value = "recommendedAction", access = JsonProperty.Access.WRITE_ONLY) + private String recommendedAction; + + /* + * The error message parameters. + */ + @JsonProperty(value = "errorMessageParameters", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorMessageParameters; + + /* + * The error tags. + */ + @JsonProperty(value = "errorTags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorTags; + + /** Creates an instance of InMageRcmFabricSwitchProviderBlockingErrorDetails class. */ + public InMageRcmFabricSwitchProviderBlockingErrorDetails() { + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the possibleCauses property: The possible causes. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Get the recommendedAction property: The recommended action. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Get the errorMessageParameters property: The error message parameters. + * + * @return the errorMessageParameters value. + */ + public Map errorMessageParameters() { + return this.errorMessageParameters; + } + + /** + * Get the errorTags property: The error tags. + * + * @return the errorTags value. + */ + public Map errorTags() { + return this.errorTags; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackDiscoveredProtectedVmDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackDiscoveredProtectedVmDetails.java new file mode 100644 index 000000000000..d02045340016 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackDiscoveredProtectedVmDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** InMageRcmFailback discovered VM details. */ +@Immutable +public final class InMageRcmFailbackDiscoveredProtectedVmDetails { + /* + * The VCenter Id. + */ + @JsonProperty(value = "vCenterId", access = JsonProperty.Access.WRITE_ONLY) + private String vCenterId; + + /* + * The VCenter fqdn. + */ + @JsonProperty(value = "vCenterFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String vCenterFqdn; + + /* + * The list of datastores. + */ + @JsonProperty(value = "datastores", access = JsonProperty.Access.WRITE_ONLY) + private List datastores; + + /* + * The list of IP addresses. + */ + @JsonProperty(value = "ipAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List ipAddresses; + + /* + * The VMware tools status. + */ + @JsonProperty(value = "vmwareToolsStatus", access = JsonProperty.Access.WRITE_ONLY) + private String vmwareToolsStatus; + + /* + * The VM power status. + */ + @JsonProperty(value = "powerStatus", access = JsonProperty.Access.WRITE_ONLY) + private String powerStatus; + + /* + * The VM fqdn. + */ + @JsonProperty(value = "vmFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String vmFqdn; + + /* + * The VM's OS name. + */ + @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) + private String osName; + + /* + * The SDS created timestamp. + */ + @JsonProperty(value = "createdTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimestamp; + + /* + * The SDS updated timestamp. + */ + @JsonProperty(value = "updatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedTimestamp; + + /* + * A value indicating whether the VM is deleted. + */ + @JsonProperty(value = "isDeleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDeleted; + + /* + * The last time when SDS information discovered in SRS. + */ + @JsonProperty(value = "lastDiscoveryTimeInUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastDiscoveryTimeInUtc; + + /** Creates an instance of InMageRcmFailbackDiscoveredProtectedVmDetails class. */ + public InMageRcmFailbackDiscoveredProtectedVmDetails() { + } + + /** + * Get the vCenterId property: The VCenter Id. + * + * @return the vCenterId value. + */ + public String vCenterId() { + return this.vCenterId; + } + + /** + * Get the vCenterFqdn property: The VCenter fqdn. + * + * @return the vCenterFqdn value. + */ + public String vCenterFqdn() { + return this.vCenterFqdn; + } + + /** + * Get the datastores property: The list of datastores. + * + * @return the datastores value. + */ + public List datastores() { + return this.datastores; + } + + /** + * Get the ipAddresses property: The list of IP addresses. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Get the vmwareToolsStatus property: The VMware tools status. + * + * @return the vmwareToolsStatus value. + */ + public String vmwareToolsStatus() { + return this.vmwareToolsStatus; + } + + /** + * Get the powerStatus property: The VM power status. + * + * @return the powerStatus value. + */ + public String powerStatus() { + return this.powerStatus; + } + + /** + * Get the vmFqdn property: The VM fqdn. + * + * @return the vmFqdn value. + */ + public String vmFqdn() { + return this.vmFqdn; + } + + /** + * Get the osName property: The VM's OS name. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Get the createdTimestamp property: The SDS created timestamp. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Get the updatedTimestamp property: The SDS updated timestamp. + * + * @return the updatedTimestamp value. + */ + public OffsetDateTime updatedTimestamp() { + return this.updatedTimestamp; + } + + /** + * Get the isDeleted property: A value indicating whether the VM is deleted. + * + * @return the isDeleted value. + */ + public Boolean isDeleted() { + return this.isDeleted; + } + + /** + * Get the lastDiscoveryTimeInUtc property: The last time when SDS information discovered in SRS. + * + * @return the lastDiscoveryTimeInUtc value. + */ + public OffsetDateTime lastDiscoveryTimeInUtc() { + return this.lastDiscoveryTimeInUtc; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackEventDetails.java new file mode 100644 index 000000000000..18eb9416ded3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackEventDetails.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.recoveryservicessiterecovery.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; + +/** Event details for InMageRcmFailback provider. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcmFailback") +@Immutable +public final class InMageRcmFailbackEventDetails extends EventProviderSpecificDetails { + /* + * The protected item name. + */ + @JsonProperty(value = "protectedItemName", access = JsonProperty.Access.WRITE_ONLY) + private String protectedItemName; + + /* + * The protected item name. + */ + @JsonProperty(value = "vmName", access = JsonProperty.Access.WRITE_ONLY) + private String vmName; + + /* + * The appliance name. + */ + @JsonProperty(value = "applianceName", access = JsonProperty.Access.WRITE_ONLY) + private String applianceName; + + /* + * The server type. + */ + @JsonProperty(value = "serverType", access = JsonProperty.Access.WRITE_ONLY) + private String serverType; + + /* + * The component display name. + */ + @JsonProperty(value = "componentDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String componentDisplayName; + + /** Creates an instance of InMageRcmFailbackEventDetails class. */ + public InMageRcmFailbackEventDetails() { + } + + /** + * Get the protectedItemName property: The protected item name. + * + * @return the protectedItemName value. + */ + public String protectedItemName() { + return this.protectedItemName; + } + + /** + * Get the vmName property: The protected item name. + * + * @return the vmName value. + */ + public String vmName() { + return this.vmName; + } + + /** + * Get the applianceName property: The appliance name. + * + * @return the applianceName value. + */ + public String applianceName() { + return this.applianceName; + } + + /** + * Get the serverType property: The server type. + * + * @return the serverType value. + */ + public String serverType() { + return this.serverType; + } + + /** + * Get the componentDisplayName property: The component display name. + * + * @return the componentDisplayName value. + */ + public String componentDisplayName() { + return this.componentDisplayName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackMobilityAgentDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackMobilityAgentDetails.java new file mode 100644 index 000000000000..2733f22945bc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackMobilityAgentDetails.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** InMageRcmFailback mobility agent details. */ +@Immutable +public final class InMageRcmFailbackMobilityAgentDetails { + /* + * The agent version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The latest agent version available. + */ + @JsonProperty(value = "latestVersion", access = JsonProperty.Access.WRITE_ONLY) + private String latestVersion; + + /* + * The driver version. + */ + @JsonProperty(value = "driverVersion", access = JsonProperty.Access.WRITE_ONLY) + private String driverVersion; + + /* + * The latest upgradeable version available without reboot. + */ + @JsonProperty(value = "latestUpgradableVersionWithoutReboot", access = JsonProperty.Access.WRITE_ONLY) + private String latestUpgradableVersionWithoutReboot; + + /* + * The agent version expiry date. + */ + @JsonProperty(value = "agentVersionExpiryDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime agentVersionExpiryDate; + + /* + * The driver version expiry date. + */ + @JsonProperty(value = "driverVersionExpiryDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime driverVersionExpiryDate; + + /* + * The time of the last heartbeat received from the agent. + */ + @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeatUtc; + + /* + * The whether update is possible or not. + */ + @JsonProperty(value = "reasonsBlockingUpgrade", access = JsonProperty.Access.WRITE_ONLY) + private List reasonsBlockingUpgrade; + + /* + * A value indicating whether agent is upgradeable or not. + */ + @JsonProperty(value = "isUpgradeable", access = JsonProperty.Access.WRITE_ONLY) + private String isUpgradeable; + + /** Creates an instance of InMageRcmFailbackMobilityAgentDetails class. */ + public InMageRcmFailbackMobilityAgentDetails() { + } + + /** + * Get the version property: The agent version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the latestVersion property: The latest agent version available. + * + * @return the latestVersion value. + */ + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the driverVersion property: The driver version. + * + * @return the driverVersion value. + */ + public String driverVersion() { + return this.driverVersion; + } + + /** + * Get the latestUpgradableVersionWithoutReboot property: The latest upgradeable version available without reboot. + * + * @return the latestUpgradableVersionWithoutReboot value. + */ + public String latestUpgradableVersionWithoutReboot() { + return this.latestUpgradableVersionWithoutReboot; + } + + /** + * Get the agentVersionExpiryDate property: The agent version expiry date. + * + * @return the agentVersionExpiryDate value. + */ + public OffsetDateTime agentVersionExpiryDate() { + return this.agentVersionExpiryDate; + } + + /** + * Get the driverVersionExpiryDate property: The driver version expiry date. + * + * @return the driverVersionExpiryDate value. + */ + public OffsetDateTime driverVersionExpiryDate() { + return this.driverVersionExpiryDate; + } + + /** + * Get the lastHeartbeatUtc property: The time of the last heartbeat received from the agent. + * + * @return the lastHeartbeatUtc value. + */ + public OffsetDateTime lastHeartbeatUtc() { + return this.lastHeartbeatUtc; + } + + /** + * Get the reasonsBlockingUpgrade property: The whether update is possible or not. + * + * @return the reasonsBlockingUpgrade value. + */ + public List reasonsBlockingUpgrade() { + return this.reasonsBlockingUpgrade; + } + + /** + * Get the isUpgradeable property: A value indicating whether agent is upgradeable or not. + * + * @return the isUpgradeable value. + */ + public String isUpgradeable() { + return this.isUpgradeable; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackNicDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackNicDetails.java new file mode 100644 index 000000000000..67a74c32f7a1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackNicDetails.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcmFailback NIC details. */ +@Immutable +public final class InMageRcmFailbackNicDetails { + /* + * The mac address. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * The network name. + */ + @JsonProperty(value = "networkName", access = JsonProperty.Access.WRITE_ONLY) + private String networkName; + + /* + * The adapter type. + */ + @JsonProperty(value = "adapterType", access = JsonProperty.Access.WRITE_ONLY) + private String adapterType; + + /* + * The IP address. + */ + @JsonProperty(value = "sourceIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String sourceIpAddress; + + /** Creates an instance of InMageRcmFailbackNicDetails class. */ + public InMageRcmFailbackNicDetails() { + } + + /** + * Get the macAddress property: The mac address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the networkName property: The network name. + * + * @return the networkName value. + */ + public String networkName() { + return this.networkName; + } + + /** + * Get the adapterType property: The adapter type. + * + * @return the adapterType value. + */ + public String adapterType() { + return this.adapterType; + } + + /** + * Get the sourceIpAddress property: The IP address. + * + * @return the sourceIpAddress value. + */ + public String sourceIpAddress() { + return this.sourceIpAddress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPlannedFailoverProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPlannedFailoverProviderInput.java new file mode 100644 index 000000000000..4d9d0fdf1c07 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPlannedFailoverProviderInput.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Provider specific input for InMageRcmFailback failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcmFailback") +@Fluent +public final class InMageRcmFailbackPlannedFailoverProviderInput extends PlannedFailoverProviderSpecificFailoverInput { + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType", required = true) + private InMageRcmFailbackRecoveryPointType recoveryPointType; + + /** Creates an instance of InMageRcmFailbackPlannedFailoverProviderInput class. */ + public InMageRcmFailbackPlannedFailoverProviderInput() { + } + + /** + * Get the recoveryPointType property: The recovery point type. + * + * @return the recoveryPointType value. + */ + public InMageRcmFailbackRecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the InMageRcmFailbackPlannedFailoverProviderInput object itself. + */ + public InMageRcmFailbackPlannedFailoverProviderInput withRecoveryPointType( + InMageRcmFailbackRecoveryPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointType in model" + + " InMageRcmFailbackPlannedFailoverProviderInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmFailbackPlannedFailoverProviderInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPolicyCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPolicyCreationInput.java new file mode 100644 index 000000000000..80102850ded9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPolicyCreationInput.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageRcmFailback policy creation input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcmFailback") +@Fluent +public final class InMageRcmFailbackPolicyCreationInput extends PolicyProviderSpecificInput { + /* + * The crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /* + * The app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /** Creates an instance of InMageRcmFailbackPolicyCreationInput class. */ + public InMageRcmFailbackPolicyCreationInput() { + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the InMageRcmFailbackPolicyCreationInput object itself. + */ + public InMageRcmFailbackPolicyCreationInput withCrashConsistentFrequencyInMinutes( + Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the InMageRcmFailbackPolicyCreationInput object itself. + */ + public InMageRcmFailbackPolicyCreationInput withAppConsistentFrequencyInMinutes( + Integer 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPolicyDetails.java new file mode 100644 index 000000000000..21fa3ca3cc77 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackPolicyDetails.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.recoveryservicessiterecovery.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; + +/** InMageRcm failback specific policy details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcmFailback") +@Fluent +public final class InMageRcmFailbackPolicyDetails extends PolicyProviderSpecificDetails { + /* + * The app consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * The crash consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /** Creates an instance of InMageRcmFailbackPolicyDetails class. */ + public InMageRcmFailbackPolicyDetails() { + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the InMageRcmFailbackPolicyDetails object itself. + */ + public InMageRcmFailbackPolicyDetails withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the InMageRcmFailbackPolicyDetails object itself. + */ + public InMageRcmFailbackPolicyDetails withCrashConsistentFrequencyInMinutes( + Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackProtectedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackProtectedDiskDetails.java new file mode 100644 index 000000000000..171bdb305ca6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackProtectedDiskDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** InMageRcmFailback protected disk details. */ +@Fluent +public final class InMageRcmFailbackProtectedDiskDetails { + /* + * The disk Id (reported by source agent). + */ + @JsonProperty(value = "diskId", access = JsonProperty.Access.WRITE_ONLY) + private String diskId; + + /* + * The disk name. + */ + @JsonProperty(value = "diskName", access = JsonProperty.Access.WRITE_ONLY) + private String diskName; + + /* + * A value indicating whether the disk is the OS disk. + */ + @JsonProperty(value = "isOSDisk", access = JsonProperty.Access.WRITE_ONLY) + private String isOSDisk; + + /* + * The disk capacity in bytes. + */ + @JsonProperty(value = "capacityInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityInBytes; + + /* + * The disk Uuid (reported by vCenter). + */ + @JsonProperty(value = "diskUuid", access = JsonProperty.Access.WRITE_ONLY) + private String diskUuid; + + /* + * The data pending in log data store in MB. + */ + @JsonProperty(value = "dataPendingInLogDataStoreInMB", access = JsonProperty.Access.WRITE_ONLY) + private Double dataPendingInLogDataStoreInMB; + + /* + * The data pending at source agent in MB. + */ + @JsonProperty(value = "dataPendingAtSourceAgentInMB", access = JsonProperty.Access.WRITE_ONLY) + private Double dataPendingAtSourceAgentInMB; + + /* + * A value indicating whether initial replication is complete or not. + */ + @JsonProperty(value = "isInitialReplicationComplete", access = JsonProperty.Access.WRITE_ONLY) + private String isInitialReplicationComplete; + + /* + * The initial replication details. + */ + @JsonProperty(value = "irDetails") + private InMageRcmFailbackSyncDetails irDetails; + + /* + * The resync details. + */ + @JsonProperty(value = "resyncDetails") + private InMageRcmFailbackSyncDetails resyncDetails; + + /* + * The last sync time. + */ + @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSyncTime; + + /** Creates an instance of InMageRcmFailbackProtectedDiskDetails class. */ + public InMageRcmFailbackProtectedDiskDetails() { + } + + /** + * Get the diskId property: The disk Id (reported by source agent). + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Get the diskName property: The disk name. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Get the isOSDisk property: A value indicating whether the disk is the OS disk. + * + * @return the isOSDisk value. + */ + public String isOSDisk() { + return this.isOSDisk; + } + + /** + * Get the capacityInBytes property: The disk capacity in bytes. + * + * @return the capacityInBytes value. + */ + public Long capacityInBytes() { + return this.capacityInBytes; + } + + /** + * Get the diskUuid property: The disk Uuid (reported by vCenter). + * + * @return the diskUuid value. + */ + public String diskUuid() { + return this.diskUuid; + } + + /** + * Get the dataPendingInLogDataStoreInMB property: The data pending in log data store in MB. + * + * @return the dataPendingInLogDataStoreInMB value. + */ + public Double dataPendingInLogDataStoreInMB() { + return this.dataPendingInLogDataStoreInMB; + } + + /** + * Get the dataPendingAtSourceAgentInMB property: The data pending at source agent in MB. + * + * @return the dataPendingAtSourceAgentInMB value. + */ + public Double dataPendingAtSourceAgentInMB() { + return this.dataPendingAtSourceAgentInMB; + } + + /** + * Get the isInitialReplicationComplete property: A value indicating whether initial replication is complete or not. + * + * @return the isInitialReplicationComplete value. + */ + public String isInitialReplicationComplete() { + return this.isInitialReplicationComplete; + } + + /** + * Get the irDetails property: The initial replication details. + * + * @return the irDetails value. + */ + public InMageRcmFailbackSyncDetails irDetails() { + return this.irDetails; + } + + /** + * Set the irDetails property: The initial replication details. + * + * @param irDetails the irDetails value to set. + * @return the InMageRcmFailbackProtectedDiskDetails object itself. + */ + public InMageRcmFailbackProtectedDiskDetails withIrDetails(InMageRcmFailbackSyncDetails irDetails) { + this.irDetails = irDetails; + return this; + } + + /** + * Get the resyncDetails property: The resync details. + * + * @return the resyncDetails value. + */ + public InMageRcmFailbackSyncDetails resyncDetails() { + return this.resyncDetails; + } + + /** + * Set the resyncDetails property: The resync details. + * + * @param resyncDetails the resyncDetails value to set. + * @return the InMageRcmFailbackProtectedDiskDetails object itself. + */ + public InMageRcmFailbackProtectedDiskDetails withResyncDetails(InMageRcmFailbackSyncDetails resyncDetails) { + this.resyncDetails = resyncDetails; + return this; + } + + /** + * Get the lastSyncTime property: The last sync time. + * + * @return the lastSyncTime value. + */ + public OffsetDateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (irDetails() != null) { + irDetails().validate(); + } + if (resyncDetails() != null) { + resyncDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackRecoveryPointType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackRecoveryPointType.java new file mode 100644 index 000000000000..1322e98868d7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackRecoveryPointType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recovery point type. */ +public final class InMageRcmFailbackRecoveryPointType extends ExpandableStringEnum { + /** Static value ApplicationConsistent for InMageRcmFailbackRecoveryPointType. */ + public static final InMageRcmFailbackRecoveryPointType APPLICATION_CONSISTENT = fromString("ApplicationConsistent"); + + /** Static value CrashConsistent for InMageRcmFailbackRecoveryPointType. */ + public static final InMageRcmFailbackRecoveryPointType CRASH_CONSISTENT = fromString("CrashConsistent"); + + /** + * Creates or finds a InMageRcmFailbackRecoveryPointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InMageRcmFailbackRecoveryPointType. + */ + @JsonCreator + public static InMageRcmFailbackRecoveryPointType fromString(String name) { + return fromString(name, InMageRcmFailbackRecoveryPointType.class); + } + + /** + * Gets known InMageRcmFailbackRecoveryPointType values. + * + * @return known InMageRcmFailbackRecoveryPointType values. + */ + public static Collection values() { + return values(InMageRcmFailbackRecoveryPointType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackReplicationDetails.java new file mode 100644 index 000000000000..156b030bdf61 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackReplicationDetails.java @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.time.OffsetDateTime; +import java.util.List; + +/** InMageRcmFailback provider specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcmFailback") +@Fluent +public final class InMageRcmFailbackReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * The virtual machine internal identifier. + */ + @JsonProperty(value = "internalIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String internalIdentifier; + + /* + * The ARM Id of the azure VM. + */ + @JsonProperty(value = "azureVirtualMachineId", access = JsonProperty.Access.WRITE_ONLY) + private String azureVirtualMachineId; + + /* + * The multi VM group name. + */ + @JsonProperty(value = "multiVmGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String multiVmGroupName; + + /* + * The reprotect agent Id. + */ + @JsonProperty(value = "reprotectAgentId", access = JsonProperty.Access.WRITE_ONLY) + private String reprotectAgentId; + + /* + * The reprotect agent name. + */ + @JsonProperty(value = "reprotectAgentName", access = JsonProperty.Access.WRITE_ONLY) + private String reprotectAgentName; + + /* + * The type of the OS on the VM. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /* + * The log storage account ARM Id. + */ + @JsonProperty(value = "logStorageAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String logStorageAccountId; + + /* + * The target vCenter Id. + */ + @JsonProperty(value = "targetvCenterId", access = JsonProperty.Access.WRITE_ONLY) + private String targetvCenterId; + + /* + * The target datastore name. + */ + @JsonProperty(value = "targetDataStoreName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDataStoreName; + + /* + * The target VM name. + */ + @JsonProperty(value = "targetVmName", access = JsonProperty.Access.WRITE_ONLY) + private String targetVmName; + + /* + * The initial replication progress percentage. + */ + @JsonProperty(value = "initialReplicationProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer initialReplicationProgressPercentage; + + /* + * The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all + * selected disks in source VM. + */ + @JsonProperty(value = "initialReplicationProcessedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long initialReplicationProcessedBytes; + + /* + * The initial replication transferred bytes from source VM to target for all selected disks on source VM. + */ + @JsonProperty(value = "initialReplicationTransferredBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long initialReplicationTransferredBytes; + + /* + * The initial replication progress health. + */ + @JsonProperty(value = "initialReplicationProgressHealth", access = JsonProperty.Access.WRITE_ONLY) + private VmReplicationProgressHealth initialReplicationProgressHealth; + + /* + * The resync progress percentage. + */ + @JsonProperty(value = "resyncProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer resyncProgressPercentage; + + /* + * The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks + * in source VM. + */ + @JsonProperty(value = "resyncProcessedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long resyncProcessedBytes; + + /* + * The resync transferred bytes from source VM to target for all selected disks on source VM. + */ + @JsonProperty(value = "resyncTransferredBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long resyncTransferredBytes; + + /* + * The resync progress health. + */ + @JsonProperty(value = "resyncProgressHealth", access = JsonProperty.Access.WRITE_ONLY) + private VmReplicationProgressHealth resyncProgressHealth; + + /* + * A value indicating whether resync is required. + */ + @JsonProperty(value = "resyncRequired", access = JsonProperty.Access.WRITE_ONLY) + private String resyncRequired; + + /* + * The resync state. + */ + @JsonProperty(value = "resyncState", access = JsonProperty.Access.WRITE_ONLY) + private ResyncState resyncState; + + /* + * The list of protected disks. + */ + @JsonProperty(value = "protectedDisks") + private List protectedDisks; + + /* + * The mobility agent information. + */ + @JsonProperty(value = "mobilityAgentDetails") + private InMageRcmFailbackMobilityAgentDetails mobilityAgentDetails; + + /* + * The network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The last planned failover start time. + */ + @JsonProperty(value = "lastPlannedFailoverStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastPlannedFailoverStartTime; + + /* + * The last planned failover status. + */ + @JsonProperty(value = "lastPlannedFailoverStatus", access = JsonProperty.Access.WRITE_ONLY) + private PlannedFailoverStatus lastPlannedFailoverStatus; + + /* + * The discovered VM information. + */ + @JsonProperty(value = "discoveredVmDetails") + private InMageRcmFailbackDiscoveredProtectedVmDetails discoveredVmDetails; + + /* + * The policy Id used by the forward replication. + */ + @JsonProperty(value = "lastUsedPolicyId", access = JsonProperty.Access.WRITE_ONLY) + private String lastUsedPolicyId; + + /* + * The policy friendly name used by the forward replication. + */ + @JsonProperty(value = "lastUsedPolicyFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String lastUsedPolicyFriendlyName; + + /* + * A value indicating whether agent registration was successful after failover. + */ + @JsonProperty(value = "isAgentRegistrationSuccessfulAfterFailover", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isAgentRegistrationSuccessfulAfterFailover; + + /** Creates an instance of InMageRcmFailbackReplicationDetails class. */ + public InMageRcmFailbackReplicationDetails() { + } + + /** + * Get the internalIdentifier property: The virtual machine internal identifier. + * + * @return the internalIdentifier value. + */ + public String internalIdentifier() { + return this.internalIdentifier; + } + + /** + * Get the azureVirtualMachineId property: The ARM Id of the azure VM. + * + * @return the azureVirtualMachineId value. + */ + public String azureVirtualMachineId() { + return this.azureVirtualMachineId; + } + + /** + * Get the multiVmGroupName property: The multi VM group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Get the reprotectAgentId property: The reprotect agent Id. + * + * @return the reprotectAgentId value. + */ + public String reprotectAgentId() { + return this.reprotectAgentId; + } + + /** + * Get the reprotectAgentName property: The reprotect agent name. + * + * @return the reprotectAgentName value. + */ + public String reprotectAgentName() { + return this.reprotectAgentName; + } + + /** + * Get the osType property: The type of the OS on the VM. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the logStorageAccountId property: The log storage account ARM Id. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Get the targetvCenterId property: The target vCenter Id. + * + * @return the targetvCenterId value. + */ + public String targetvCenterId() { + return this.targetvCenterId; + } + + /** + * Get the targetDataStoreName property: The target datastore name. + * + * @return the targetDataStoreName value. + */ + public String targetDataStoreName() { + return this.targetDataStoreName; + } + + /** + * Get the targetVmName property: The target VM name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Get the initialReplicationProgressPercentage property: The initial replication progress percentage. + * + * @return the initialReplicationProgressPercentage value. + */ + public Integer initialReplicationProgressPercentage() { + return this.initialReplicationProgressPercentage; + } + + /** + * Get the initialReplicationProcessedBytes property: The initial replication processed bytes. This includes sum of + * total bytes transferred and matched bytes on all selected disks in source VM. + * + * @return the initialReplicationProcessedBytes value. + */ + public Long initialReplicationProcessedBytes() { + return this.initialReplicationProcessedBytes; + } + + /** + * Get the initialReplicationTransferredBytes property: The initial replication transferred bytes from source VM to + * target for all selected disks on source VM. + * + * @return the initialReplicationTransferredBytes value. + */ + public Long initialReplicationTransferredBytes() { + return this.initialReplicationTransferredBytes; + } + + /** + * Get the initialReplicationProgressHealth property: The initial replication progress health. + * + * @return the initialReplicationProgressHealth value. + */ + public VmReplicationProgressHealth initialReplicationProgressHealth() { + return this.initialReplicationProgressHealth; + } + + /** + * Get the resyncProgressPercentage property: The resync progress percentage. + * + * @return the resyncProgressPercentage value. + */ + public Integer resyncProgressPercentage() { + return this.resyncProgressPercentage; + } + + /** + * Get the resyncProcessedBytes property: The resync processed bytes. This includes sum of total bytes transferred + * and matched bytes on all selected disks in source VM. + * + * @return the resyncProcessedBytes value. + */ + public Long resyncProcessedBytes() { + return this.resyncProcessedBytes; + } + + /** + * Get the resyncTransferredBytes property: The resync transferred bytes from source VM to target for all selected + * disks on source VM. + * + * @return the resyncTransferredBytes value. + */ + public Long resyncTransferredBytes() { + return this.resyncTransferredBytes; + } + + /** + * Get the resyncProgressHealth property: The resync progress health. + * + * @return the resyncProgressHealth value. + */ + public VmReplicationProgressHealth resyncProgressHealth() { + return this.resyncProgressHealth; + } + + /** + * Get the resyncRequired property: A value indicating whether resync is required. + * + * @return the resyncRequired value. + */ + public String resyncRequired() { + return this.resyncRequired; + } + + /** + * Get the resyncState property: The resync state. + * + * @return the resyncState value. + */ + public ResyncState resyncState() { + return this.resyncState; + } + + /** + * Get the protectedDisks property: The list of protected disks. + * + * @return the protectedDisks value. + */ + public List protectedDisks() { + return this.protectedDisks; + } + + /** + * Set the protectedDisks property: The list of protected disks. + * + * @param protectedDisks the protectedDisks value to set. + * @return the InMageRcmFailbackReplicationDetails object itself. + */ + public InMageRcmFailbackReplicationDetails withProtectedDisks( + List protectedDisks) { + this.protectedDisks = protectedDisks; + return this; + } + + /** + * Get the mobilityAgentDetails property: The mobility agent information. + * + * @return the mobilityAgentDetails value. + */ + public InMageRcmFailbackMobilityAgentDetails mobilityAgentDetails() { + return this.mobilityAgentDetails; + } + + /** + * Set the mobilityAgentDetails property: The mobility agent information. + * + * @param mobilityAgentDetails the mobilityAgentDetails value to set. + * @return the InMageRcmFailbackReplicationDetails object itself. + */ + public InMageRcmFailbackReplicationDetails withMobilityAgentDetails( + InMageRcmFailbackMobilityAgentDetails mobilityAgentDetails) { + this.mobilityAgentDetails = mobilityAgentDetails; + return this; + } + + /** + * Get the vmNics property: The network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The network details. + * + * @param vmNics the vmNics value to set. + * @return the InMageRcmFailbackReplicationDetails object itself. + */ + public InMageRcmFailbackReplicationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the lastPlannedFailoverStartTime property: The last planned failover start time. + * + * @return the lastPlannedFailoverStartTime value. + */ + public OffsetDateTime lastPlannedFailoverStartTime() { + return this.lastPlannedFailoverStartTime; + } + + /** + * Get the lastPlannedFailoverStatus property: The last planned failover status. + * + * @return the lastPlannedFailoverStatus value. + */ + public PlannedFailoverStatus lastPlannedFailoverStatus() { + return this.lastPlannedFailoverStatus; + } + + /** + * Get the discoveredVmDetails property: The discovered VM information. + * + * @return the discoveredVmDetails value. + */ + public InMageRcmFailbackDiscoveredProtectedVmDetails discoveredVmDetails() { + return this.discoveredVmDetails; + } + + /** + * Set the discoveredVmDetails property: The discovered VM information. + * + * @param discoveredVmDetails the discoveredVmDetails value to set. + * @return the InMageRcmFailbackReplicationDetails object itself. + */ + public InMageRcmFailbackReplicationDetails withDiscoveredVmDetails( + InMageRcmFailbackDiscoveredProtectedVmDetails discoveredVmDetails) { + this.discoveredVmDetails = discoveredVmDetails; + return this; + } + + /** + * Get the lastUsedPolicyId property: The policy Id used by the forward replication. + * + * @return the lastUsedPolicyId value. + */ + public String lastUsedPolicyId() { + return this.lastUsedPolicyId; + } + + /** + * Get the lastUsedPolicyFriendlyName property: The policy friendly name used by the forward replication. + * + * @return the lastUsedPolicyFriendlyName value. + */ + public String lastUsedPolicyFriendlyName() { + return this.lastUsedPolicyFriendlyName; + } + + /** + * Get the isAgentRegistrationSuccessfulAfterFailover property: A value indicating whether agent registration was + * successful after failover. + * + * @return the isAgentRegistrationSuccessfulAfterFailover value. + */ + public Boolean isAgentRegistrationSuccessfulAfterFailover() { + return this.isAgentRegistrationSuccessfulAfterFailover; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protectedDisks() != null) { + protectedDisks().forEach(e -> e.validate()); + } + if (mobilityAgentDetails() != null) { + mobilityAgentDetails().validate(); + } + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (discoveredVmDetails() != null) { + discoveredVmDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackReprotectInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackReprotectInput.java new file mode 100644 index 000000000000..6d3f670ea17b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackReprotectInput.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageRcmFailback specific provider input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcmFailback") +@Fluent +public final class InMageRcmFailbackReprotectInput extends ReverseReplicationProviderSpecificInput { + /* + * The process server Id. + */ + @JsonProperty(value = "processServerId", required = true) + private String processServerId; + + /* + * The run as account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /* + * The Policy Id. + */ + @JsonProperty(value = "policyId", required = true) + private String policyId; + + /** Creates an instance of InMageRcmFailbackReprotectInput class. */ + public InMageRcmFailbackReprotectInput() { + } + + /** + * Get the processServerId property: The process server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The process server Id. + * + * @param processServerId the processServerId value to set. + * @return the InMageRcmFailbackReprotectInput object itself. + */ + public InMageRcmFailbackReprotectInput withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the runAsAccountId property: The run as account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The run as account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the InMageRcmFailbackReprotectInput object itself. + */ + public InMageRcmFailbackReprotectInput withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Get the policyId property: The Policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: The Policy Id. + * + * @param policyId the policyId value to set. + * @return the InMageRcmFailbackReprotectInput object itself. + */ + public InMageRcmFailbackReprotectInput withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (processServerId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property processServerId in model InMageRcmFailbackReprotectInput")); + } + if (policyId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property policyId in model InMageRcmFailbackReprotectInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmFailbackReprotectInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackSyncDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackSyncDetails.java new file mode 100644 index 000000000000..436f4bd2ec65 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFailbackSyncDetails.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcmFailback disk level sync details. */ +@Immutable +public final class InMageRcmFailbackSyncDetails { + /* + * The progress health. + */ + @JsonProperty(value = "progressHealth", access = JsonProperty.Access.WRITE_ONLY) + private DiskReplicationProgressHealth progressHealth; + + /* + * The transferred bytes from source VM to azure for the disk. + */ + @JsonProperty(value = "transferredBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long transferredBytes; + + /* + * The bytes transferred in last 15 minutes from source VM to target. + */ + @JsonProperty(value = "last15MinutesTransferredBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long last15MinutesTransferredBytes; + + /* + * The time of the last data transfer from source VM to target. + */ + @JsonProperty(value = "lastDataTransferTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private String lastDataTransferTimeUtc; + + /* + * The total processed bytes. This includes bytes that are transferred from source VM to target and matched bytes. + */ + @JsonProperty(value = "processedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long processedBytes; + + /* + * The start time. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /* + * The last refresh time. + */ + @JsonProperty(value = "lastRefreshTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastRefreshTime; + + /* + * Progress in percentage. Progress percentage is calculated based on processed bytes. + */ + @JsonProperty(value = "progressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer progressPercentage; + + /** Creates an instance of InMageRcmFailbackSyncDetails class. */ + public InMageRcmFailbackSyncDetails() { + } + + /** + * Get the progressHealth property: The progress health. + * + * @return the progressHealth value. + */ + public DiskReplicationProgressHealth progressHealth() { + return this.progressHealth; + } + + /** + * Get the transferredBytes property: The transferred bytes from source VM to azure for the disk. + * + * @return the transferredBytes value. + */ + public Long transferredBytes() { + return this.transferredBytes; + } + + /** + * Get the last15MinutesTransferredBytes property: The bytes transferred in last 15 minutes from source VM to + * target. + * + * @return the last15MinutesTransferredBytes value. + */ + public Long last15MinutesTransferredBytes() { + return this.last15MinutesTransferredBytes; + } + + /** + * Get the lastDataTransferTimeUtc property: The time of the last data transfer from source VM to target. + * + * @return the lastDataTransferTimeUtc value. + */ + public String lastDataTransferTimeUtc() { + return this.lastDataTransferTimeUtc; + } + + /** + * Get the processedBytes property: The total processed bytes. This includes bytes that are transferred from source + * VM to target and matched bytes. + * + * @return the processedBytes value. + */ + public Long processedBytes() { + return this.processedBytes; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the lastRefreshTime property: The last refresh time. + * + * @return the lastRefreshTime value. + */ + public String lastRefreshTime() { + return this.lastRefreshTime; + } + + /** + * Get the progressPercentage property: Progress in percentage. Progress percentage is calculated based on processed + * bytes. + * + * @return the progressPercentage value. + */ + public Integer progressPercentage() { + return this.progressPercentage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmLastAgentUpgradeErrorDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmLastAgentUpgradeErrorDetails.java new file mode 100644 index 000000000000..9f7c2909ae31 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmLastAgentUpgradeErrorDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** InMageRcm last source agent upgrade error details. */ +@Immutable +public final class InMageRcmLastAgentUpgradeErrorDetails { + /* + * The error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /* + * The error message. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * The possible causes. + */ + @JsonProperty(value = "possibleCauses", access = JsonProperty.Access.WRITE_ONLY) + private String possibleCauses; + + /* + * The recommended action. + */ + @JsonProperty(value = "recommendedAction", access = JsonProperty.Access.WRITE_ONLY) + private String recommendedAction; + + /* + * The error message parameters. + */ + @JsonProperty(value = "errorMessageParameters", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorMessageParameters; + + /* + * The error tags. + */ + @JsonProperty(value = "errorTags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errorTags; + + /** Creates an instance of InMageRcmLastAgentUpgradeErrorDetails class. */ + public InMageRcmLastAgentUpgradeErrorDetails() { + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the possibleCauses property: The possible causes. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Get the recommendedAction property: The recommended action. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Get the errorMessageParameters property: The error message parameters. + * + * @return the errorMessageParameters value. + */ + public Map errorMessageParameters() { + return this.errorMessageParameters; + } + + /** + * Get the errorTags property: The error tags. + * + * @return the errorTags value. + */ + public Map errorTags() { + return this.errorTags; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmMobilityAgentDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmMobilityAgentDetails.java new file mode 100644 index 000000000000..6edb853ae19d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmMobilityAgentDetails.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** InMageRcm mobility agent details. */ +@Immutable +public final class InMageRcmMobilityAgentDetails { + /* + * The agent version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The latest agent version available. + */ + @JsonProperty(value = "latestVersion", access = JsonProperty.Access.WRITE_ONLY) + private String latestVersion; + + /* + * The latest agent version release date. + */ + @JsonProperty(value = "latestAgentReleaseDate", access = JsonProperty.Access.WRITE_ONLY) + private String latestAgentReleaseDate; + + /* + * The driver version. + */ + @JsonProperty(value = "driverVersion", access = JsonProperty.Access.WRITE_ONLY) + private String driverVersion; + + /* + * The latest upgradeable version available without reboot. + */ + @JsonProperty(value = "latestUpgradableVersionWithoutReboot", access = JsonProperty.Access.WRITE_ONLY) + private String latestUpgradableVersionWithoutReboot; + + /* + * The agent version expiry date. + */ + @JsonProperty(value = "agentVersionExpiryDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime agentVersionExpiryDate; + + /* + * The driver version expiry date. + */ + @JsonProperty(value = "driverVersionExpiryDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime driverVersionExpiryDate; + + /* + * The time of the last heartbeat received from the agent. + */ + @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeatUtc; + + /* + * The whether update is possible or not. + */ + @JsonProperty(value = "reasonsBlockingUpgrade", access = JsonProperty.Access.WRITE_ONLY) + private List reasonsBlockingUpgrade; + + /* + * A value indicating whether agent is upgradeable or not. + */ + @JsonProperty(value = "isUpgradeable", access = JsonProperty.Access.WRITE_ONLY) + private String isUpgradeable; + + /** Creates an instance of InMageRcmMobilityAgentDetails class. */ + public InMageRcmMobilityAgentDetails() { + } + + /** + * Get the version property: The agent version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the latestVersion property: The latest agent version available. + * + * @return the latestVersion value. + */ + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the latestAgentReleaseDate property: The latest agent version release date. + * + * @return the latestAgentReleaseDate value. + */ + public String latestAgentReleaseDate() { + return this.latestAgentReleaseDate; + } + + /** + * Get the driverVersion property: The driver version. + * + * @return the driverVersion value. + */ + public String driverVersion() { + return this.driverVersion; + } + + /** + * Get the latestUpgradableVersionWithoutReboot property: The latest upgradeable version available without reboot. + * + * @return the latestUpgradableVersionWithoutReboot value. + */ + public String latestUpgradableVersionWithoutReboot() { + return this.latestUpgradableVersionWithoutReboot; + } + + /** + * Get the agentVersionExpiryDate property: The agent version expiry date. + * + * @return the agentVersionExpiryDate value. + */ + public OffsetDateTime agentVersionExpiryDate() { + return this.agentVersionExpiryDate; + } + + /** + * Get the driverVersionExpiryDate property: The driver version expiry date. + * + * @return the driverVersionExpiryDate value. + */ + public OffsetDateTime driverVersionExpiryDate() { + return this.driverVersionExpiryDate; + } + + /** + * Get the lastHeartbeatUtc property: The time of the last heartbeat received from the agent. + * + * @return the lastHeartbeatUtc value. + */ + public OffsetDateTime lastHeartbeatUtc() { + return this.lastHeartbeatUtc; + } + + /** + * Get the reasonsBlockingUpgrade property: The whether update is possible or not. + * + * @return the reasonsBlockingUpgrade value. + */ + public List reasonsBlockingUpgrade() { + return this.reasonsBlockingUpgrade; + } + + /** + * Get the isUpgradeable property: A value indicating whether agent is upgradeable or not. + * + * @return the isUpgradeable value. + */ + public String isUpgradeable() { + return this.isUpgradeable; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicDetails.java new file mode 100644 index 000000000000..8a32069ecab8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicDetails.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm NIC details. */ +@Fluent +public final class InMageRcmNicDetails { + /* + * The NIC Id. + */ + @JsonProperty(value = "nicId", access = JsonProperty.Access.WRITE_ONLY) + private String nicId; + + /* + * A value indicating whether this is the primary NIC. + */ + @JsonProperty(value = "isPrimaryNic") + private String isPrimaryNic; + + /* + * A value indicating whether this NIC is selected for failover. + */ + @JsonProperty(value = "isSelectedForFailover") + private String isSelectedForFailover; + + /* + * The source IP address. + */ + @JsonProperty(value = "sourceIPAddress", access = JsonProperty.Access.WRITE_ONLY) + private String sourceIpAddress; + + /* + * The source IP address type. + */ + @JsonProperty(value = "sourceIPAddressType", access = JsonProperty.Access.WRITE_ONLY) + private EthernetAddressType sourceIpAddressType; + + /* + * Source network Id. + */ + @JsonProperty(value = "sourceNetworkId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceNetworkId; + + /* + * Source subnet name. + */ + @JsonProperty(value = "sourceSubnetName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceSubnetName; + + /* + * The target IP address. + */ + @JsonProperty(value = "targetIPAddress") + private String targetIpAddress; + + /* + * The target IP address type. + */ + @JsonProperty(value = "targetIPAddressType") + private EthernetAddressType targetIpAddressType; + + /* + * Target subnet name. + */ + @JsonProperty(value = "targetSubnetName") + private String targetSubnetName; + + /* + * Test subnet name. + */ + @JsonProperty(value = "testSubnetName") + private String testSubnetName; + + /* + * The test IP address. + */ + @JsonProperty(value = "testIPAddress") + private String testIpAddress; + + /* + * The test IP address type. + */ + @JsonProperty(value = "testIPAddressType") + private EthernetAddressType testIpAddressType; + + /** Creates an instance of InMageRcmNicDetails class. */ + public InMageRcmNicDetails() { + } + + /** + * Get the nicId property: The NIC Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Get the isPrimaryNic property: A value indicating whether this is the primary NIC. + * + * @return the isPrimaryNic value. + */ + public String isPrimaryNic() { + return this.isPrimaryNic; + } + + /** + * Set the isPrimaryNic property: A value indicating whether this is the primary NIC. + * + * @param isPrimaryNic the isPrimaryNic value to set. + * @return the InMageRcmNicDetails object itself. + */ + public InMageRcmNicDetails withIsPrimaryNic(String isPrimaryNic) { + this.isPrimaryNic = isPrimaryNic; + return this; + } + + /** + * Get the isSelectedForFailover property: A value indicating whether this NIC is selected for failover. + * + * @return the isSelectedForFailover value. + */ + public String isSelectedForFailover() { + return this.isSelectedForFailover; + } + + /** + * Set the isSelectedForFailover property: A value indicating whether this NIC is selected for failover. + * + * @param isSelectedForFailover the isSelectedForFailover value to set. + * @return the InMageRcmNicDetails object itself. + */ + public InMageRcmNicDetails withIsSelectedForFailover(String isSelectedForFailover) { + this.isSelectedForFailover = isSelectedForFailover; + return this; + } + + /** + * Get the sourceIpAddress property: The source IP address. + * + * @return the sourceIpAddress value. + */ + public String sourceIpAddress() { + return this.sourceIpAddress; + } + + /** + * Get the sourceIpAddressType property: The source IP address type. + * + * @return the sourceIpAddressType value. + */ + public EthernetAddressType sourceIpAddressType() { + return this.sourceIpAddressType; + } + + /** + * Get the sourceNetworkId property: Source network Id. + * + * @return the sourceNetworkId value. + */ + public String sourceNetworkId() { + return this.sourceNetworkId; + } + + /** + * Get the sourceSubnetName property: Source subnet name. + * + * @return the sourceSubnetName value. + */ + public String sourceSubnetName() { + return this.sourceSubnetName; + } + + /** + * Get the targetIpAddress property: The target IP address. + * + * @return the targetIpAddress value. + */ + public String targetIpAddress() { + return this.targetIpAddress; + } + + /** + * Set the targetIpAddress property: The target IP address. + * + * @param targetIpAddress the targetIpAddress value to set. + * @return the InMageRcmNicDetails object itself. + */ + public InMageRcmNicDetails withTargetIpAddress(String targetIpAddress) { + this.targetIpAddress = targetIpAddress; + return this; + } + + /** + * Get the targetIpAddressType property: The target IP address type. + * + * @return the targetIpAddressType value. + */ + public EthernetAddressType targetIpAddressType() { + return this.targetIpAddressType; + } + + /** + * Set the targetIpAddressType property: The target IP address type. + * + * @param targetIpAddressType the targetIpAddressType value to set. + * @return the InMageRcmNicDetails object itself. + */ + public InMageRcmNicDetails withTargetIpAddressType(EthernetAddressType targetIpAddressType) { + this.targetIpAddressType = targetIpAddressType; + return this; + } + + /** + * Get the targetSubnetName property: Target subnet name. + * + * @return the targetSubnetName value. + */ + public String targetSubnetName() { + return this.targetSubnetName; + } + + /** + * Set the targetSubnetName property: Target subnet name. + * + * @param targetSubnetName the targetSubnetName value to set. + * @return the InMageRcmNicDetails object itself. + */ + public InMageRcmNicDetails withTargetSubnetName(String targetSubnetName) { + this.targetSubnetName = targetSubnetName; + return this; + } + + /** + * Get the testSubnetName property: Test subnet name. + * + * @return the testSubnetName value. + */ + public String testSubnetName() { + return this.testSubnetName; + } + + /** + * Set the testSubnetName property: Test subnet name. + * + * @param testSubnetName the testSubnetName value to set. + * @return the InMageRcmNicDetails object itself. + */ + public InMageRcmNicDetails withTestSubnetName(String testSubnetName) { + this.testSubnetName = testSubnetName; + return this; + } + + /** + * Get the testIpAddress property: The test IP address. + * + * @return the testIpAddress value. + */ + public String testIpAddress() { + return this.testIpAddress; + } + + /** + * Set the testIpAddress property: The test IP address. + * + * @param testIpAddress the testIpAddress value to set. + * @return the InMageRcmNicDetails object itself. + */ + public InMageRcmNicDetails withTestIpAddress(String testIpAddress) { + this.testIpAddress = testIpAddress; + return this; + } + + /** + * Get the testIpAddressType property: The test IP address type. + * + * @return the testIpAddressType value. + */ + public EthernetAddressType testIpAddressType() { + return this.testIpAddressType; + } + + /** + * Set the testIpAddressType property: The test IP address type. + * + * @param testIpAddressType the testIpAddressType value to set. + * @return the InMageRcmNicDetails object itself. + */ + public InMageRcmNicDetails withTestIpAddressType(EthernetAddressType testIpAddressType) { + this.testIpAddressType = testIpAddressType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicInput.java new file mode 100644 index 000000000000..d3e29f0a27ee --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicInput.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm NIC input. */ +@Fluent +public final class InMageRcmNicInput { + /* + * The NIC Id. + */ + @JsonProperty(value = "nicId", required = true) + private String nicId; + + /* + * A value indicating whether this is the primary NIC. + */ + @JsonProperty(value = "isPrimaryNic", required = true) + private String isPrimaryNic; + + /* + * A value indicating whether this NIC is selected for failover. + */ + @JsonProperty(value = "isSelectedForFailover") + private String isSelectedForFailover; + + /* + * Target subnet name. + */ + @JsonProperty(value = "targetSubnetName") + private String targetSubnetName; + + /* + * The target static IP address. + */ + @JsonProperty(value = "targetStaticIPAddress") + private String targetStaticIpAddress; + + /* + * The test subnet name. + */ + @JsonProperty(value = "testSubnetName") + private String testSubnetName; + + /* + * The test static IP address. + */ + @JsonProperty(value = "testStaticIPAddress") + private String testStaticIpAddress; + + /** Creates an instance of InMageRcmNicInput class. */ + public InMageRcmNicInput() { + } + + /** + * Get the nicId property: The NIC Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Set the nicId property: The NIC Id. + * + * @param nicId the nicId value to set. + * @return the InMageRcmNicInput object itself. + */ + public InMageRcmNicInput withNicId(String nicId) { + this.nicId = nicId; + return this; + } + + /** + * Get the isPrimaryNic property: A value indicating whether this is the primary NIC. + * + * @return the isPrimaryNic value. + */ + public String isPrimaryNic() { + return this.isPrimaryNic; + } + + /** + * Set the isPrimaryNic property: A value indicating whether this is the primary NIC. + * + * @param isPrimaryNic the isPrimaryNic value to set. + * @return the InMageRcmNicInput object itself. + */ + public InMageRcmNicInput withIsPrimaryNic(String isPrimaryNic) { + this.isPrimaryNic = isPrimaryNic; + return this; + } + + /** + * Get the isSelectedForFailover property: A value indicating whether this NIC is selected for failover. + * + * @return the isSelectedForFailover value. + */ + public String isSelectedForFailover() { + return this.isSelectedForFailover; + } + + /** + * Set the isSelectedForFailover property: A value indicating whether this NIC is selected for failover. + * + * @param isSelectedForFailover the isSelectedForFailover value to set. + * @return the InMageRcmNicInput object itself. + */ + public InMageRcmNicInput withIsSelectedForFailover(String isSelectedForFailover) { + this.isSelectedForFailover = isSelectedForFailover; + return this; + } + + /** + * Get the targetSubnetName property: Target subnet name. + * + * @return the targetSubnetName value. + */ + public String targetSubnetName() { + return this.targetSubnetName; + } + + /** + * Set the targetSubnetName property: Target subnet name. + * + * @param targetSubnetName the targetSubnetName value to set. + * @return the InMageRcmNicInput object itself. + */ + public InMageRcmNicInput withTargetSubnetName(String targetSubnetName) { + this.targetSubnetName = targetSubnetName; + return this; + } + + /** + * Get the targetStaticIpAddress property: The target static IP address. + * + * @return the targetStaticIpAddress value. + */ + public String targetStaticIpAddress() { + return this.targetStaticIpAddress; + } + + /** + * Set the targetStaticIpAddress property: The target static IP address. + * + * @param targetStaticIpAddress the targetStaticIpAddress value to set. + * @return the InMageRcmNicInput object itself. + */ + public InMageRcmNicInput withTargetStaticIpAddress(String targetStaticIpAddress) { + this.targetStaticIpAddress = targetStaticIpAddress; + return this; + } + + /** + * Get the testSubnetName property: The test subnet name. + * + * @return the testSubnetName value. + */ + public String testSubnetName() { + return this.testSubnetName; + } + + /** + * Set the testSubnetName property: The test subnet name. + * + * @param testSubnetName the testSubnetName value to set. + * @return the InMageRcmNicInput object itself. + */ + public InMageRcmNicInput withTestSubnetName(String testSubnetName) { + this.testSubnetName = testSubnetName; + return this; + } + + /** + * Get the testStaticIpAddress property: The test static IP address. + * + * @return the testStaticIpAddress value. + */ + public String testStaticIpAddress() { + return this.testStaticIpAddress; + } + + /** + * Set the testStaticIpAddress property: The test static IP address. + * + * @param testStaticIpAddress the testStaticIpAddress value to set. + * @return the InMageRcmNicInput object itself. + */ + public InMageRcmNicInput withTestStaticIpAddress(String testStaticIpAddress) { + this.testStaticIpAddress = testStaticIpAddress; + 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 InMageRcmNicInput")); + } + if (isPrimaryNic() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property isPrimaryNic in model InMageRcmNicInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmNicInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyCreationInput.java new file mode 100644 index 000000000000..6fc2215231fc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyCreationInput.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageRcm policy creation input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmPolicyCreationInput extends PolicyProviderSpecificInput { + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistoryInMinutes") + private Integer recoveryPointHistoryInMinutes; + + /* + * The crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /* + * The app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. + */ + @JsonProperty(value = "enableMultiVmSync") + private String enableMultiVmSync; + + /** Creates an instance of InMageRcmPolicyCreationInput class. */ + public InMageRcmPolicyCreationInput() { + } + + /** + * Get the recoveryPointHistoryInMinutes property: The duration in minutes until which the recovery points need to + * be stored. + * + * @return the recoveryPointHistoryInMinutes value. + */ + public Integer recoveryPointHistoryInMinutes() { + return this.recoveryPointHistoryInMinutes; + } + + /** + * Set the recoveryPointHistoryInMinutes property: The duration in minutes until which the recovery points need to + * be stored. + * + * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. + * @return the InMageRcmPolicyCreationInput object itself. + */ + public InMageRcmPolicyCreationInput withRecoveryPointHistoryInMinutes(Integer recoveryPointHistoryInMinutes) { + this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the InMageRcmPolicyCreationInput object itself. + */ + public InMageRcmPolicyCreationInput withCrashConsistentFrequencyInMinutes( + Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the InMageRcmPolicyCreationInput object itself. + */ + public InMageRcmPolicyCreationInput withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the enableMultiVmSync property: A value indicating whether multi-VM sync has to be enabled. + * + * @return the enableMultiVmSync value. + */ + public String enableMultiVmSync() { + return this.enableMultiVmSync; + } + + /** + * Set the enableMultiVmSync property: A value indicating whether multi-VM sync has to be enabled. + * + * @param enableMultiVmSync the enableMultiVmSync value to set. + * @return the InMageRcmPolicyCreationInput object itself. + */ + public InMageRcmPolicyCreationInput withEnableMultiVmSync(String enableMultiVmSync) { + this.enableMultiVmSync = enableMultiVmSync; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyDetails.java new file mode 100644 index 000000000000..63650624f94e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyDetails.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.recoveryservicessiterecovery.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; + +/** InMageRcm specific policy details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmPolicyDetails extends PolicyProviderSpecificDetails { + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistoryInMinutes") + private Integer recoveryPointHistoryInMinutes; + + /* + * The app consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * The crash consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. + */ + @JsonProperty(value = "enableMultiVmSync") + private String enableMultiVmSync; + + /** Creates an instance of InMageRcmPolicyDetails class. */ + public InMageRcmPolicyDetails() { + } + + /** + * Get the recoveryPointHistoryInMinutes property: The duration in minutes until which the recovery points need to + * be stored. + * + * @return the recoveryPointHistoryInMinutes value. + */ + public Integer recoveryPointHistoryInMinutes() { + return this.recoveryPointHistoryInMinutes; + } + + /** + * Set the recoveryPointHistoryInMinutes property: The duration in minutes until which the recovery points need to + * be stored. + * + * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. + * @return the InMageRcmPolicyDetails object itself. + */ + public InMageRcmPolicyDetails withRecoveryPointHistoryInMinutes(Integer recoveryPointHistoryInMinutes) { + this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the InMageRcmPolicyDetails object itself. + */ + public InMageRcmPolicyDetails withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the InMageRcmPolicyDetails object itself. + */ + public InMageRcmPolicyDetails withCrashConsistentFrequencyInMinutes(Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the enableMultiVmSync property: A value indicating whether multi-VM sync has to be enabled. + * + * @return the enableMultiVmSync value. + */ + public String enableMultiVmSync() { + return this.enableMultiVmSync; + } + + /** + * Set the enableMultiVmSync property: A value indicating whether multi-VM sync has to be enabled. + * + * @param enableMultiVmSync the enableMultiVmSync value to set. + * @return the InMageRcmPolicyDetails object itself. + */ + public InMageRcmPolicyDetails withEnableMultiVmSync(String enableMultiVmSync) { + this.enableMultiVmSync = enableMultiVmSync; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmProtectedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmProtectedDiskDetails.java new file mode 100644 index 000000000000..f66d078d8f48 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmProtectedDiskDetails.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm protected disk details. */ +@Fluent +public final class InMageRcmProtectedDiskDetails { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId", access = JsonProperty.Access.WRITE_ONLY) + private String diskId; + + /* + * The disk name. + */ + @JsonProperty(value = "diskName", access = JsonProperty.Access.WRITE_ONLY) + private String diskName; + + /* + * A value indicating whether the disk is the OS disk. + */ + @JsonProperty(value = "isOSDisk", access = JsonProperty.Access.WRITE_ONLY) + private String isOSDisk; + + /* + * The disk capacity in bytes. + */ + @JsonProperty(value = "capacityInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityInBytes; + + /* + * The log storage account ARM Id. + */ + @JsonProperty(value = "logStorageAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String logStorageAccountId; + + /* + * The DiskEncryptionSet ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId", access = JsonProperty.Access.WRITE_ONLY) + private String diskEncryptionSetId; + + /* + * The ARM Id of the seed managed disk. + */ + @JsonProperty(value = "seedManagedDiskId", access = JsonProperty.Access.WRITE_ONLY) + private String seedManagedDiskId; + + /* + * The uri of the seed blob. + */ + @JsonProperty(value = "seedBlobUri", access = JsonProperty.Access.WRITE_ONLY) + private String seedBlobUri; + + /* + * The ARM Id of the target managed disk. + */ + @JsonProperty(value = "targetManagedDiskId", access = JsonProperty.Access.WRITE_ONLY) + private String targetManagedDiskId; + + /* + * The disk type. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /* + * The data pending in log data store in MB. + */ + @JsonProperty(value = "dataPendingInLogDataStoreInMB", access = JsonProperty.Access.WRITE_ONLY) + private Double dataPendingInLogDataStoreInMB; + + /* + * The data pending at source agent in MB. + */ + @JsonProperty(value = "dataPendingAtSourceAgentInMB", access = JsonProperty.Access.WRITE_ONLY) + private Double dataPendingAtSourceAgentInMB; + + /* + * A value indicating whether initial replication is complete or not. + */ + @JsonProperty(value = "isInitialReplicationComplete", access = JsonProperty.Access.WRITE_ONLY) + private String isInitialReplicationComplete; + + /* + * The initial replication details. + */ + @JsonProperty(value = "irDetails") + private InMageRcmSyncDetails irDetails; + + /* + * The resync details. + */ + @JsonProperty(value = "resyncDetails") + private InMageRcmSyncDetails resyncDetails; + + /** Creates an instance of InMageRcmProtectedDiskDetails class. */ + public InMageRcmProtectedDiskDetails() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Get the diskName property: The disk name. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Get the isOSDisk property: A value indicating whether the disk is the OS disk. + * + * @return the isOSDisk value. + */ + public String isOSDisk() { + return this.isOSDisk; + } + + /** + * Get the capacityInBytes property: The disk capacity in bytes. + * + * @return the capacityInBytes value. + */ + public Long capacityInBytes() { + return this.capacityInBytes; + } + + /** + * Get the logStorageAccountId property: The log storage account ARM Id. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Get the seedManagedDiskId property: The ARM Id of the seed managed disk. + * + * @return the seedManagedDiskId value. + */ + public String seedManagedDiskId() { + return this.seedManagedDiskId; + } + + /** + * Get the seedBlobUri property: The uri of the seed blob. + * + * @return the seedBlobUri value. + */ + public String seedBlobUri() { + return this.seedBlobUri; + } + + /** + * Get the targetManagedDiskId property: The ARM Id of the target managed disk. + * + * @return the targetManagedDiskId value. + */ + public String targetManagedDiskId() { + return this.targetManagedDiskId; + } + + /** + * Get the diskType property: The disk type. + * + * @return the diskType value. + */ + public DiskAccountType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The disk type. + * + * @param diskType the diskType value to set. + * @return the InMageRcmProtectedDiskDetails object itself. + */ + public InMageRcmProtectedDiskDetails withDiskType(DiskAccountType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the dataPendingInLogDataStoreInMB property: The data pending in log data store in MB. + * + * @return the dataPendingInLogDataStoreInMB value. + */ + public Double dataPendingInLogDataStoreInMB() { + return this.dataPendingInLogDataStoreInMB; + } + + /** + * Get the dataPendingAtSourceAgentInMB property: The data pending at source agent in MB. + * + * @return the dataPendingAtSourceAgentInMB value. + */ + public Double dataPendingAtSourceAgentInMB() { + return this.dataPendingAtSourceAgentInMB; + } + + /** + * Get the isInitialReplicationComplete property: A value indicating whether initial replication is complete or not. + * + * @return the isInitialReplicationComplete value. + */ + public String isInitialReplicationComplete() { + return this.isInitialReplicationComplete; + } + + /** + * Get the irDetails property: The initial replication details. + * + * @return the irDetails value. + */ + public InMageRcmSyncDetails irDetails() { + return this.irDetails; + } + + /** + * Set the irDetails property: The initial replication details. + * + * @param irDetails the irDetails value to set. + * @return the InMageRcmProtectedDiskDetails object itself. + */ + public InMageRcmProtectedDiskDetails withIrDetails(InMageRcmSyncDetails irDetails) { + this.irDetails = irDetails; + return this; + } + + /** + * Get the resyncDetails property: The resync details. + * + * @return the resyncDetails value. + */ + public InMageRcmSyncDetails resyncDetails() { + return this.resyncDetails; + } + + /** + * Set the resyncDetails property: The resync details. + * + * @param resyncDetails the resyncDetails value to set. + * @return the InMageRcmProtectedDiskDetails object itself. + */ + public InMageRcmProtectedDiskDetails withResyncDetails(InMageRcmSyncDetails resyncDetails) { + this.resyncDetails = resyncDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (irDetails() != null) { + irDetails().validate(); + } + if (resyncDetails() != null) { + resyncDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmProtectionContainerMappingDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmProtectionContainerMappingDetails.java new file mode 100644 index 000000000000..e0cbfd1c2bed --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmProtectionContainerMappingDetails.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.recoveryservicessiterecovery.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; + +/** InMageRcm provider specific container mapping details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Immutable +public final class InMageRcmProtectionContainerMappingDetails + extends ProtectionContainerMappingProviderSpecificDetails { + /* + * A value indicating whether the flag for enable agent auto upgrade. + */ + @JsonProperty(value = "enableAgentAutoUpgrade", access = JsonProperty.Access.WRITE_ONLY) + private String enableAgentAutoUpgrade; + + /** Creates an instance of InMageRcmProtectionContainerMappingDetails class. */ + public InMageRcmProtectionContainerMappingDetails() { + } + + /** + * Get the enableAgentAutoUpgrade property: A value indicating whether the flag for enable agent auto upgrade. + * + * @return the enableAgentAutoUpgrade value. + */ + public String enableAgentAutoUpgrade() { + return this.enableAgentAutoUpgrade; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmRecoveryPointDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmRecoveryPointDetails.java new file mode 100644 index 000000000000..ba79d717e06e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmRecoveryPointDetails.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.recoveryservicessiterecovery.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; + +/** InMageRcm provider specific recovery point details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Immutable +public final class InMageRcmRecoveryPointDetails extends ProviderSpecificRecoveryPointDetails { + /* + * A value indicating whether the recovery point is multi VM consistent. + */ + @JsonProperty(value = "isMultiVmSyncPoint", access = JsonProperty.Access.WRITE_ONLY) + private String isMultiVmSyncPoint; + + /** Creates an instance of InMageRcmRecoveryPointDetails class. */ + public InMageRcmRecoveryPointDetails() { + } + + /** + * Get the isMultiVmSyncPoint property: A value indicating whether the recovery point is multi VM consistent. + * + * @return the isMultiVmSyncPoint value. + */ + public String isMultiVmSyncPoint() { + return this.isMultiVmSyncPoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmReplicationDetails.java new file mode 100644 index 000000000000..11cd2494dcfc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmReplicationDetails.java @@ -0,0 +1,1033 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.time.OffsetDateTime; +import java.util.List; + +/** InMageRcm provider specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * The virtual machine internal identifier. + */ + @JsonProperty(value = "internalIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String internalIdentifier; + + /* + * The ARM Id of the discovered VM. + */ + @JsonProperty(value = "fabricDiscoveryMachineId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricDiscoveryMachineId; + + /* + * The multi VM group name. + */ + @JsonProperty(value = "multiVmGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String multiVmGroupName; + + /* + * The type of the discovered VM. + */ + @JsonProperty(value = "discoveryType", access = JsonProperty.Access.WRITE_ONLY) + private String discoveryType; + + /* + * The process server Id. + */ + @JsonProperty(value = "processServerId", access = JsonProperty.Access.WRITE_ONLY) + private String processServerId; + + /* + * The processor core count. + */ + @JsonProperty(value = "processorCoreCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer processorCoreCount; + + /* + * The allocated memory in MB. + */ + @JsonProperty(value = "allocatedMemoryInMB", access = JsonProperty.Access.WRITE_ONLY) + private Double allocatedMemoryInMB; + + /* + * The process server name. + */ + @JsonProperty(value = "processServerName", access = JsonProperty.Access.WRITE_ONLY) + private String processServerName; + + /* + * The run-as account Id. + */ + @JsonProperty(value = "runAsAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String runAsAccountId; + + /* + * The type of the OS on the VM. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /* + * The firmware type. + */ + @JsonProperty(value = "firmwareType", access = JsonProperty.Access.WRITE_ONLY) + private String firmwareType; + + /* + * The IP address of the primary network interface. + */ + @JsonProperty(value = "primaryNicIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String primaryNicIpAddress; + + /* + * The target generation. + */ + @JsonProperty(value = "targetGeneration", access = JsonProperty.Access.WRITE_ONLY) + private String targetGeneration; + + /* + * License Type of the VM to be used. + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * The replication storage account ARM Id. This is applicable only for the blob based replication test hook. + */ + @JsonProperty(value = "storageAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountId; + + /* + * Target VM name. + */ + @JsonProperty(value = "targetVmName") + private String targetVmName; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /* + * The target resource group Id. + */ + @JsonProperty(value = "targetResourceGroupId") + private String targetResourceGroupId; + + /* + * The target location. + */ + @JsonProperty(value = "targetLocation") + private String targetLocation; + + /* + * The target availability set Id. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The target boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId") + private String targetBootDiagnosticsStorageAccountId; + + /* + * The target network Id. + */ + @JsonProperty(value = "targetNetworkId") + private String targetNetworkId; + + /* + * The test network Id. + */ + @JsonProperty(value = "testNetworkId") + private String testNetworkId; + + /* + * The recovery point Id to which the VM was failed over. + */ + @JsonProperty(value = "failoverRecoveryPointId", access = JsonProperty.Access.WRITE_ONLY) + private String failoverRecoveryPointId; + + /* + * The last recovery point received time. + */ + @JsonProperty(value = "lastRecoveryPointReceived", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastRecoveryPointReceived; + + /* + * The last recovery point objective value. + */ + @JsonProperty(value = "lastRpoInSeconds", access = JsonProperty.Access.WRITE_ONLY) + private Long lastRpoInSeconds; + + /* + * The last recovery point objective calculated time. + */ + @JsonProperty(value = "lastRpoCalculatedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastRpoCalculatedTime; + + /* + * The last recovery point Id. + */ + @JsonProperty(value = "lastRecoveryPointId", access = JsonProperty.Access.WRITE_ONLY) + private String lastRecoveryPointId; + + /* + * 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; + + /* + * The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all + * selected disks in source VM. + */ + @JsonProperty(value = "initialReplicationProcessedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long initialReplicationProcessedBytes; + + /* + * The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + */ + @JsonProperty(value = "initialReplicationTransferredBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long initialReplicationTransferredBytes; + + /* + * The initial replication progress health. + */ + @JsonProperty(value = "initialReplicationProgressHealth", access = JsonProperty.Access.WRITE_ONLY) + private VmReplicationProgressHealth initialReplicationProgressHealth; + + /* + * 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; + + /* + * The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks + * in source VM. + */ + @JsonProperty(value = "resyncProcessedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long resyncProcessedBytes; + + /* + * The resync transferred bytes from source VM to azure for all selected disks on source VM. + */ + @JsonProperty(value = "resyncTransferredBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long resyncTransferredBytes; + + /* + * The resync progress health. + */ + @JsonProperty(value = "resyncProgressHealth", access = JsonProperty.Access.WRITE_ONLY) + private VmReplicationProgressHealth resyncProgressHealth; + + /* + * A value indicating whether resync is required. + */ + @JsonProperty(value = "resyncRequired", access = JsonProperty.Access.WRITE_ONLY) + private String resyncRequired; + + /* + * The resync state. + */ + @JsonProperty(value = "resyncState", access = JsonProperty.Access.WRITE_ONLY) + private ResyncState resyncState; + + /* + * The agent auto upgrade state. + */ + @JsonProperty(value = "agentUpgradeState", access = JsonProperty.Access.WRITE_ONLY) + private MobilityAgentUpgradeState agentUpgradeState; + + /* + * The last agent upgrade type. + */ + @JsonProperty(value = "lastAgentUpgradeType", access = JsonProperty.Access.WRITE_ONLY) + private String lastAgentUpgradeType; + + /* + * The agent upgrade job Id. + */ + @JsonProperty(value = "agentUpgradeJobId", access = JsonProperty.Access.WRITE_ONLY) + private String agentUpgradeJobId; + + /* + * The agent version to which last agent upgrade was attempted. + */ + @JsonProperty(value = "agentUpgradeAttemptToVersion", access = JsonProperty.Access.WRITE_ONLY) + private String agentUpgradeAttemptToVersion; + + /* + * The list of protected disks. + */ + @JsonProperty(value = "protectedDisks") + private List protectedDisks; + + /* + * A value indicating whether last agent upgrade was successful or not. + */ + @JsonProperty(value = "isLastUpgradeSuccessful", access = JsonProperty.Access.WRITE_ONLY) + private String isLastUpgradeSuccessful; + + /* + * A value indicating whether agent registration was successful after failover. + */ + @JsonProperty(value = "isAgentRegistrationSuccessfulAfterFailover", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isAgentRegistrationSuccessfulAfterFailover; + + /* + * The mobility agent information. + */ + @JsonProperty(value = "mobilityAgentDetails") + private InMageRcmMobilityAgentDetails mobilityAgentDetails; + + /* + * The last agent upgrade error information. + */ + @JsonProperty(value = "lastAgentUpgradeErrorDetails") + private List lastAgentUpgradeErrorDetails; + + /* + * The agent upgrade blocking error information. + */ + @JsonProperty(value = "agentUpgradeBlockingErrorDetails") + private List agentUpgradeBlockingErrorDetails; + + /* + * The network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The discovered VM details. + */ + @JsonProperty(value = "discoveredVmDetails") + private InMageRcmDiscoveredProtectedVmDetails discoveredVmDetails; + + /** Creates an instance of InMageRcmReplicationDetails class. */ + public InMageRcmReplicationDetails() { + } + + /** + * Get the internalIdentifier property: The virtual machine internal identifier. + * + * @return the internalIdentifier value. + */ + public String internalIdentifier() { + return this.internalIdentifier; + } + + /** + * Get the fabricDiscoveryMachineId property: The ARM Id of the discovered VM. + * + * @return the fabricDiscoveryMachineId value. + */ + public String fabricDiscoveryMachineId() { + return this.fabricDiscoveryMachineId; + } + + /** + * Get the multiVmGroupName property: The multi VM group name. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Get the discoveryType property: The type of the discovered VM. + * + * @return the discoveryType value. + */ + public String discoveryType() { + return this.discoveryType; + } + + /** + * Get the processServerId property: The process server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Get the processorCoreCount property: The processor core count. + * + * @return the processorCoreCount value. + */ + public Integer processorCoreCount() { + return this.processorCoreCount; + } + + /** + * Get the allocatedMemoryInMB property: The allocated memory in MB. + * + * @return the allocatedMemoryInMB value. + */ + public Double allocatedMemoryInMB() { + return this.allocatedMemoryInMB; + } + + /** + * Get the processServerName property: The process server name. + * + * @return the processServerName value. + */ + public String processServerName() { + return this.processServerName; + } + + /** + * Get the runAsAccountId property: The run-as account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Get the osType property: The type of the OS on the VM. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the firmwareType property: The firmware type. + * + * @return the firmwareType value. + */ + public String firmwareType() { + return this.firmwareType; + } + + /** + * Get the primaryNicIpAddress property: The IP address of the primary network interface. + * + * @return the primaryNicIpAddress value. + */ + public String primaryNicIpAddress() { + return this.primaryNicIpAddress; + } + + /** + * Get the targetGeneration property: The target generation. + * + * @return the targetGeneration value. + */ + public String targetGeneration() { + return this.targetGeneration; + } + + /** + * Get the licenseType property: License Type of the VM to be used. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: License Type of the VM to be used. + * + * @param licenseType the licenseType value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the storageAccountId property: The replication storage account ARM Id. This is applicable only for the blob + * based replication test hook. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Get the targetVmName property: Target VM name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Set the targetVmName property: Target VM name. + * + * @param targetVmName the targetVmName value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTargetVmName(String targetVmName) { + this.targetVmName = targetVmName; + return this; + } + + /** + * Get the targetVmSize property: The target VM size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Set the targetVmSize property: The target VM size. + * + * @param targetVmSize the targetVmSize value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTargetVmSize(String targetVmSize) { + this.targetVmSize = targetVmSize; + return this; + } + + /** + * Get the targetResourceGroupId property: The target resource group Id. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: The target resource group Id. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the targetLocation property: The target location. + * + * @return the targetLocation value. + */ + public String targetLocation() { + return this.targetLocation; + } + + /** + * Set the targetLocation property: The target location. + * + * @param targetLocation the targetLocation value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTargetLocation(String targetLocation) { + this.targetLocation = targetLocation; + return this; + } + + /** + * Get the targetAvailabilitySetId property: The target availability set Id. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The target availability set Id. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTargetProximityPlacementGroupId(String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @return the targetBootDiagnosticsStorageAccountId value. + */ + public String targetBootDiagnosticsStorageAccountId() { + return this.targetBootDiagnosticsStorageAccountId; + } + + /** + * Set the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @param targetBootDiagnosticsStorageAccountId the targetBootDiagnosticsStorageAccountId value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTargetBootDiagnosticsStorageAccountId( + String targetBootDiagnosticsStorageAccountId) { + this.targetBootDiagnosticsStorageAccountId = targetBootDiagnosticsStorageAccountId; + return this; + } + + /** + * Get the targetNetworkId property: The target network Id. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: The target network Id. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: The test network Id. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: The test network Id. + * + * @param testNetworkId the testNetworkId value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the failoverRecoveryPointId property: 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: The last recovery point received time. + * + * @return the lastRecoveryPointReceived value. + */ + public OffsetDateTime lastRecoveryPointReceived() { + return this.lastRecoveryPointReceived; + } + + /** + * Get the lastRpoInSeconds property: The last recovery point objective value. + * + * @return the lastRpoInSeconds value. + */ + public Long lastRpoInSeconds() { + return this.lastRpoInSeconds; + } + + /** + * Get the lastRpoCalculatedTime property: The last recovery point objective calculated time. + * + * @return the lastRpoCalculatedTime value. + */ + public OffsetDateTime lastRpoCalculatedTime() { + return this.lastRpoCalculatedTime; + } + + /** + * Get the lastRecoveryPointId property: The last recovery point Id. + * + * @return the lastRecoveryPointId value. + */ + public String lastRecoveryPointId() { + return this.lastRecoveryPointId; + } + + /** + * Get the initialReplicationProgressPercentage property: 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 initialReplicationProcessedBytes property: The initial replication processed bytes. This includes sum of + * total bytes transferred and matched bytes on all selected disks in source VM. + * + * @return the initialReplicationProcessedBytes value. + */ + public Long initialReplicationProcessedBytes() { + return this.initialReplicationProcessedBytes; + } + + /** + * Get the initialReplicationTransferredBytes property: The initial replication transferred bytes from source VM to + * azure for all selected disks on source VM. + * + * @return the initialReplicationTransferredBytes value. + */ + public Long initialReplicationTransferredBytes() { + return this.initialReplicationTransferredBytes; + } + + /** + * Get the initialReplicationProgressHealth property: The initial replication progress health. + * + * @return the initialReplicationProgressHealth value. + */ + public VmReplicationProgressHealth initialReplicationProgressHealth() { + return this.initialReplicationProgressHealth; + } + + /** + * Get the resyncProgressPercentage property: 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 resyncProcessedBytes property: The resync processed bytes. This includes sum of total bytes transferred + * and matched bytes on all selected disks in source VM. + * + * @return the resyncProcessedBytes value. + */ + public Long resyncProcessedBytes() { + return this.resyncProcessedBytes; + } + + /** + * Get the resyncTransferredBytes property: The resync transferred bytes from source VM to azure for all selected + * disks on source VM. + * + * @return the resyncTransferredBytes value. + */ + public Long resyncTransferredBytes() { + return this.resyncTransferredBytes; + } + + /** + * Get the resyncProgressHealth property: The resync progress health. + * + * @return the resyncProgressHealth value. + */ + public VmReplicationProgressHealth resyncProgressHealth() { + return this.resyncProgressHealth; + } + + /** + * Get the resyncRequired property: A value indicating whether resync is required. + * + * @return the resyncRequired value. + */ + public String resyncRequired() { + return this.resyncRequired; + } + + /** + * Get the resyncState property: The resync state. + * + * @return the resyncState value. + */ + public ResyncState resyncState() { + return this.resyncState; + } + + /** + * Get the agentUpgradeState property: The agent auto upgrade state. + * + * @return the agentUpgradeState value. + */ + public MobilityAgentUpgradeState agentUpgradeState() { + return this.agentUpgradeState; + } + + /** + * Get the lastAgentUpgradeType property: The last agent upgrade type. + * + * @return the lastAgentUpgradeType value. + */ + public String lastAgentUpgradeType() { + return this.lastAgentUpgradeType; + } + + /** + * Get the agentUpgradeJobId property: The agent upgrade job Id. + * + * @return the agentUpgradeJobId value. + */ + public String agentUpgradeJobId() { + return this.agentUpgradeJobId; + } + + /** + * Get the agentUpgradeAttemptToVersion property: The agent version to which last agent upgrade was attempted. + * + * @return the agentUpgradeAttemptToVersion value. + */ + public String agentUpgradeAttemptToVersion() { + return this.agentUpgradeAttemptToVersion; + } + + /** + * Get the protectedDisks property: The list of protected disks. + * + * @return the protectedDisks value. + */ + public List protectedDisks() { + return this.protectedDisks; + } + + /** + * Set the protectedDisks property: The list of protected disks. + * + * @param protectedDisks the protectedDisks value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withProtectedDisks(List protectedDisks) { + this.protectedDisks = protectedDisks; + return this; + } + + /** + * Get the isLastUpgradeSuccessful property: A value indicating whether last agent upgrade was successful or not. + * + * @return the isLastUpgradeSuccessful value. + */ + public String isLastUpgradeSuccessful() { + return this.isLastUpgradeSuccessful; + } + + /** + * Get the isAgentRegistrationSuccessfulAfterFailover property: A value indicating whether agent registration was + * successful after failover. + * + * @return the isAgentRegistrationSuccessfulAfterFailover value. + */ + public Boolean isAgentRegistrationSuccessfulAfterFailover() { + return this.isAgentRegistrationSuccessfulAfterFailover; + } + + /** + * Get the mobilityAgentDetails property: The mobility agent information. + * + * @return the mobilityAgentDetails value. + */ + public InMageRcmMobilityAgentDetails mobilityAgentDetails() { + return this.mobilityAgentDetails; + } + + /** + * Set the mobilityAgentDetails property: The mobility agent information. + * + * @param mobilityAgentDetails the mobilityAgentDetails value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withMobilityAgentDetails(InMageRcmMobilityAgentDetails mobilityAgentDetails) { + this.mobilityAgentDetails = mobilityAgentDetails; + return this; + } + + /** + * Get the lastAgentUpgradeErrorDetails property: The last agent upgrade error information. + * + * @return the lastAgentUpgradeErrorDetails value. + */ + public List lastAgentUpgradeErrorDetails() { + return this.lastAgentUpgradeErrorDetails; + } + + /** + * Set the lastAgentUpgradeErrorDetails property: The last agent upgrade error information. + * + * @param lastAgentUpgradeErrorDetails the lastAgentUpgradeErrorDetails value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withLastAgentUpgradeErrorDetails( + List lastAgentUpgradeErrorDetails) { + this.lastAgentUpgradeErrorDetails = lastAgentUpgradeErrorDetails; + return this; + } + + /** + * Get the agentUpgradeBlockingErrorDetails property: The agent upgrade blocking error information. + * + * @return the agentUpgradeBlockingErrorDetails value. + */ + public List agentUpgradeBlockingErrorDetails() { + return this.agentUpgradeBlockingErrorDetails; + } + + /** + * Set the agentUpgradeBlockingErrorDetails property: The agent upgrade blocking error information. + * + * @param agentUpgradeBlockingErrorDetails the agentUpgradeBlockingErrorDetails value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withAgentUpgradeBlockingErrorDetails( + List agentUpgradeBlockingErrorDetails) { + this.agentUpgradeBlockingErrorDetails = agentUpgradeBlockingErrorDetails; + return this; + } + + /** + * Get the vmNics property: The network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The network details. + * + * @param vmNics the vmNics value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the discoveredVmDetails property: The discovered VM details. + * + * @return the discoveredVmDetails value. + */ + public InMageRcmDiscoveredProtectedVmDetails discoveredVmDetails() { + return this.discoveredVmDetails; + } + + /** + * Set the discoveredVmDetails property: The discovered VM details. + * + * @param discoveredVmDetails the discoveredVmDetails value to set. + * @return the InMageRcmReplicationDetails object itself. + */ + public InMageRcmReplicationDetails withDiscoveredVmDetails( + InMageRcmDiscoveredProtectedVmDetails discoveredVmDetails) { + this.discoveredVmDetails = discoveredVmDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protectedDisks() != null) { + protectedDisks().forEach(e -> e.validate()); + } + if (mobilityAgentDetails() != null) { + mobilityAgentDetails().validate(); + } + if (lastAgentUpgradeErrorDetails() != null) { + lastAgentUpgradeErrorDetails().forEach(e -> e.validate()); + } + if (agentUpgradeBlockingErrorDetails() != null) { + agentUpgradeBlockingErrorDetails().forEach(e -> e.validate()); + } + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (discoveredVmDetails() != null) { + discoveredVmDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmReprotectInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmReprotectInput.java new file mode 100644 index 000000000000..8ed25073ed06 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmReprotectInput.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.recoveryservicessiterecovery.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; + +/** InMageRcm specific provider input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmReprotectInput extends ReverseReplicationProviderSpecificInput { + /* + * The reprotect agent Id. + */ + @JsonProperty(value = "reprotectAgentId", required = true) + private String reprotectAgentId; + + /* + * The target datastore name. + */ + @JsonProperty(value = "datastoreName", required = true) + private String datastoreName; + + /* + * The log storage account ARM Id. + */ + @JsonProperty(value = "logStorageAccountId", required = true) + private String logStorageAccountId; + + /* + * The Policy Id. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /** Creates an instance of InMageRcmReprotectInput class. */ + public InMageRcmReprotectInput() { + } + + /** + * Get the reprotectAgentId property: The reprotect agent Id. + * + * @return the reprotectAgentId value. + */ + public String reprotectAgentId() { + return this.reprotectAgentId; + } + + /** + * Set the reprotectAgentId property: The reprotect agent Id. + * + * @param reprotectAgentId the reprotectAgentId value to set. + * @return the InMageRcmReprotectInput object itself. + */ + public InMageRcmReprotectInput withReprotectAgentId(String reprotectAgentId) { + this.reprotectAgentId = reprotectAgentId; + return this; + } + + /** + * Get the datastoreName property: The target datastore name. + * + * @return the datastoreName value. + */ + public String datastoreName() { + return this.datastoreName; + } + + /** + * Set the datastoreName property: The target datastore name. + * + * @param datastoreName the datastoreName value to set. + * @return the InMageRcmReprotectInput object itself. + */ + public InMageRcmReprotectInput withDatastoreName(String datastoreName) { + this.datastoreName = datastoreName; + return this; + } + + /** + * Get the logStorageAccountId property: The log storage account ARM Id. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The log storage account ARM Id. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the InMageRcmReprotectInput object itself. + */ + public InMageRcmReprotectInput withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Get the policyId property: The Policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: The Policy Id. + * + * @param policyId the policyId value to set. + * @return the InMageRcmReprotectInput object itself. + */ + public InMageRcmReprotectInput withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (reprotectAgentId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property reprotectAgentId in model InMageRcmReprotectInput")); + } + if (datastoreName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property datastoreName in model InMageRcmReprotectInput")); + } + if (logStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property logStorageAccountId in model InMageRcmReprotectInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmReprotectInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmSyncDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmSyncDetails.java new file mode 100644 index 000000000000..31e263f1251d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmSyncDetails.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm disk level sync details. */ +@Immutable +public final class InMageRcmSyncDetails { + /* + * The progress health. + */ + @JsonProperty(value = "progressHealth", access = JsonProperty.Access.WRITE_ONLY) + private DiskReplicationProgressHealth progressHealth; + + /* + * The transferred bytes from source VM to azure for the disk. + */ + @JsonProperty(value = "transferredBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long transferredBytes; + + /* + * The bytes transferred in last 15 minutes from source VM to azure. + */ + @JsonProperty(value = "last15MinutesTransferredBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long last15MinutesTransferredBytes; + + /* + * The time of the last data transfer from source VM to azure. + */ + @JsonProperty(value = "lastDataTransferTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private String lastDataTransferTimeUtc; + + /* + * The total processed bytes. This includes bytes that are transferred from source VM to azure and matched bytes. + */ + @JsonProperty(value = "processedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long processedBytes; + + /* + * The start time. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /* + * The last refresh time. + */ + @JsonProperty(value = "lastRefreshTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastRefreshTime; + + /* + * Progress in percentage. Progress percentage is calculated based on processed bytes. + */ + @JsonProperty(value = "progressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer progressPercentage; + + /** Creates an instance of InMageRcmSyncDetails class. */ + public InMageRcmSyncDetails() { + } + + /** + * Get the progressHealth property: The progress health. + * + * @return the progressHealth value. + */ + public DiskReplicationProgressHealth progressHealth() { + return this.progressHealth; + } + + /** + * Get the transferredBytes property: The transferred bytes from source VM to azure for the disk. + * + * @return the transferredBytes value. + */ + public Long transferredBytes() { + return this.transferredBytes; + } + + /** + * Get the last15MinutesTransferredBytes property: The bytes transferred in last 15 minutes from source VM to azure. + * + * @return the last15MinutesTransferredBytes value. + */ + public Long last15MinutesTransferredBytes() { + return this.last15MinutesTransferredBytes; + } + + /** + * Get the lastDataTransferTimeUtc property: The time of the last data transfer from source VM to azure. + * + * @return the lastDataTransferTimeUtc value. + */ + public String lastDataTransferTimeUtc() { + return this.lastDataTransferTimeUtc; + } + + /** + * Get the processedBytes property: The total processed bytes. This includes bytes that are transferred from source + * VM to azure and matched bytes. + * + * @return the processedBytes value. + */ + public Long processedBytes() { + return this.processedBytes; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the lastRefreshTime property: The last refresh time. + * + * @return the lastRefreshTime value. + */ + public String lastRefreshTime() { + return this.lastRefreshTime; + } + + /** + * Get the progressPercentage property: Progress in percentage. Progress percentage is calculated based on processed + * bytes. + * + * @return the progressPercentage value. + */ + public Integer progressPercentage() { + return this.progressPercentage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmTestFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmTestFailoverInput.java new file mode 100644 index 000000000000..e948a19c1820 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmTestFailoverInput.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageRcm provider specific input for test failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmTestFailoverInput extends TestFailoverProviderSpecificInput { + /* + * The test network Id. + */ + @JsonProperty(value = "networkId") + private String networkId; + + /* + * The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery + * point, null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** Creates an instance of InMageRcmTestFailoverInput class. */ + public InMageRcmTestFailoverInput() { + } + + /** + * Get the networkId property: The test network Id. + * + * @return the networkId value. + */ + public String networkId() { + return this.networkId; + } + + /** + * Set the networkId property: The test network Id. + * + * @param networkId the networkId value to set. + * @return the InMageRcmTestFailoverInput object itself. + */ + public InMageRcmTestFailoverInput withNetworkId(String networkId) { + this.networkId = networkId; + return this; + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the InMageRcmTestFailoverInput object itself. + */ + public InMageRcmTestFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUnplannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUnplannedFailoverInput.java new file mode 100644 index 000000000000..4c207c50a321 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUnplannedFailoverInput.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageRcm provider specific input for unplanned failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmUnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { + /* + * A value indicating whether VM is to be shutdown. + */ + @JsonProperty(value = "performShutdown", required = true) + private String performShutdown; + + /* + * The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, + * null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** Creates an instance of InMageRcmUnplannedFailoverInput class. */ + public InMageRcmUnplannedFailoverInput() { + } + + /** + * Get the performShutdown property: A value indicating whether VM is to be shutdown. + * + * @return the performShutdown value. + */ + public String performShutdown() { + return this.performShutdown; + } + + /** + * Set the performShutdown property: A value indicating whether VM is to be shutdown. + * + * @param performShutdown the performShutdown value to set. + * @return the InMageRcmUnplannedFailoverInput object itself. + */ + public InMageRcmUnplannedFailoverInput withPerformShutdown(String performShutdown) { + this.performShutdown = performShutdown; + return this; + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the InMageRcmUnplannedFailoverInput object itself. + */ + public InMageRcmUnplannedFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (performShutdown() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property performShutdown in model InMageRcmUnplannedFailoverInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmUnplannedFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java new file mode 100644 index 000000000000..bf317be8fb9e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateApplianceForReplicationProtectedItemInput.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageRcm provider specific input to update appliance for replication protected item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmUpdateApplianceForReplicationProtectedItemInput + extends UpdateApplianceForReplicationProtectedItemProviderSpecificInput { + /* + * The run as account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /** Creates an instance of InMageRcmUpdateApplianceForReplicationProtectedItemInput class. */ + public InMageRcmUpdateApplianceForReplicationProtectedItemInput() { + } + + /** + * Get the runAsAccountId property: The run as account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The run as account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the InMageRcmUpdateApplianceForReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateApplianceForReplicationProtectedItemInput withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateContainerMappingInput.java new file mode 100644 index 000000000000..2373c16340ac --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateContainerMappingInput.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageRcm update protection container mapping. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmUpdateContainerMappingInput extends ReplicationProviderSpecificUpdateContainerMappingInput { + /* + * A value indicating whether agent auto upgrade has to be enabled. + */ + @JsonProperty(value = "enableAgentAutoUpgrade", required = true) + private String enableAgentAutoUpgrade; + + /** Creates an instance of InMageRcmUpdateContainerMappingInput class. */ + public InMageRcmUpdateContainerMappingInput() { + } + + /** + * Get the enableAgentAutoUpgrade property: A value indicating whether agent auto upgrade has to be enabled. + * + * @return the enableAgentAutoUpgrade value. + */ + public String enableAgentAutoUpgrade() { + return this.enableAgentAutoUpgrade; + } + + /** + * Set the enableAgentAutoUpgrade property: A value indicating whether agent auto upgrade has to be enabled. + * + * @param enableAgentAutoUpgrade the enableAgentAutoUpgrade value to set. + * @return the InMageRcmUpdateContainerMappingInput object itself. + */ + public InMageRcmUpdateContainerMappingInput withEnableAgentAutoUpgrade(String enableAgentAutoUpgrade) { + this.enableAgentAutoUpgrade = enableAgentAutoUpgrade; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (enableAgentAutoUpgrade() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property enableAgentAutoUpgrade in model" + + " InMageRcmUpdateContainerMappingInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageRcmUpdateContainerMappingInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateReplicationProtectedItemInput.java new file mode 100644 index 000000000000..4523eef2bfaf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateReplicationProtectedItemInput.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; + +/** InMageRcm provider specific input to update replication protected item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class InMageRcmUpdateReplicationProtectedItemInput extends UpdateReplicationProtectedItemProviderInput { + /* + * The target VM name. + */ + @JsonProperty(value = "targetVmName") + private String targetVmName; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /* + * The target resource group ARM Id. + */ + @JsonProperty(value = "targetResourceGroupId") + private String targetResourceGroupId; + + /* + * The target availability set ARM Id. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The target boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId") + private String targetBootDiagnosticsStorageAccountId; + + /* + * The target network ARM Id. + */ + @JsonProperty(value = "targetNetworkId") + private String targetNetworkId; + + /* + * The test network ARM Id. + */ + @JsonProperty(value = "testNetworkId") + private String testNetworkId; + + /* + * The list of NIC details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The license type. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /** Creates an instance of InMageRcmUpdateReplicationProtectedItemInput class. */ + public InMageRcmUpdateReplicationProtectedItemInput() { + } + + /** + * Get the targetVmName property: The target VM name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Set the targetVmName property: The target VM name. + * + * @param targetVmName the targetVmName value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withTargetVmName(String targetVmName) { + this.targetVmName = targetVmName; + return this; + } + + /** + * Get the targetVmSize property: The target VM size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Set the targetVmSize property: The target VM size. + * + * @param targetVmSize the targetVmSize value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withTargetVmSize(String targetVmSize) { + this.targetVmSize = targetVmSize; + return this; + } + + /** + * Get the targetResourceGroupId property: The target resource group ARM Id. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: The target resource group ARM Id. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the targetAvailabilitySetId property: The target availability set ARM Id. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The target availability set ARM Id. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withTargetProximityPlacementGroupId( + String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @return the targetBootDiagnosticsStorageAccountId value. + */ + public String targetBootDiagnosticsStorageAccountId() { + return this.targetBootDiagnosticsStorageAccountId; + } + + /** + * Set the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @param targetBootDiagnosticsStorageAccountId the targetBootDiagnosticsStorageAccountId value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withTargetBootDiagnosticsStorageAccountId( + String targetBootDiagnosticsStorageAccountId) { + this.targetBootDiagnosticsStorageAccountId = targetBootDiagnosticsStorageAccountId; + return this; + } + + /** + * Get the targetNetworkId property: The target network ARM Id. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: The target network ARM Id. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: The test network ARM Id. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: The test network ARM Id. + * + * @param testNetworkId the testNetworkId value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the vmNics property: The list of NIC details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The list of NIC details. + * + * @param vmNics the vmNics value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the licenseType property: The license type. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The license type. + * + * @param licenseType the licenseType value to set. + * @return the InMageRcmUpdateReplicationProtectedItemInput object itself. + */ + public InMageRcmUpdateReplicationProtectedItemInput withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReplicationDetails.java new file mode 100644 index 000000000000..4c647d45ee74 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReplicationDetails.java @@ -0,0 +1,1107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +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; +import java.util.Map; + +/** InMage provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class InMageReplicationDetails extends ReplicationProviderSpecificSettings { + /* + * The active location of the VM. If the VM is being protected from Azure, this field will take values from { + * Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. + */ + @JsonProperty(value = "activeSiteType") + private String activeSiteType; + + /* + * The CPU count of the VM on the primary side. + */ + @JsonProperty(value = "sourceVmCpuCount") + private Integer sourceVmCpuCount; + + /* + * The RAM size of the VM on the primary side. + */ + @JsonProperty(value = "sourceVmRamSizeInMB") + private Integer sourceVmRamSizeInMB; + + /* + * The OS details. + */ + @JsonProperty(value = "osDetails") + private OSDiskDetails osDetails; + + /* + * The protection stage. + */ + @JsonProperty(value = "protectionStage") + private String protectionStage; + + /* + * The virtual machine Id. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * The protection state for the vm. + */ + @JsonProperty(value = "vmProtectionState") + private String vmProtectionState; + + /* + * The protection state description for the vm. + */ + @JsonProperty(value = "vmProtectionStateDescription") + private String vmProtectionStateDescription; + + /* + * The resync details of the machine. + */ + @JsonProperty(value = "resyncDetails") + private InitialReplicationDetails resyncDetails; + + /* + * The retention window start time. + */ + @JsonProperty(value = "retentionWindowStart") + private OffsetDateTime retentionWindowStart; + + /* + * The retention window end time. + */ + @JsonProperty(value = "retentionWindowEnd") + private OffsetDateTime retentionWindowEnd; + + /* + * The compressed data change rate in MB. + */ + @JsonProperty(value = "compressedDataRateInMB") + private Double compressedDataRateInMB; + + /* + * The uncompressed data change rate in MB. + */ + @JsonProperty(value = "uncompressedDataRateInMB") + private Double uncompressedDataRateInMB; + + /* + * The RPO in seconds. + */ + @JsonProperty(value = "rpoInSeconds") + private Long rpoInSeconds; + + /* + * The list of protected disks. + */ + @JsonProperty(value = "protectedDisks") + private List protectedDisks; + + /* + * The source IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The last heartbeat received from the source server. + */ + @JsonProperty(value = "lastHeartbeat") + private OffsetDateTime lastHeartbeat; + + /* + * The process server Id. + */ + @JsonProperty(value = "processServerId") + private String processServerId; + + /* + * The master target Id. + */ + @JsonProperty(value = "masterTargetId") + private String masterTargetId; + + /* + * The collection of Consistency points. + */ + @JsonProperty(value = "consistencyPoints") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map consistencyPoints; + + /* + * A value indicating whether any disk is resized for this VM. + */ + @JsonProperty(value = "diskResized") + private String diskResized; + + /* + * A value indicating whether the source server requires a restart after update. + */ + @JsonProperty(value = "rebootAfterUpdateStatus") + private String rebootAfterUpdateStatus; + + /* + * The multi vm group Id, if any. + */ + @JsonProperty(value = "multiVmGroupId") + private String multiVmGroupId; + + /* + * The multi vm group name, if any. + */ + @JsonProperty(value = "multiVmGroupName") + private String multiVmGroupName; + + /* + * A value indicating whether the multi vm sync is enabled or disabled. + */ + @JsonProperty(value = "multiVmSyncStatus") + private String multiVmSyncStatus; + + /* + * The agent details. + */ + @JsonProperty(value = "agentDetails") + private InMageAgentDetails agentDetails; + + /* + * The vCenter infrastructure Id. + */ + @JsonProperty(value = "vCenterInfrastructureId") + private String vCenterInfrastructureId; + + /* + * The infrastructure VM Id. + */ + @JsonProperty(value = "infrastructureVmId") + private String infrastructureVmId; + + /* + * The PE Network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * A value indicating the discovery type of the machine. + */ + @JsonProperty(value = "discoveryType") + private String discoveryType; + + /* + * A value indicating the underlying Azure storage account. If the VM is not running in Azure, this value shall be + * set to null. + */ + @JsonProperty(value = "azureStorageAccountId") + private String azureStorageAccountId; + + /* + * The datastores of the on-premise machine Value can be list of strings that contain datastore names. + */ + @JsonProperty(value = "datastores") + private List datastores; + + /* + * The validation errors of the on-premise machine Value can be list of validation errors. + */ + @JsonProperty(value = "validationErrors") + private List validationErrors; + + /* + * The last RPO calculated time. + */ + @JsonProperty(value = "lastRpoCalculatedTime") + private OffsetDateTime lastRpoCalculatedTime; + + /* + * The last update time received from on-prem components. + */ + @JsonProperty(value = "lastUpdateReceivedTime") + private OffsetDateTime lastUpdateReceivedTime; + + /* + * The replica id of the protected item. + */ + @JsonProperty(value = "replicaId") + private String replicaId; + + /* + * The OS Version of the protected item. + */ + @JsonProperty(value = "osVersion") + private String osVersion; + + /* + * A value indicating whether additional IR stats are available or not. + */ + @JsonProperty(value = "isAdditionalStatsAvailable") + private Boolean isAdditionalStatsAvailable; + + /* + * The total transferred data in bytes. + */ + @JsonProperty(value = "totalDataTransferred") + private Long totalDataTransferred; + + /* + * The progress health. + */ + @JsonProperty(value = "totalProgressHealth") + private String totalProgressHealth; + + /** Creates an instance of InMageReplicationDetails class. */ + public InMageReplicationDetails() { + } + + /** + * Get the activeSiteType property: The active location of the VM. If the VM is being protected from Azure, this + * field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field + * will be OnPrem always. + * + * @return the activeSiteType value. + */ + public String activeSiteType() { + return this.activeSiteType; + } + + /** + * Set the activeSiteType property: The active location of the VM. If the VM is being protected from Azure, this + * field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field + * will be OnPrem always. + * + * @param activeSiteType the activeSiteType value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withActiveSiteType(String activeSiteType) { + this.activeSiteType = activeSiteType; + return this; + } + + /** + * Get the sourceVmCpuCount property: The CPU count of the VM on the primary side. + * + * @return the sourceVmCpuCount value. + */ + public Integer sourceVmCpuCount() { + return this.sourceVmCpuCount; + } + + /** + * Set the sourceVmCpuCount property: The CPU count of the VM on the primary side. + * + * @param sourceVmCpuCount the sourceVmCpuCount value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withSourceVmCpuCount(Integer sourceVmCpuCount) { + this.sourceVmCpuCount = sourceVmCpuCount; + return this; + } + + /** + * Get the sourceVmRamSizeInMB property: The RAM size of the VM on the primary side. + * + * @return the sourceVmRamSizeInMB value. + */ + public Integer sourceVmRamSizeInMB() { + return this.sourceVmRamSizeInMB; + } + + /** + * Set the sourceVmRamSizeInMB property: The RAM size of the VM on the primary side. + * + * @param sourceVmRamSizeInMB the sourceVmRamSizeInMB value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withSourceVmRamSizeInMB(Integer sourceVmRamSizeInMB) { + this.sourceVmRamSizeInMB = sourceVmRamSizeInMB; + return this; + } + + /** + * Get the osDetails property: The OS details. + * + * @return the osDetails value. + */ + public OSDiskDetails osDetails() { + return this.osDetails; + } + + /** + * Set the osDetails property: The OS details. + * + * @param osDetails the osDetails value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withOsDetails(OSDiskDetails osDetails) { + this.osDetails = osDetails; + return this; + } + + /** + * Get the protectionStage property: The protection stage. + * + * @return the protectionStage value. + */ + public String protectionStage() { + return this.protectionStage; + } + + /** + * Set the protectionStage property: The protection stage. + * + * @param protectionStage the protectionStage value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withProtectionStage(String protectionStage) { + this.protectionStage = protectionStage; + return this; + } + + /** + * Get the vmId property: The virtual machine Id. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: The virtual machine Id. + * + * @param vmId the vmId value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the vmProtectionState property: The protection state for the vm. + * + * @return the vmProtectionState value. + */ + public String vmProtectionState() { + return this.vmProtectionState; + } + + /** + * Set the vmProtectionState property: The protection state for the vm. + * + * @param vmProtectionState the vmProtectionState value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withVmProtectionState(String vmProtectionState) { + this.vmProtectionState = vmProtectionState; + return this; + } + + /** + * Get the vmProtectionStateDescription property: The protection state description for the vm. + * + * @return the vmProtectionStateDescription value. + */ + public String vmProtectionStateDescription() { + return this.vmProtectionStateDescription; + } + + /** + * Set the vmProtectionStateDescription property: The protection state description for the vm. + * + * @param vmProtectionStateDescription the vmProtectionStateDescription value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withVmProtectionStateDescription(String vmProtectionStateDescription) { + this.vmProtectionStateDescription = vmProtectionStateDescription; + return this; + } + + /** + * Get the resyncDetails property: The resync details of the machine. + * + * @return the resyncDetails value. + */ + public InitialReplicationDetails resyncDetails() { + return this.resyncDetails; + } + + /** + * Set the resyncDetails property: The resync details of the machine. + * + * @param resyncDetails the resyncDetails value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withResyncDetails(InitialReplicationDetails resyncDetails) { + this.resyncDetails = resyncDetails; + return this; + } + + /** + * Get the retentionWindowStart property: The retention window start time. + * + * @return the retentionWindowStart value. + */ + public OffsetDateTime retentionWindowStart() { + return this.retentionWindowStart; + } + + /** + * Set the retentionWindowStart property: The retention window start time. + * + * @param retentionWindowStart the retentionWindowStart value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withRetentionWindowStart(OffsetDateTime retentionWindowStart) { + this.retentionWindowStart = retentionWindowStart; + return this; + } + + /** + * Get the retentionWindowEnd property: The retention window end time. + * + * @return the retentionWindowEnd value. + */ + public OffsetDateTime retentionWindowEnd() { + return this.retentionWindowEnd; + } + + /** + * Set the retentionWindowEnd property: The retention window end time. + * + * @param retentionWindowEnd the retentionWindowEnd value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withRetentionWindowEnd(OffsetDateTime retentionWindowEnd) { + this.retentionWindowEnd = retentionWindowEnd; + return this; + } + + /** + * Get the compressedDataRateInMB property: The compressed data change rate in MB. + * + * @return the compressedDataRateInMB value. + */ + public Double compressedDataRateInMB() { + return this.compressedDataRateInMB; + } + + /** + * Set the compressedDataRateInMB property: The compressed data change rate in MB. + * + * @param compressedDataRateInMB the compressedDataRateInMB value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withCompressedDataRateInMB(Double compressedDataRateInMB) { + this.compressedDataRateInMB = compressedDataRateInMB; + return this; + } + + /** + * Get the uncompressedDataRateInMB property: The uncompressed data change rate in MB. + * + * @return the uncompressedDataRateInMB value. + */ + public Double uncompressedDataRateInMB() { + return this.uncompressedDataRateInMB; + } + + /** + * Set the uncompressedDataRateInMB property: The uncompressed data change rate in MB. + * + * @param uncompressedDataRateInMB the uncompressedDataRateInMB value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withUncompressedDataRateInMB(Double uncompressedDataRateInMB) { + this.uncompressedDataRateInMB = uncompressedDataRateInMB; + return this; + } + + /** + * Get the rpoInSeconds property: The RPO in seconds. + * + * @return the rpoInSeconds value. + */ + public Long rpoInSeconds() { + return this.rpoInSeconds; + } + + /** + * Set the rpoInSeconds property: The RPO in seconds. + * + * @param rpoInSeconds the rpoInSeconds value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withRpoInSeconds(Long rpoInSeconds) { + this.rpoInSeconds = rpoInSeconds; + return this; + } + + /** + * Get the protectedDisks property: The list of protected disks. + * + * @return the protectedDisks value. + */ + public List protectedDisks() { + return this.protectedDisks; + } + + /** + * Set the protectedDisks property: The list of protected disks. + * + * @param protectedDisks the protectedDisks value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withProtectedDisks(List protectedDisks) { + this.protectedDisks = protectedDisks; + return this; + } + + /** + * Get the ipAddress property: The source IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The source IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the lastHeartbeat property: The last heartbeat received from the source server. + * + * @return the lastHeartbeat value. + */ + public OffsetDateTime lastHeartbeat() { + return this.lastHeartbeat; + } + + /** + * Set the lastHeartbeat property: The last heartbeat received from the source server. + * + * @param lastHeartbeat the lastHeartbeat value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withLastHeartbeat(OffsetDateTime lastHeartbeat) { + this.lastHeartbeat = lastHeartbeat; + return this; + } + + /** + * Get the processServerId property: The process server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The process server Id. + * + * @param processServerId the processServerId value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the masterTargetId property: The master target Id. + * + * @return the masterTargetId value. + */ + public String masterTargetId() { + return this.masterTargetId; + } + + /** + * Set the masterTargetId property: The master target Id. + * + * @param masterTargetId the masterTargetId value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withMasterTargetId(String masterTargetId) { + this.masterTargetId = masterTargetId; + return this; + } + + /** + * Get the consistencyPoints property: The collection of Consistency points. + * + * @return the consistencyPoints value. + */ + public Map consistencyPoints() { + return this.consistencyPoints; + } + + /** + * Set the consistencyPoints property: The collection of Consistency points. + * + * @param consistencyPoints the consistencyPoints value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withConsistencyPoints(Map consistencyPoints) { + this.consistencyPoints = consistencyPoints; + return this; + } + + /** + * Get the diskResized property: A value indicating whether any disk is resized for this VM. + * + * @return the diskResized value. + */ + public String diskResized() { + return this.diskResized; + } + + /** + * Set the diskResized property: A value indicating whether any disk is resized for this VM. + * + * @param diskResized the diskResized value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withDiskResized(String diskResized) { + this.diskResized = diskResized; + return this; + } + + /** + * Get the rebootAfterUpdateStatus property: A value indicating whether the source server requires a restart after + * update. + * + * @return the rebootAfterUpdateStatus value. + */ + public String rebootAfterUpdateStatus() { + return this.rebootAfterUpdateStatus; + } + + /** + * Set the rebootAfterUpdateStatus property: A value indicating whether the source server requires a restart after + * update. + * + * @param rebootAfterUpdateStatus the rebootAfterUpdateStatus value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withRebootAfterUpdateStatus(String rebootAfterUpdateStatus) { + this.rebootAfterUpdateStatus = rebootAfterUpdateStatus; + return this; + } + + /** + * Get the multiVmGroupId property: The multi vm group Id, if any. + * + * @return the multiVmGroupId value. + */ + public String multiVmGroupId() { + return this.multiVmGroupId; + } + + /** + * Set the multiVmGroupId property: The multi vm group Id, if any. + * + * @param multiVmGroupId the multiVmGroupId value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withMultiVmGroupId(String multiVmGroupId) { + this.multiVmGroupId = multiVmGroupId; + return this; + } + + /** + * Get the multiVmGroupName property: The multi vm group name, if any. + * + * @return the multiVmGroupName value. + */ + public String multiVmGroupName() { + return this.multiVmGroupName; + } + + /** + * Set the multiVmGroupName property: The multi vm group name, if any. + * + * @param multiVmGroupName the multiVmGroupName value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withMultiVmGroupName(String multiVmGroupName) { + this.multiVmGroupName = multiVmGroupName; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether the multi vm sync is enabled or disabled. + * + * @return the multiVmSyncStatus value. + */ + public String multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether the multi vm sync is enabled or disabled. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withMultiVmSyncStatus(String multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Get the agentDetails property: The agent details. + * + * @return the agentDetails value. + */ + public InMageAgentDetails agentDetails() { + return this.agentDetails; + } + + /** + * Set the agentDetails property: The agent details. + * + * @param agentDetails the agentDetails value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withAgentDetails(InMageAgentDetails agentDetails) { + this.agentDetails = agentDetails; + return this; + } + + /** + * Get the vCenterInfrastructureId property: The vCenter infrastructure Id. + * + * @return the vCenterInfrastructureId value. + */ + public String vCenterInfrastructureId() { + return this.vCenterInfrastructureId; + } + + /** + * Set the vCenterInfrastructureId property: The vCenter infrastructure Id. + * + * @param vCenterInfrastructureId the vCenterInfrastructureId value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withVCenterInfrastructureId(String vCenterInfrastructureId) { + this.vCenterInfrastructureId = vCenterInfrastructureId; + return this; + } + + /** + * Get the infrastructureVmId property: The infrastructure VM Id. + * + * @return the infrastructureVmId value. + */ + public String infrastructureVmId() { + return this.infrastructureVmId; + } + + /** + * Set the infrastructureVmId property: The infrastructure VM Id. + * + * @param infrastructureVmId the infrastructureVmId value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withInfrastructureVmId(String infrastructureVmId) { + this.infrastructureVmId = infrastructureVmId; + return this; + } + + /** + * Get the vmNics property: The PE Network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The PE Network details. + * + * @param vmNics the vmNics value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the discoveryType property: A value indicating the discovery type of the machine. + * + * @return the discoveryType value. + */ + public String discoveryType() { + return this.discoveryType; + } + + /** + * Set the discoveryType property: A value indicating the discovery type of the machine. + * + * @param discoveryType the discoveryType value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withDiscoveryType(String discoveryType) { + this.discoveryType = discoveryType; + return this; + } + + /** + * Get the azureStorageAccountId property: A value indicating the underlying Azure storage account. If the VM is not + * running in Azure, this value shall be set to null. + * + * @return the azureStorageAccountId value. + */ + public String azureStorageAccountId() { + return this.azureStorageAccountId; + } + + /** + * Set the azureStorageAccountId property: A value indicating the underlying Azure storage account. If the VM is not + * running in Azure, this value shall be set to null. + * + * @param azureStorageAccountId the azureStorageAccountId value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withAzureStorageAccountId(String azureStorageAccountId) { + this.azureStorageAccountId = azureStorageAccountId; + return this; + } + + /** + * Get the datastores property: The datastores of the on-premise machine Value can be list of strings that contain + * datastore names. + * + * @return the datastores value. + */ + public List datastores() { + return this.datastores; + } + + /** + * Set the datastores property: The datastores of the on-premise machine Value can be list of strings that contain + * datastore names. + * + * @param datastores the datastores value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withDatastores(List datastores) { + this.datastores = datastores; + return this; + } + + /** + * Get the validationErrors property: The validation errors of the on-premise machine Value can be list of + * validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Set the validationErrors property: The validation errors of the on-premise machine Value can be list of + * validation errors. + * + * @param validationErrors the validationErrors value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withValidationErrors(List validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Get the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @return the lastRpoCalculatedTime value. + */ + public OffsetDateTime lastRpoCalculatedTime() { + return this.lastRpoCalculatedTime; + } + + /** + * Set the lastRpoCalculatedTime property: The last RPO calculated time. + * + * @param lastRpoCalculatedTime the lastRpoCalculatedTime value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withLastRpoCalculatedTime(OffsetDateTime lastRpoCalculatedTime) { + this.lastRpoCalculatedTime = lastRpoCalculatedTime; + return this; + } + + /** + * Get the lastUpdateReceivedTime property: The last update time received from on-prem components. + * + * @return the lastUpdateReceivedTime value. + */ + public OffsetDateTime lastUpdateReceivedTime() { + return this.lastUpdateReceivedTime; + } + + /** + * Set the lastUpdateReceivedTime property: The last update time received from on-prem components. + * + * @param lastUpdateReceivedTime the lastUpdateReceivedTime value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withLastUpdateReceivedTime(OffsetDateTime lastUpdateReceivedTime) { + this.lastUpdateReceivedTime = lastUpdateReceivedTime; + return this; + } + + /** + * Get the replicaId property: The replica id of the protected item. + * + * @return the replicaId value. + */ + public String replicaId() { + return this.replicaId; + } + + /** + * Set the replicaId property: The replica id of the protected item. + * + * @param replicaId the replicaId value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withReplicaId(String replicaId) { + this.replicaId = replicaId; + return this; + } + + /** + * Get the osVersion property: The OS Version of the protected item. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Set the osVersion property: The OS Version of the protected item. + * + * @param osVersion the osVersion value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withOsVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get the isAdditionalStatsAvailable property: A value indicating whether additional IR stats are available or not. + * + * @return the isAdditionalStatsAvailable value. + */ + public Boolean isAdditionalStatsAvailable() { + return this.isAdditionalStatsAvailable; + } + + /** + * Set the isAdditionalStatsAvailable property: A value indicating whether additional IR stats are available or not. + * + * @param isAdditionalStatsAvailable the isAdditionalStatsAvailable value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withIsAdditionalStatsAvailable(Boolean isAdditionalStatsAvailable) { + this.isAdditionalStatsAvailable = isAdditionalStatsAvailable; + return this; + } + + /** + * Get the totalDataTransferred property: The total transferred data in bytes. + * + * @return the totalDataTransferred value. + */ + public Long totalDataTransferred() { + return this.totalDataTransferred; + } + + /** + * Set the totalDataTransferred property: The total transferred data in bytes. + * + * @param totalDataTransferred the totalDataTransferred value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withTotalDataTransferred(Long totalDataTransferred) { + this.totalDataTransferred = totalDataTransferred; + return this; + } + + /** + * Get the totalProgressHealth property: The progress health. + * + * @return the totalProgressHealth value. + */ + public String totalProgressHealth() { + return this.totalProgressHealth; + } + + /** + * Set the totalProgressHealth property: The progress health. + * + * @param totalProgressHealth the totalProgressHealth value to set. + * @return the InMageReplicationDetails object itself. + */ + public InMageReplicationDetails withTotalProgressHealth(String totalProgressHealth) { + this.totalProgressHealth = totalProgressHealth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (osDetails() != null) { + osDetails().validate(); + } + if (resyncDetails() != null) { + resyncDetails().validate(); + } + if (protectedDisks() != null) { + protectedDisks().forEach(e -> e.validate()); + } + if (agentDetails() != null) { + agentDetails().validate(); + } + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReprotectInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReprotectInput.java new file mode 100644 index 000000000000..4944d08020ad --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReprotectInput.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** InMageAzureV2 specific provider input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class InMageReprotectInput extends ReverseReplicationProviderSpecificInput { + /* + * The Master Target Id. + */ + @JsonProperty(value = "masterTargetId", required = true) + private String masterTargetId; + + /* + * The Process Server Id. + */ + @JsonProperty(value = "processServerId", required = true) + private String processServerId; + + /* + * The retention drive to use on the MT. + */ + @JsonProperty(value = "retentionDrive", required = true) + private String retentionDrive; + + /* + * The CS account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /* + * The target datastore name. + */ + @JsonProperty(value = "datastoreName") + private String datastoreName; + + /* + * The enable disk exclusion input. + */ + @JsonProperty(value = "diskExclusionInput") + private InMageDiskExclusionInput diskExclusionInput; + + /* + * The Policy Id. + */ + @JsonProperty(value = "profileId", required = true) + private String profileId; + + /* + * The disks to include list. + */ + @JsonProperty(value = "disksToInclude") + private List disksToInclude; + + /** Creates an instance of InMageReprotectInput class. */ + public InMageReprotectInput() { + } + + /** + * Get the masterTargetId property: The Master Target Id. + * + * @return the masterTargetId value. + */ + public String masterTargetId() { + return this.masterTargetId; + } + + /** + * Set the masterTargetId property: The Master Target Id. + * + * @param masterTargetId the masterTargetId value to set. + * @return the InMageReprotectInput object itself. + */ + public InMageReprotectInput withMasterTargetId(String masterTargetId) { + this.masterTargetId = masterTargetId; + return this; + } + + /** + * Get the processServerId property: The Process Server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The Process Server Id. + * + * @param processServerId the processServerId value to set. + * @return the InMageReprotectInput object itself. + */ + public InMageReprotectInput withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the retentionDrive property: The retention drive to use on the MT. + * + * @return the retentionDrive value. + */ + public String retentionDrive() { + return this.retentionDrive; + } + + /** + * Set the retentionDrive property: The retention drive to use on the MT. + * + * @param retentionDrive the retentionDrive value to set. + * @return the InMageReprotectInput object itself. + */ + public InMageReprotectInput withRetentionDrive(String retentionDrive) { + this.retentionDrive = retentionDrive; + return this; + } + + /** + * Get the runAsAccountId property: The CS account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The CS account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the InMageReprotectInput object itself. + */ + public InMageReprotectInput withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Get the datastoreName property: The target datastore name. + * + * @return the datastoreName value. + */ + public String datastoreName() { + return this.datastoreName; + } + + /** + * Set the datastoreName property: The target datastore name. + * + * @param datastoreName the datastoreName value to set. + * @return the InMageReprotectInput object itself. + */ + public InMageReprotectInput withDatastoreName(String datastoreName) { + this.datastoreName = datastoreName; + return this; + } + + /** + * Get the diskExclusionInput property: The enable disk exclusion input. + * + * @return the diskExclusionInput value. + */ + public InMageDiskExclusionInput diskExclusionInput() { + return this.diskExclusionInput; + } + + /** + * Set the diskExclusionInput property: The enable disk exclusion input. + * + * @param diskExclusionInput the diskExclusionInput value to set. + * @return the InMageReprotectInput object itself. + */ + public InMageReprotectInput withDiskExclusionInput(InMageDiskExclusionInput diskExclusionInput) { + this.diskExclusionInput = diskExclusionInput; + return this; + } + + /** + * Get the profileId property: The Policy Id. + * + * @return the profileId value. + */ + public String profileId() { + return this.profileId; + } + + /** + * Set the profileId property: The Policy Id. + * + * @param profileId the profileId value to set. + * @return the InMageReprotectInput object itself. + */ + public InMageReprotectInput withProfileId(String profileId) { + this.profileId = profileId; + return this; + } + + /** + * Get the disksToInclude property: The disks to include list. + * + * @return the disksToInclude value. + */ + public List disksToInclude() { + return this.disksToInclude; + } + + /** + * Set the disksToInclude property: The disks to include list. + * + * @param disksToInclude the disksToInclude value to set. + * @return the InMageReprotectInput object itself. + */ + public InMageReprotectInput withDisksToInclude(List disksToInclude) { + this.disksToInclude = disksToInclude; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (masterTargetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property masterTargetId in model InMageReprotectInput")); + } + if (processServerId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property processServerId in model InMageReprotectInput")); + } + if (retentionDrive() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property retentionDrive in model InMageReprotectInput")); + } + if (diskExclusionInput() != null) { + diskExclusionInput().validate(); + } + if (profileId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property profileId in model InMageReprotectInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InMageReprotectInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageTestFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageTestFailoverInput.java new file mode 100644 index 000000000000..df3864b2dd70 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageTestFailoverInput.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.recoveryservicessiterecovery.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; + +/** Provider specific input for InMage test failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class InMageTestFailoverInput extends TestFailoverProviderSpecificInput { + /* + * The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point + * provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. + */ + @JsonProperty(value = "recoveryPointType") + private RecoveryPointType recoveryPointType; + + /* + * The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery + * point, null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** Creates an instance of InMageTestFailoverInput class. */ + public InMageTestFailoverInput() { + } + + /** + * Get the recoveryPointType property: The recovery point type. Values from LatestTime, LatestTag or Custom. In the + * case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery + * point id will be ignored. + * + * @return the recoveryPointType value. + */ + public RecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type. Values from LatestTime, LatestTag or Custom. In the + * case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery + * point id will be ignored. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the InMageTestFailoverInput object itself. + */ + public InMageTestFailoverInput withRecoveryPointType(RecoveryPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to test failover to a particular recovery + * point. In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the InMageTestFailoverInput object itself. + */ + public InMageTestFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageUnplannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageUnplannedFailoverInput.java new file mode 100644 index 000000000000..05e102e98bd9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageUnplannedFailoverInput.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.recoveryservicessiterecovery.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; + +/** Provider specific input for InMage unplanned failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class InMageUnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { + /* + * The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point + * provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. + */ + @JsonProperty(value = "recoveryPointType") + private RecoveryPointType recoveryPointType; + + /* + * The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, + * null should be passed. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** Creates an instance of InMageUnplannedFailoverInput class. */ + public InMageUnplannedFailoverInput() { + } + + /** + * Get the recoveryPointType property: The recovery point type. Values from LatestTime, LatestTag or Custom. In the + * case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery + * point id will be ignored. + * + * @return the recoveryPointType value. + */ + public RecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type. Values from LatestTime, LatestTag or Custom. In the + * case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery + * point id will be ignored. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the InMageUnplannedFailoverInput object itself. + */ + public InMageUnplannedFailoverInput withRecoveryPointType(RecoveryPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point id to be passed to failover to a particular recovery point. + * In case of latest recovery point, null should be passed. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the InMageUnplannedFailoverInput object itself. + */ + public InMageUnplannedFailoverInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageV2RpRecoveryPointType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageV2RpRecoveryPointType.java new file mode 100644 index 000000000000..b04f1105263d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageV2RpRecoveryPointType.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recovery point type. */ +public final class InMageV2RpRecoveryPointType extends ExpandableStringEnum { + /** Static value Latest for InMageV2RpRecoveryPointType. */ + public static final InMageV2RpRecoveryPointType LATEST = fromString("Latest"); + + /** Static value LatestApplicationConsistent for InMageV2RpRecoveryPointType. */ + public static final InMageV2RpRecoveryPointType LATEST_APPLICATION_CONSISTENT = + fromString("LatestApplicationConsistent"); + + /** Static value LatestCrashConsistent for InMageV2RpRecoveryPointType. */ + public static final InMageV2RpRecoveryPointType LATEST_CRASH_CONSISTENT = fromString("LatestCrashConsistent"); + + /** Static value LatestProcessed for InMageV2RpRecoveryPointType. */ + public static final InMageV2RpRecoveryPointType LATEST_PROCESSED = fromString("LatestProcessed"); + + /** + * Creates or finds a InMageV2RpRecoveryPointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InMageV2RpRecoveryPointType. + */ + @JsonCreator + public static InMageV2RpRecoveryPointType fromString(String name) { + return fromString(name, InMageV2RpRecoveryPointType.class); + } + + /** + * Gets known InMageV2RpRecoveryPointType values. + * + * @return known InMageV2RpRecoveryPointType values. + */ + public static Collection values() { + return values(InMageV2RpRecoveryPointType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageVolumeExclusionOptions.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageVolumeExclusionOptions.java new file mode 100644 index 000000000000..4261cf033767 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageVolumeExclusionOptions.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Guest disk signature based disk exclusion option when doing enable protection of virtual machine in InMage provider. + */ +@Fluent +public final class InMageVolumeExclusionOptions { + /* + * The volume label. The disk having any volume with this label will be excluded from replication. + */ + @JsonProperty(value = "volumeLabel") + private String volumeLabel; + + /* + * The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the + * volume has label matching with VolumeLabel this disk will be excluded from replication if + * OnlyExcludeIfSingleVolume is false. + */ + @JsonProperty(value = "onlyExcludeIfSingleVolume") + private String onlyExcludeIfSingleVolume; + + /** Creates an instance of InMageVolumeExclusionOptions class. */ + public InMageVolumeExclusionOptions() { + } + + /** + * Get the volumeLabel property: The volume label. The disk having any volume with this label will be excluded from + * replication. + * + * @return the volumeLabel value. + */ + public String volumeLabel() { + return this.volumeLabel; + } + + /** + * Set the volumeLabel property: The volume label. The disk having any volume with this label will be excluded from + * replication. + * + * @param volumeLabel the volumeLabel value to set. + * @return the InMageVolumeExclusionOptions object itself. + */ + public InMageVolumeExclusionOptions withVolumeLabel(String volumeLabel) { + this.volumeLabel = volumeLabel; + return this; + } + + /** + * Get the onlyExcludeIfSingleVolume property: The value indicating whether to exclude multi volume disk or not. If + * a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded + * from replication if OnlyExcludeIfSingleVolume is false. + * + * @return the onlyExcludeIfSingleVolume value. + */ + public String onlyExcludeIfSingleVolume() { + return this.onlyExcludeIfSingleVolume; + } + + /** + * Set the onlyExcludeIfSingleVolume property: The value indicating whether to exclude multi volume disk or not. If + * a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded + * from replication if OnlyExcludeIfSingleVolume is false. + * + * @param onlyExcludeIfSingleVolume the onlyExcludeIfSingleVolume value to set. + * @return the InMageVolumeExclusionOptions object itself. + */ + public InMageVolumeExclusionOptions withOnlyExcludeIfSingleVolume(String onlyExcludeIfSingleVolume) { + this.onlyExcludeIfSingleVolume = onlyExcludeIfSingleVolume; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InconsistentVmDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InconsistentVmDetails.java new file mode 100644 index 000000000000..c2ed6ab0b7e9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InconsistentVmDetails.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This class stores the monitoring details for consistency check of inconsistent Protected Entity. */ +@Fluent +public final class InconsistentVmDetails { + /* + * The Vm name. + */ + @JsonProperty(value = "vmName") + private String vmName; + + /* + * The Cloud name. + */ + @JsonProperty(value = "cloudName") + private String cloudName; + + /* + * The list of details regarding state of the Protected Entity in SRS and On prem. + */ + @JsonProperty(value = "details") + private List details; + + /* + * The list of error ids. + */ + @JsonProperty(value = "errorIds") + private List errorIds; + + /** Creates an instance of InconsistentVmDetails class. */ + public InconsistentVmDetails() { + } + + /** + * Get the vmName property: The Vm name. + * + * @return the vmName value. + */ + public String vmName() { + return this.vmName; + } + + /** + * Set the vmName property: The Vm name. + * + * @param vmName the vmName value to set. + * @return the InconsistentVmDetails object itself. + */ + public InconsistentVmDetails withVmName(String vmName) { + this.vmName = vmName; + return this; + } + + /** + * Get the cloudName property: The Cloud name. + * + * @return the cloudName value. + */ + public String cloudName() { + return this.cloudName; + } + + /** + * Set the cloudName property: The Cloud name. + * + * @param cloudName the cloudName value to set. + * @return the InconsistentVmDetails object itself. + */ + public InconsistentVmDetails withCloudName(String cloudName) { + this.cloudName = cloudName; + return this; + } + + /** + * Get the details property: The list of details regarding state of the Protected Entity in SRS and On prem. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: The list of details regarding state of the Protected Entity in SRS and On prem. + * + * @param details the details value to set. + * @return the InconsistentVmDetails object itself. + */ + public InconsistentVmDetails withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the errorIds property: The list of error ids. + * + * @return the errorIds value. + */ + public List errorIds() { + return this.errorIds; + } + + /** + * Set the errorIds property: The list of error ids. + * + * @param errorIds the errorIds value to set. + * @return the InconsistentVmDetails object itself. + */ + public InconsistentVmDetails withErrorIds(List errorIds) { + this.errorIds = errorIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InitialReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InitialReplicationDetails.java new file mode 100644 index 000000000000..b9f11efc1630 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InitialReplicationDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Initial replication details. */ +@Fluent +public final class InitialReplicationDetails { + /* + * Initial replication type. + */ + @JsonProperty(value = "initialReplicationType") + private String initialReplicationType; + + /* + * The initial replication progress percentage. + */ + @JsonProperty(value = "initialReplicationProgressPercentage") + private String initialReplicationProgressPercentage; + + /** Creates an instance of InitialReplicationDetails class. */ + public InitialReplicationDetails() { + } + + /** + * Get the initialReplicationType property: Initial replication type. + * + * @return the initialReplicationType value. + */ + public String initialReplicationType() { + return this.initialReplicationType; + } + + /** + * Set the initialReplicationType property: Initial replication type. + * + * @param initialReplicationType the initialReplicationType value to set. + * @return the InitialReplicationDetails object itself. + */ + public InitialReplicationDetails withInitialReplicationType(String initialReplicationType) { + this.initialReplicationType = initialReplicationType; + return this; + } + + /** + * Get the initialReplicationProgressPercentage property: The initial replication progress percentage. + * + * @return the initialReplicationProgressPercentage value. + */ + public String initialReplicationProgressPercentage() { + return this.initialReplicationProgressPercentage; + } + + /** + * Set the initialReplicationProgressPercentage property: The initial replication progress percentage. + * + * @param initialReplicationProgressPercentage the initialReplicationProgressPercentage value to set. + * @return the InitialReplicationDetails object itself. + */ + public InitialReplicationDetails withInitialReplicationProgressPercentage( + String initialReplicationProgressPercentage) { + this.initialReplicationProgressPercentage = initialReplicationProgressPercentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InlineWorkflowTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InlineWorkflowTaskDetails.java new file mode 100644 index 000000000000..1abe23815b30 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InlineWorkflowTaskDetails.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; + +/** This class represents the inline workflow task details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InlineWorkflowTaskDetails") +@Fluent +public final class InlineWorkflowTaskDetails extends GroupTaskDetails { + /* + * The list of child workflow ids. + */ + @JsonProperty(value = "workflowIds") + private List workflowIds; + + /** Creates an instance of InlineWorkflowTaskDetails class. */ + public InlineWorkflowTaskDetails() { + } + + /** + * Get the workflowIds property: The list of child workflow ids. + * + * @return the workflowIds value. + */ + public List workflowIds() { + return this.workflowIds; + } + + /** + * Set the workflowIds property: The list of child workflow ids. + * + * @param workflowIds the workflowIds value to set. + * @return the InlineWorkflowTaskDetails object itself. + */ + public InlineWorkflowTaskDetails withWorkflowIds(List workflowIds) { + this.workflowIds = workflowIds; + return this; + } + + /** {@inheritDoc} */ + @Override + public InlineWorkflowTaskDetails withChildTasks(List childTasks) { + super.withChildTasks(childTasks); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InnerHealthError.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InnerHealthError.java new file mode 100644 index 000000000000..c43ecca47b33 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InnerHealthError.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Implements InnerHealthError class. HealthError object has a list of InnerHealthErrors as child errors. + * InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate + * the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this + * in the same fashion as Exception -&gt; InnerException. + */ +@Fluent +public final class InnerHealthError { + /* + * Source of error. + */ + @JsonProperty(value = "errorSource") + private String errorSource; + + /* + * Type of error. + */ + @JsonProperty(value = "errorType") + private String errorType; + + /* + * Level of error. + */ + @JsonProperty(value = "errorLevel") + private String errorLevel; + + /* + * Category of error. + */ + @JsonProperty(value = "errorCategory") + private String errorCategory; + + /* + * Error code. + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Summary message of the entity. + */ + @JsonProperty(value = "summaryMessage") + private String summaryMessage; + + /* + * Error message. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * Possible causes of error. + */ + @JsonProperty(value = "possibleCauses") + private String possibleCauses; + + /* + * Recommended action to resolve error. + */ + @JsonProperty(value = "recommendedAction") + private String recommendedAction; + + /* + * Error creation time (UTC). + */ + @JsonProperty(value = "creationTimeUtc") + private OffsetDateTime creationTimeUtc; + + /* + * DRA error message. + */ + @JsonProperty(value = "recoveryProviderErrorMessage") + private String recoveryProviderErrorMessage; + + /* + * ID of the entity. + */ + @JsonProperty(value = "entityId") + private String entityId; + + /* + * The health error unique id. + */ + @JsonProperty(value = "errorId") + private String errorId; + + /* + * Value indicating whether the health error is customer resolvable. + */ + @JsonProperty(value = "customerResolvability") + private HealthErrorCustomerResolvability customerResolvability; + + /** Creates an instance of InnerHealthError class. */ + public InnerHealthError() { + } + + /** + * Get the errorSource property: Source of error. + * + * @return the errorSource value. + */ + public String errorSource() { + return this.errorSource; + } + + /** + * Set the errorSource property: Source of error. + * + * @param errorSource the errorSource value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withErrorSource(String errorSource) { + this.errorSource = errorSource; + return this; + } + + /** + * Get the errorType property: Type of error. + * + * @return the errorType value. + */ + public String errorType() { + return this.errorType; + } + + /** + * Set the errorType property: Type of error. + * + * @param errorType the errorType value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withErrorType(String errorType) { + this.errorType = errorType; + return this; + } + + /** + * Get the errorLevel property: Level of error. + * + * @return the errorLevel value. + */ + public String errorLevel() { + return this.errorLevel; + } + + /** + * Set the errorLevel property: Level of error. + * + * @param errorLevel the errorLevel value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withErrorLevel(String errorLevel) { + this.errorLevel = errorLevel; + return this; + } + + /** + * Get the errorCategory property: Category of error. + * + * @return the errorCategory value. + */ + public String errorCategory() { + return this.errorCategory; + } + + /** + * Set the errorCategory property: Category of error. + * + * @param errorCategory the errorCategory value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withErrorCategory(String errorCategory) { + this.errorCategory = errorCategory; + return this; + } + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: Error code. + * + * @param errorCode the errorCode value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the summaryMessage property: Summary message of the entity. + * + * @return the summaryMessage value. + */ + public String summaryMessage() { + return this.summaryMessage; + } + + /** + * Set the summaryMessage property: Summary message of the entity. + * + * @param summaryMessage the summaryMessage value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withSummaryMessage(String summaryMessage) { + this.summaryMessage = summaryMessage; + return this; + } + + /** + * Get the errorMessage property: Error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message. + * + * @param errorMessage the errorMessage value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the possibleCauses property: Possible causes of error. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Set the possibleCauses property: Possible causes of error. + * + * @param possibleCauses the possibleCauses value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withPossibleCauses(String possibleCauses) { + this.possibleCauses = possibleCauses; + return this; + } + + /** + * Get the recommendedAction property: Recommended action to resolve error. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Set the recommendedAction property: Recommended action to resolve error. + * + * @param recommendedAction the recommendedAction value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withRecommendedAction(String recommendedAction) { + this.recommendedAction = recommendedAction; + return this; + } + + /** + * Get the creationTimeUtc property: Error creation time (UTC). + * + * @return the creationTimeUtc value. + */ + public OffsetDateTime creationTimeUtc() { + return this.creationTimeUtc; + } + + /** + * Set the creationTimeUtc property: Error creation time (UTC). + * + * @param creationTimeUtc the creationTimeUtc value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withCreationTimeUtc(OffsetDateTime creationTimeUtc) { + this.creationTimeUtc = creationTimeUtc; + return this; + } + + /** + * Get the recoveryProviderErrorMessage property: DRA error message. + * + * @return the recoveryProviderErrorMessage value. + */ + public String recoveryProviderErrorMessage() { + return this.recoveryProviderErrorMessage; + } + + /** + * Set the recoveryProviderErrorMessage property: DRA error message. + * + * @param recoveryProviderErrorMessage the recoveryProviderErrorMessage value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withRecoveryProviderErrorMessage(String recoveryProviderErrorMessage) { + this.recoveryProviderErrorMessage = recoveryProviderErrorMessage; + return this; + } + + /** + * Get the entityId property: ID of the entity. + * + * @return the entityId value. + */ + public String entityId() { + return this.entityId; + } + + /** + * Set the entityId property: ID of the entity. + * + * @param entityId the entityId value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withEntityId(String entityId) { + this.entityId = entityId; + return this; + } + + /** + * Get the errorId property: The health error unique id. + * + * @return the errorId value. + */ + public String errorId() { + return this.errorId; + } + + /** + * Set the errorId property: The health error unique id. + * + * @param errorId the errorId value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withErrorId(String errorId) { + this.errorId = errorId; + return this; + } + + /** + * Get the customerResolvability property: Value indicating whether the health error is customer resolvable. + * + * @return the customerResolvability value. + */ + public HealthErrorCustomerResolvability customerResolvability() { + return this.customerResolvability; + } + + /** + * Set the customerResolvability property: Value indicating whether the health error is customer resolvable. + * + * @param customerResolvability the customerResolvability value to set. + * @return the InnerHealthError object itself. + */ + public InnerHealthError withCustomerResolvability(HealthErrorCustomerResolvability customerResolvability) { + this.customerResolvability = customerResolvability; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InputEndpoint.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InputEndpoint.java new file mode 100644 index 000000000000..acfbea5c7ea9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InputEndpoint.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The InputEndpoint model. */ +@Fluent +public final class InputEndpoint { + /* + * The endpointName property. + */ + @JsonProperty(value = "endpointName") + private String endpointName; + + /* + * The privatePort property. + */ + @JsonProperty(value = "privatePort") + private Integer privatePort; + + /* + * The publicPort property. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /* + * The protocol property. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** Creates an instance of InputEndpoint class. */ + public InputEndpoint() { + } + + /** + * Get the endpointName property: The endpointName property. + * + * @return the endpointName value. + */ + public String endpointName() { + return this.endpointName; + } + + /** + * Set the endpointName property: The endpointName property. + * + * @param endpointName the endpointName value to set. + * @return the InputEndpoint object itself. + */ + public InputEndpoint withEndpointName(String endpointName) { + this.endpointName = endpointName; + return this; + } + + /** + * Get the privatePort property: The privatePort property. + * + * @return the privatePort value. + */ + public Integer privatePort() { + return this.privatePort; + } + + /** + * Set the privatePort property: The privatePort property. + * + * @param privatePort the privatePort value to set. + * @return the InputEndpoint object itself. + */ + public InputEndpoint withPrivatePort(Integer privatePort) { + this.privatePort = privatePort; + return this; + } + + /** + * Get the publicPort property: The publicPort property. + * + * @return the publicPort value. + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the publicPort property: The publicPort property. + * + * @param publicPort the publicPort value to set. + * @return the InputEndpoint object itself. + */ + public InputEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + + /** + * Get the protocol property: The protocol property. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol property. + * + * @param protocol the protocol value to set. + * @return the InputEndpoint object itself. + */ + public InputEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfigDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfigDetails.java new file mode 100644 index 000000000000..45bdf770f334 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfigDetails.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The IpConfigDetails model. */ +@Fluent +public final class IpConfigDetails { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The isPrimary property. + */ + @JsonProperty(value = "isPrimary") + private Boolean isPrimary; + + /* + * The subnetName property. + */ + @JsonProperty(value = "subnetName") + private String subnetName; + + /* + * The staticIPAddress property. + */ + @JsonProperty(value = "staticIPAddress") + private String staticIpAddress; + + /* + * The ipAddressType property. + */ + @JsonProperty(value = "ipAddressType") + private String ipAddressType; + + /* + * The isSeletedForFailover property. + */ + @JsonProperty(value = "isSeletedForFailover") + private Boolean isSeletedForFailover; + + /* + * The recoverySubnetName property. + */ + @JsonProperty(value = "recoverySubnetName") + private String recoverySubnetName; + + /* + * The recoveryStaticIPAddress property. + */ + @JsonProperty(value = "recoveryStaticIPAddress") + private String recoveryStaticIpAddress; + + /* + * The recoveryIPAddressType property. + */ + @JsonProperty(value = "recoveryIPAddressType") + private String recoveryIpAddressType; + + /* + * The recoveryPublicIPAddressId property. + */ + @JsonProperty(value = "recoveryPublicIPAddressId") + private String recoveryPublicIpAddressId; + + /* + * The recoveryLBBackendAddressPoolIds property. + */ + @JsonProperty(value = "recoveryLBBackendAddressPoolIds") + private List recoveryLBBackendAddressPoolIds; + + /* + * The tfoSubnetName property. + */ + @JsonProperty(value = "tfoSubnetName") + private String tfoSubnetName; + + /* + * The tfoStaticIPAddress property. + */ + @JsonProperty(value = "tfoStaticIPAddress") + private String tfoStaticIpAddress; + + /* + * The tfoPublicIPAddressId property. + */ + @JsonProperty(value = "tfoPublicIPAddressId") + private String tfoPublicIpAddressId; + + /* + * The tfoLBBackendAddressPoolIds property. + */ + @JsonProperty(value = "tfoLBBackendAddressPoolIds") + private List tfoLBBackendAddressPoolIds; + + /** Creates an instance of IpConfigDetails class. */ + public IpConfigDetails() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isPrimary property: The isPrimary property. + * + * @return the isPrimary value. + */ + public Boolean isPrimary() { + return this.isPrimary; + } + + /** + * Set the isPrimary property: The isPrimary property. + * + * @param isPrimary the isPrimary value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withIsPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get the subnetName property: The subnetName property. + * + * @return the subnetName value. + */ + public String subnetName() { + return this.subnetName; + } + + /** + * Set the subnetName property: The subnetName property. + * + * @param subnetName the subnetName value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withSubnetName(String subnetName) { + this.subnetName = subnetName; + return this; + } + + /** + * Get the staticIpAddress property: The staticIPAddress property. + * + * @return the staticIpAddress value. + */ + public String staticIpAddress() { + return this.staticIpAddress; + } + + /** + * Set the staticIpAddress property: The staticIPAddress property. + * + * @param staticIpAddress the staticIpAddress value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withStaticIpAddress(String staticIpAddress) { + this.staticIpAddress = staticIpAddress; + return this; + } + + /** + * Get the ipAddressType property: The ipAddressType property. + * + * @return the ipAddressType value. + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Set the ipAddressType property: The ipAddressType property. + * + * @param ipAddressType the ipAddressType value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withIpAddressType(String ipAddressType) { + this.ipAddressType = ipAddressType; + return this; + } + + /** + * Get the isSeletedForFailover property: The isSeletedForFailover property. + * + * @return the isSeletedForFailover value. + */ + public Boolean isSeletedForFailover() { + return this.isSeletedForFailover; + } + + /** + * Set the isSeletedForFailover property: The isSeletedForFailover property. + * + * @param isSeletedForFailover the isSeletedForFailover value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withIsSeletedForFailover(Boolean isSeletedForFailover) { + this.isSeletedForFailover = isSeletedForFailover; + return this; + } + + /** + * Get the recoverySubnetName property: The recoverySubnetName property. + * + * @return the recoverySubnetName value. + */ + public String recoverySubnetName() { + return this.recoverySubnetName; + } + + /** + * Set the recoverySubnetName property: The recoverySubnetName property. + * + * @param recoverySubnetName the recoverySubnetName value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withRecoverySubnetName(String recoverySubnetName) { + this.recoverySubnetName = recoverySubnetName; + return this; + } + + /** + * Get the recoveryStaticIpAddress property: The recoveryStaticIPAddress property. + * + * @return the recoveryStaticIpAddress value. + */ + public String recoveryStaticIpAddress() { + return this.recoveryStaticIpAddress; + } + + /** + * Set the recoveryStaticIpAddress property: The recoveryStaticIPAddress property. + * + * @param recoveryStaticIpAddress the recoveryStaticIpAddress value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withRecoveryStaticIpAddress(String recoveryStaticIpAddress) { + this.recoveryStaticIpAddress = recoveryStaticIpAddress; + return this; + } + + /** + * Get the recoveryIpAddressType property: The recoveryIPAddressType property. + * + * @return the recoveryIpAddressType value. + */ + public String recoveryIpAddressType() { + return this.recoveryIpAddressType; + } + + /** + * Set the recoveryIpAddressType property: The recoveryIPAddressType property. + * + * @param recoveryIpAddressType the recoveryIpAddressType value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withRecoveryIpAddressType(String recoveryIpAddressType) { + this.recoveryIpAddressType = recoveryIpAddressType; + return this; + } + + /** + * Get the recoveryPublicIpAddressId property: The recoveryPublicIPAddressId property. + * + * @return the recoveryPublicIpAddressId value. + */ + public String recoveryPublicIpAddressId() { + return this.recoveryPublicIpAddressId; + } + + /** + * Set the recoveryPublicIpAddressId property: The recoveryPublicIPAddressId property. + * + * @param recoveryPublicIpAddressId the recoveryPublicIpAddressId value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withRecoveryPublicIpAddressId(String recoveryPublicIpAddressId) { + this.recoveryPublicIpAddressId = recoveryPublicIpAddressId; + return this; + } + + /** + * Get the recoveryLBBackendAddressPoolIds property: The recoveryLBBackendAddressPoolIds property. + * + * @return the recoveryLBBackendAddressPoolIds value. + */ + public List recoveryLBBackendAddressPoolIds() { + return this.recoveryLBBackendAddressPoolIds; + } + + /** + * Set the recoveryLBBackendAddressPoolIds property: The recoveryLBBackendAddressPoolIds property. + * + * @param recoveryLBBackendAddressPoolIds the recoveryLBBackendAddressPoolIds value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withRecoveryLBBackendAddressPoolIds(List recoveryLBBackendAddressPoolIds) { + this.recoveryLBBackendAddressPoolIds = recoveryLBBackendAddressPoolIds; + return this; + } + + /** + * Get the tfoSubnetName property: The tfoSubnetName property. + * + * @return the tfoSubnetName value. + */ + public String tfoSubnetName() { + return this.tfoSubnetName; + } + + /** + * Set the tfoSubnetName property: The tfoSubnetName property. + * + * @param tfoSubnetName the tfoSubnetName value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withTfoSubnetName(String tfoSubnetName) { + this.tfoSubnetName = tfoSubnetName; + return this; + } + + /** + * Get the tfoStaticIpAddress property: The tfoStaticIPAddress property. + * + * @return the tfoStaticIpAddress value. + */ + public String tfoStaticIpAddress() { + return this.tfoStaticIpAddress; + } + + /** + * Set the tfoStaticIpAddress property: The tfoStaticIPAddress property. + * + * @param tfoStaticIpAddress the tfoStaticIpAddress value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withTfoStaticIpAddress(String tfoStaticIpAddress) { + this.tfoStaticIpAddress = tfoStaticIpAddress; + return this; + } + + /** + * Get the tfoPublicIpAddressId property: The tfoPublicIPAddressId property. + * + * @return the tfoPublicIpAddressId value. + */ + public String tfoPublicIpAddressId() { + return this.tfoPublicIpAddressId; + } + + /** + * Set the tfoPublicIpAddressId property: The tfoPublicIPAddressId property. + * + * @param tfoPublicIpAddressId the tfoPublicIpAddressId value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withTfoPublicIpAddressId(String tfoPublicIpAddressId) { + this.tfoPublicIpAddressId = tfoPublicIpAddressId; + return this; + } + + /** + * Get the tfoLBBackendAddressPoolIds property: The tfoLBBackendAddressPoolIds property. + * + * @return the tfoLBBackendAddressPoolIds value. + */ + public List tfoLBBackendAddressPoolIds() { + return this.tfoLBBackendAddressPoolIds; + } + + /** + * Set the tfoLBBackendAddressPoolIds property: The tfoLBBackendAddressPoolIds property. + * + * @param tfoLBBackendAddressPoolIds the tfoLBBackendAddressPoolIds value to set. + * @return the IpConfigDetails object itself. + */ + public IpConfigDetails withTfoLBBackendAddressPoolIds(List tfoLBBackendAddressPoolIds) { + this.tfoLBBackendAddressPoolIds = tfoLBBackendAddressPoolIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfigInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfigInputDetails.java new file mode 100644 index 000000000000..69d85611ef9e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfigInputDetails.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The IpConfigInputDetails model. */ +@Fluent +public final class IpConfigInputDetails { + /* + * The ipConfigName property. + */ + @JsonProperty(value = "ipConfigName") + private String ipConfigName; + + /* + * The isPrimary property. + */ + @JsonProperty(value = "isPrimary") + private Boolean isPrimary; + + /* + * The isSeletedForFailover property. + */ + @JsonProperty(value = "isSeletedForFailover") + private Boolean isSeletedForFailover; + + /* + * The recoverySubnetName property. + */ + @JsonProperty(value = "recoverySubnetName") + private String recoverySubnetName; + + /* + * The recoveryStaticIPAddress property. + */ + @JsonProperty(value = "recoveryStaticIPAddress") + private String recoveryStaticIpAddress; + + /* + * The recoveryPublicIPAddressId property. + */ + @JsonProperty(value = "recoveryPublicIPAddressId") + private String recoveryPublicIpAddressId; + + /* + * The recoveryLBBackendAddressPoolIds property. + */ + @JsonProperty(value = "recoveryLBBackendAddressPoolIds") + private List recoveryLBBackendAddressPoolIds; + + /* + * The tfoSubnetName property. + */ + @JsonProperty(value = "tfoSubnetName") + private String tfoSubnetName; + + /* + * The tfoStaticIPAddress property. + */ + @JsonProperty(value = "tfoStaticIPAddress") + private String tfoStaticIpAddress; + + /* + * The tfoPublicIPAddressId property. + */ + @JsonProperty(value = "tfoPublicIPAddressId") + private String tfoPublicIpAddressId; + + /* + * The tfoLBBackendAddressPoolIds property. + */ + @JsonProperty(value = "tfoLBBackendAddressPoolIds") + private List tfoLBBackendAddressPoolIds; + + /** Creates an instance of IpConfigInputDetails class. */ + public IpConfigInputDetails() { + } + + /** + * Get the ipConfigName property: The ipConfigName property. + * + * @return the ipConfigName value. + */ + public String ipConfigName() { + return this.ipConfigName; + } + + /** + * Set the ipConfigName property: The ipConfigName property. + * + * @param ipConfigName the ipConfigName value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withIpConfigName(String ipConfigName) { + this.ipConfigName = ipConfigName; + return this; + } + + /** + * Get the isPrimary property: The isPrimary property. + * + * @return the isPrimary value. + */ + public Boolean isPrimary() { + return this.isPrimary; + } + + /** + * Set the isPrimary property: The isPrimary property. + * + * @param isPrimary the isPrimary value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withIsPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get the isSeletedForFailover property: The isSeletedForFailover property. + * + * @return the isSeletedForFailover value. + */ + public Boolean isSeletedForFailover() { + return this.isSeletedForFailover; + } + + /** + * Set the isSeletedForFailover property: The isSeletedForFailover property. + * + * @param isSeletedForFailover the isSeletedForFailover value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withIsSeletedForFailover(Boolean isSeletedForFailover) { + this.isSeletedForFailover = isSeletedForFailover; + return this; + } + + /** + * Get the recoverySubnetName property: The recoverySubnetName property. + * + * @return the recoverySubnetName value. + */ + public String recoverySubnetName() { + return this.recoverySubnetName; + } + + /** + * Set the recoverySubnetName property: The recoverySubnetName property. + * + * @param recoverySubnetName the recoverySubnetName value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withRecoverySubnetName(String recoverySubnetName) { + this.recoverySubnetName = recoverySubnetName; + return this; + } + + /** + * Get the recoveryStaticIpAddress property: The recoveryStaticIPAddress property. + * + * @return the recoveryStaticIpAddress value. + */ + public String recoveryStaticIpAddress() { + return this.recoveryStaticIpAddress; + } + + /** + * Set the recoveryStaticIpAddress property: The recoveryStaticIPAddress property. + * + * @param recoveryStaticIpAddress the recoveryStaticIpAddress value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withRecoveryStaticIpAddress(String recoveryStaticIpAddress) { + this.recoveryStaticIpAddress = recoveryStaticIpAddress; + return this; + } + + /** + * Get the recoveryPublicIpAddressId property: The recoveryPublicIPAddressId property. + * + * @return the recoveryPublicIpAddressId value. + */ + public String recoveryPublicIpAddressId() { + return this.recoveryPublicIpAddressId; + } + + /** + * Set the recoveryPublicIpAddressId property: The recoveryPublicIPAddressId property. + * + * @param recoveryPublicIpAddressId the recoveryPublicIpAddressId value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withRecoveryPublicIpAddressId(String recoveryPublicIpAddressId) { + this.recoveryPublicIpAddressId = recoveryPublicIpAddressId; + return this; + } + + /** + * Get the recoveryLBBackendAddressPoolIds property: The recoveryLBBackendAddressPoolIds property. + * + * @return the recoveryLBBackendAddressPoolIds value. + */ + public List recoveryLBBackendAddressPoolIds() { + return this.recoveryLBBackendAddressPoolIds; + } + + /** + * Set the recoveryLBBackendAddressPoolIds property: The recoveryLBBackendAddressPoolIds property. + * + * @param recoveryLBBackendAddressPoolIds the recoveryLBBackendAddressPoolIds value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withRecoveryLBBackendAddressPoolIds(List recoveryLBBackendAddressPoolIds) { + this.recoveryLBBackendAddressPoolIds = recoveryLBBackendAddressPoolIds; + return this; + } + + /** + * Get the tfoSubnetName property: The tfoSubnetName property. + * + * @return the tfoSubnetName value. + */ + public String tfoSubnetName() { + return this.tfoSubnetName; + } + + /** + * Set the tfoSubnetName property: The tfoSubnetName property. + * + * @param tfoSubnetName the tfoSubnetName value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withTfoSubnetName(String tfoSubnetName) { + this.tfoSubnetName = tfoSubnetName; + return this; + } + + /** + * Get the tfoStaticIpAddress property: The tfoStaticIPAddress property. + * + * @return the tfoStaticIpAddress value. + */ + public String tfoStaticIpAddress() { + return this.tfoStaticIpAddress; + } + + /** + * Set the tfoStaticIpAddress property: The tfoStaticIPAddress property. + * + * @param tfoStaticIpAddress the tfoStaticIpAddress value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withTfoStaticIpAddress(String tfoStaticIpAddress) { + this.tfoStaticIpAddress = tfoStaticIpAddress; + return this; + } + + /** + * Get the tfoPublicIpAddressId property: The tfoPublicIPAddressId property. + * + * @return the tfoPublicIpAddressId value. + */ + public String tfoPublicIpAddressId() { + return this.tfoPublicIpAddressId; + } + + /** + * Set the tfoPublicIpAddressId property: The tfoPublicIPAddressId property. + * + * @param tfoPublicIpAddressId the tfoPublicIpAddressId value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withTfoPublicIpAddressId(String tfoPublicIpAddressId) { + this.tfoPublicIpAddressId = tfoPublicIpAddressId; + return this; + } + + /** + * Get the tfoLBBackendAddressPoolIds property: The tfoLBBackendAddressPoolIds property. + * + * @return the tfoLBBackendAddressPoolIds value. + */ + public List tfoLBBackendAddressPoolIds() { + return this.tfoLBBackendAddressPoolIds; + } + + /** + * Set the tfoLBBackendAddressPoolIds property: The tfoLBBackendAddressPoolIds property. + * + * @param tfoLBBackendAddressPoolIds the tfoLBBackendAddressPoolIds value to set. + * @return the IpConfigInputDetails object itself. + */ + public IpConfigInputDetails withTfoLBBackendAddressPoolIds(List tfoLBBackendAddressPoolIds) { + this.tfoLBBackendAddressPoolIds = tfoLBBackendAddressPoolIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Job.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Job.java new file mode 100644 index 000000000000..6ac3b03e16a4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Job.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.JobInner; + +/** An immutable client-side representation of Job. */ +public interface Job { + /** + * 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: The custom data. + * + * @return the properties value. + */ + JobProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.JobInner object. + * + * @return the inner object. + */ + JobInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobCollection.java new file mode 100644 index 000000000000..c7e886fa2a0d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.JobInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of jobs. */ +@Fluent +public final class JobCollection { + /* + * The list of jobs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of JobCollection class. */ + public JobCollection() { + } + + /** + * Get the value property: The list of jobs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of jobs. + * + * @param value the value value to set. + * @return the JobCollection object itself. + */ + public JobCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the JobCollection object itself. + */ + public JobCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobDetails.java new file mode 100644 index 000000000000..b6283caff4a0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobDetails.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +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; + +/** Job details based on specific job type. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = JobDetails.class) +@JsonTypeName("JobDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AsrJobDetails", value = AsrJobDetails.class), + @JsonSubTypes.Type(name = "ExportJobDetails", value = ExportJobDetails.class), + @JsonSubTypes.Type(name = "FailoverJobDetails", value = FailoverJobDetails.class), + @JsonSubTypes.Type(name = "SwitchProtectionJobDetails", value = SwitchProtectionJobDetails.class), + @JsonSubTypes.Type(name = "TestFailoverJobDetails", value = TestFailoverJobDetails.class) +}) +@Fluent +public class JobDetails { + /* + * The affected object properties like source server, source cloud, target server, target cloud etc. based on the + * workflow object details. + */ + @JsonProperty(value = "affectedObjectDetails") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map affectedObjectDetails; + + /** Creates an instance of JobDetails class. */ + public JobDetails() { + } + + /** + * Get the affectedObjectDetails property: The affected object properties like source server, source cloud, target + * server, target cloud etc. based on the workflow object details. + * + * @return the affectedObjectDetails value. + */ + public Map affectedObjectDetails() { + return this.affectedObjectDetails; + } + + /** + * Set the affectedObjectDetails property: The affected object properties like source server, source cloud, target + * server, target cloud etc. based on the workflow object details. + * + * @param affectedObjectDetails the affectedObjectDetails value to set. + * @return the JobDetails object itself. + */ + public JobDetails withAffectedObjectDetails(Map affectedObjectDetails) { + this.affectedObjectDetails = affectedObjectDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobEntity.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobEntity.java new file mode 100644 index 000000000000..b32e32378192 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobEntity.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This class contains the minimal job details required to navigate to the desired drill down. */ +@Fluent +public final class JobEntity { + /* + * The job id. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /* + * The job display name. + */ + @JsonProperty(value = "jobFriendlyName") + private String jobFriendlyName; + + /* + * The object id. + */ + @JsonProperty(value = "targetObjectId") + private String targetObjectId; + + /* + * The object name. + */ + @JsonProperty(value = "targetObjectName") + private String targetObjectName; + + /* + * The workflow affected object type. + */ + @JsonProperty(value = "targetInstanceType") + private String targetInstanceType; + + /* + * The job name. Enum type ScenarioName. + */ + @JsonProperty(value = "jobScenarioName") + private String jobScenarioName; + + /** Creates an instance of JobEntity class. */ + public JobEntity() { + } + + /** + * Get the jobId property: The job id. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: The job id. + * + * @param jobId the jobId value to set. + * @return the JobEntity object itself. + */ + public JobEntity withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the jobFriendlyName property: The job display name. + * + * @return the jobFriendlyName value. + */ + public String jobFriendlyName() { + return this.jobFriendlyName; + } + + /** + * Set the jobFriendlyName property: The job display name. + * + * @param jobFriendlyName the jobFriendlyName value to set. + * @return the JobEntity object itself. + */ + public JobEntity withJobFriendlyName(String jobFriendlyName) { + this.jobFriendlyName = jobFriendlyName; + return this; + } + + /** + * Get the targetObjectId property: The object id. + * + * @return the targetObjectId value. + */ + public String targetObjectId() { + return this.targetObjectId; + } + + /** + * Set the targetObjectId property: The object id. + * + * @param targetObjectId the targetObjectId value to set. + * @return the JobEntity object itself. + */ + public JobEntity withTargetObjectId(String targetObjectId) { + this.targetObjectId = targetObjectId; + return this; + } + + /** + * Get the targetObjectName property: The object name. + * + * @return the targetObjectName value. + */ + public String targetObjectName() { + return this.targetObjectName; + } + + /** + * Set the targetObjectName property: The object name. + * + * @param targetObjectName the targetObjectName value to set. + * @return the JobEntity object itself. + */ + public JobEntity withTargetObjectName(String targetObjectName) { + this.targetObjectName = targetObjectName; + return this; + } + + /** + * Get the targetInstanceType property: The workflow affected object type. + * + * @return the targetInstanceType value. + */ + public String targetInstanceType() { + return this.targetInstanceType; + } + + /** + * Set the targetInstanceType property: The workflow affected object type. + * + * @param targetInstanceType the targetInstanceType value to set. + * @return the JobEntity object itself. + */ + public JobEntity withTargetInstanceType(String targetInstanceType) { + this.targetInstanceType = targetInstanceType; + return this; + } + + /** + * Get the jobScenarioName property: The job name. Enum type ScenarioName. + * + * @return the jobScenarioName value. + */ + public String jobScenarioName() { + return this.jobScenarioName; + } + + /** + * Set the jobScenarioName property: The job name. Enum type ScenarioName. + * + * @param jobScenarioName the jobScenarioName value to set. + * @return the JobEntity object itself. + */ + public JobEntity withJobScenarioName(String jobScenarioName) { + this.jobScenarioName = jobScenarioName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobErrorDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobErrorDetails.java new file mode 100644 index 000000000000..99f1514832fc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobErrorDetails.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** This class contains the error details per object. */ +@Fluent +public final class JobErrorDetails { + /* + * The Service error details. + */ + @JsonProperty(value = "serviceErrorDetails") + private ServiceError serviceErrorDetails; + + /* + * The Provider error details. + */ + @JsonProperty(value = "providerErrorDetails") + private ProviderError providerErrorDetails; + + /* + * Error level of error. + */ + @JsonProperty(value = "errorLevel") + private String errorLevel; + + /* + * The creation time of job error. + */ + @JsonProperty(value = "creationTime") + private OffsetDateTime creationTime; + + /* + * The Id of the task. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /** Creates an instance of JobErrorDetails class. */ + public JobErrorDetails() { + } + + /** + * Get the serviceErrorDetails property: The Service error details. + * + * @return the serviceErrorDetails value. + */ + public ServiceError serviceErrorDetails() { + return this.serviceErrorDetails; + } + + /** + * Set the serviceErrorDetails property: The Service error details. + * + * @param serviceErrorDetails the serviceErrorDetails value to set. + * @return the JobErrorDetails object itself. + */ + public JobErrorDetails withServiceErrorDetails(ServiceError serviceErrorDetails) { + this.serviceErrorDetails = serviceErrorDetails; + return this; + } + + /** + * Get the providerErrorDetails property: The Provider error details. + * + * @return the providerErrorDetails value. + */ + public ProviderError providerErrorDetails() { + return this.providerErrorDetails; + } + + /** + * Set the providerErrorDetails property: The Provider error details. + * + * @param providerErrorDetails the providerErrorDetails value to set. + * @return the JobErrorDetails object itself. + */ + public JobErrorDetails withProviderErrorDetails(ProviderError providerErrorDetails) { + this.providerErrorDetails = providerErrorDetails; + return this; + } + + /** + * Get the errorLevel property: Error level of error. + * + * @return the errorLevel value. + */ + public String errorLevel() { + return this.errorLevel; + } + + /** + * Set the errorLevel property: Error level of error. + * + * @param errorLevel the errorLevel value to set. + * @return the JobErrorDetails object itself. + */ + public JobErrorDetails withErrorLevel(String errorLevel) { + this.errorLevel = errorLevel; + return this; + } + + /** + * Get the creationTime property: The creation time of job error. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: The creation time of job error. + * + * @param creationTime the creationTime value to set. + * @return the JobErrorDetails object itself. + */ + public JobErrorDetails withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get the taskId property: The Id of the task. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: The Id of the task. + * + * @param taskId the taskId value to set. + * @return the JobErrorDetails object itself. + */ + public JobErrorDetails withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceErrorDetails() != null) { + serviceErrorDetails().validate(); + } + if (providerErrorDetails() != null) { + providerErrorDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobProperties.java new file mode 100644 index 000000000000..b09b9c2322cb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobProperties.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Job custom data details. */ +@Fluent +public final class JobProperties { + /* + * The activity id. + */ + @JsonProperty(value = "activityId") + private String activityId; + + /* + * The ScenarioName. + */ + @JsonProperty(value = "scenarioName") + private String scenarioName; + + /* + * The DisplayName. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, + * Suspended or Other. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, + * PartiallySucceeded, CompletedWithInformation or Skipped. + */ + @JsonProperty(value = "stateDescription") + private String stateDescription; + + /* + * The tasks. + */ + @JsonProperty(value = "tasks") + private List tasks; + + /* + * The errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /* + * The start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The Allowed action the job. + */ + @JsonProperty(value = "allowedActions") + private List allowedActions; + + /* + * The affected Object Id. + */ + @JsonProperty(value = "targetObjectId") + private String targetObjectId; + + /* + * The name of the affected object. + */ + @JsonProperty(value = "targetObjectName") + private String targetObjectName; + + /* + * The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + */ + @JsonProperty(value = "targetInstanceType") + private String targetInstanceType; + + /* + * The custom job details like test failover job details. + */ + @JsonProperty(value = "customDetails") + private JobDetails customDetails; + + /** Creates an instance of JobProperties class. */ + public JobProperties() { + } + + /** + * Get the activityId property: The activity id. + * + * @return the activityId value. + */ + public String activityId() { + return this.activityId; + } + + /** + * Set the activityId property: The activity id. + * + * @param activityId the activityId value to set. + * @return the JobProperties object itself. + */ + public JobProperties withActivityId(String activityId) { + this.activityId = activityId; + return this; + } + + /** + * Get the scenarioName property: The ScenarioName. + * + * @return the scenarioName value. + */ + public String scenarioName() { + return this.scenarioName; + } + + /** + * Set the scenarioName property: The ScenarioName. + * + * @param scenarioName the scenarioName value to set. + * @return the JobProperties object itself. + */ + public JobProperties withScenarioName(String scenarioName) { + this.scenarioName = scenarioName; + return this; + } + + /** + * Get the friendlyName property: The DisplayName. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The DisplayName. + * + * @param friendlyName the friendlyName value to set. + * @return the JobProperties object itself. + */ + public JobProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the state property: The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, + * Failed, Cancelled, Suspended or Other. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, + * Failed, Cancelled, Suspended or Other. + * + * @param state the state value to set. + * @return the JobProperties object itself. + */ + public JobProperties withState(String state) { + this.state = state; + return this; + } + + /** + * Get the stateDescription property: The description of the state of the Job. For e.g. - For Succeeded state, + * description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + * + * @return the stateDescription value. + */ + public String stateDescription() { + return this.stateDescription; + } + + /** + * Set the stateDescription property: The description of the state of the Job. For e.g. - For Succeeded state, + * description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + * + * @param stateDescription the stateDescription value to set. + * @return the JobProperties object itself. + */ + public JobProperties withStateDescription(String stateDescription) { + this.stateDescription = stateDescription; + return this; + } + + /** + * Get the tasks property: The tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: The tasks. + * + * @param tasks the tasks value to set. + * @return the JobProperties object itself. + */ + public JobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Get the errors property: The errors. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The errors. + * + * @param errors the errors value to set. + * @return the JobProperties object itself. + */ + public JobProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time. + * + * @param startTime the startTime value to set. + * @return the JobProperties object itself. + */ + public JobProperties withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time. + * + * @param endTime the endTime value to set. + * @return the JobProperties object itself. + */ + public JobProperties withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the allowedActions property: The Allowed action the job. + * + * @return the allowedActions value. + */ + public List allowedActions() { + return this.allowedActions; + } + + /** + * Set the allowedActions property: The Allowed action the job. + * + * @param allowedActions the allowedActions value to set. + * @return the JobProperties object itself. + */ + public JobProperties withAllowedActions(List allowedActions) { + this.allowedActions = allowedActions; + return this; + } + + /** + * Get the targetObjectId property: The affected Object Id. + * + * @return the targetObjectId value. + */ + public String targetObjectId() { + return this.targetObjectId; + } + + /** + * Set the targetObjectId property: The affected Object Id. + * + * @param targetObjectId the targetObjectId value to set. + * @return the JobProperties object itself. + */ + public JobProperties withTargetObjectId(String targetObjectId) { + this.targetObjectId = targetObjectId; + return this; + } + + /** + * Get the targetObjectName property: The name of the affected object. + * + * @return the targetObjectName value. + */ + public String targetObjectName() { + return this.targetObjectName; + } + + /** + * Set the targetObjectName property: The name of the affected object. + * + * @param targetObjectName the targetObjectName value to set. + * @return the JobProperties object itself. + */ + public JobProperties withTargetObjectName(String targetObjectName) { + this.targetObjectName = targetObjectName; + return this; + } + + /** + * Get the targetInstanceType property: The type of the affected object which is of + * Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + * + * @return the targetInstanceType value. + */ + public String targetInstanceType() { + return this.targetInstanceType; + } + + /** + * Set the targetInstanceType property: The type of the affected object which is of + * Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + * + * @param targetInstanceType the targetInstanceType value to set. + * @return the JobProperties object itself. + */ + public JobProperties withTargetInstanceType(String targetInstanceType) { + this.targetInstanceType = targetInstanceType; + return this; + } + + /** + * Get the customDetails property: The custom job details like test failover job details. + * + * @return the customDetails value. + */ + public JobDetails customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: The custom job details like test failover job details. + * + * @param customDetails the customDetails value to set. + * @return the JobProperties object itself. + */ + public JobProperties withCustomDetails(JobDetails customDetails) { + this.customDetails = customDetails; + 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 (customDetails() != null) { + customDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobQueryParameter.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobQueryParameter.java new file mode 100644 index 000000000000..1ad713a88e44 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobQueryParameter.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Query parameter to enumerate jobs. */ +@Fluent +public final class JobQueryParameter { + /* + * Date time to get jobs from. + */ + @JsonProperty(value = "startTime") + private String startTime; + + /* + * Date time to get jobs upto. + */ + @JsonProperty(value = "endTime") + private String endTime; + + /* + * The Id of the fabric to search jobs under. + */ + @JsonProperty(value = "fabricId") + private String fabricId; + + /* + * The type of objects. + */ + @JsonProperty(value = "affectedObjectTypes") + private String affectedObjectTypes; + + /* + * The states of the job to be filtered can be in. + */ + @JsonProperty(value = "jobStatus") + private String jobStatus; + + /* + * The output type of the jobs. + */ + @JsonProperty(value = "jobOutputType") + private ExportJobOutputSerializationType jobOutputType; + + /* + * The job Name. + */ + @JsonProperty(value = "jobName") + private String jobName; + + /* + * The timezone offset for the location of the request (in minutes). + */ + @JsonProperty(value = "timezoneOffset") + private Double timezoneOffset; + + /** Creates an instance of JobQueryParameter class. */ + public JobQueryParameter() { + } + + /** + * Get the startTime property: Date time to get jobs from. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Date time to get jobs from. + * + * @param startTime the startTime value to set. + * @return the JobQueryParameter object itself. + */ + public JobQueryParameter withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Date time to get jobs upto. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Date time to get jobs upto. + * + * @param endTime the endTime value to set. + * @return the JobQueryParameter object itself. + */ + public JobQueryParameter withEndTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the fabricId property: The Id of the fabric to search jobs under. + * + * @return the fabricId value. + */ + public String fabricId() { + return this.fabricId; + } + + /** + * Set the fabricId property: The Id of the fabric to search jobs under. + * + * @param fabricId the fabricId value to set. + * @return the JobQueryParameter object itself. + */ + public JobQueryParameter withFabricId(String fabricId) { + this.fabricId = fabricId; + return this; + } + + /** + * Get the affectedObjectTypes property: The type of objects. + * + * @return the affectedObjectTypes value. + */ + public String affectedObjectTypes() { + return this.affectedObjectTypes; + } + + /** + * Set the affectedObjectTypes property: The type of objects. + * + * @param affectedObjectTypes the affectedObjectTypes value to set. + * @return the JobQueryParameter object itself. + */ + public JobQueryParameter withAffectedObjectTypes(String affectedObjectTypes) { + this.affectedObjectTypes = affectedObjectTypes; + return this; + } + + /** + * Get the jobStatus property: The states of the job to be filtered can be in. + * + * @return the jobStatus value. + */ + public String jobStatus() { + return this.jobStatus; + } + + /** + * Set the jobStatus property: The states of the job to be filtered can be in. + * + * @param jobStatus the jobStatus value to set. + * @return the JobQueryParameter object itself. + */ + public JobQueryParameter withJobStatus(String jobStatus) { + this.jobStatus = jobStatus; + return this; + } + + /** + * Get the jobOutputType property: The output type of the jobs. + * + * @return the jobOutputType value. + */ + public ExportJobOutputSerializationType jobOutputType() { + return this.jobOutputType; + } + + /** + * Set the jobOutputType property: The output type of the jobs. + * + * @param jobOutputType the jobOutputType value to set. + * @return the JobQueryParameter object itself. + */ + public JobQueryParameter withJobOutputType(ExportJobOutputSerializationType jobOutputType) { + this.jobOutputType = jobOutputType; + return this; + } + + /** + * Get the jobName property: The job Name. + * + * @return the jobName value. + */ + public String jobName() { + return this.jobName; + } + + /** + * Set the jobName property: The job Name. + * + * @param jobName the jobName value to set. + * @return the JobQueryParameter object itself. + */ + public JobQueryParameter withJobName(String jobName) { + this.jobName = jobName; + return this; + } + + /** + * Get the timezoneOffset property: The timezone offset for the location of the request (in minutes). + * + * @return the timezoneOffset value. + */ + public Double timezoneOffset() { + return this.timezoneOffset; + } + + /** + * Set the timezoneOffset property: The timezone offset for the location of the request (in minutes). + * + * @param timezoneOffset the timezoneOffset value to set. + * @return the JobQueryParameter object itself. + */ + public JobQueryParameter withTimezoneOffset(Double timezoneOffset) { + this.timezoneOffset = timezoneOffset; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobStatusEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobStatusEventDetails.java new file mode 100644 index 000000000000..e1c55fb1958b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobStatusEventDetails.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Model class for event details of a job status event. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("JobStatus") +@Fluent +public final class JobStatusEventDetails extends EventSpecificDetails { + /* + * Job arm id for the event. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /* + * JobName for the Event. + */ + @JsonProperty(value = "jobFriendlyName") + private String jobFriendlyName; + + /* + * JobStatus for the Event. + */ + @JsonProperty(value = "jobStatus") + private String jobStatus; + + /* + * AffectedObjectType for the event. + */ + @JsonProperty(value = "affectedObjectType") + private String affectedObjectType; + + /** Creates an instance of JobStatusEventDetails class. */ + public JobStatusEventDetails() { + } + + /** + * Get the jobId property: Job arm id for the event. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: Job arm id for the event. + * + * @param jobId the jobId value to set. + * @return the JobStatusEventDetails object itself. + */ + public JobStatusEventDetails withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the jobFriendlyName property: JobName for the Event. + * + * @return the jobFriendlyName value. + */ + public String jobFriendlyName() { + return this.jobFriendlyName; + } + + /** + * Set the jobFriendlyName property: JobName for the Event. + * + * @param jobFriendlyName the jobFriendlyName value to set. + * @return the JobStatusEventDetails object itself. + */ + public JobStatusEventDetails withJobFriendlyName(String jobFriendlyName) { + this.jobFriendlyName = jobFriendlyName; + return this; + } + + /** + * Get the jobStatus property: JobStatus for the Event. + * + * @return the jobStatus value. + */ + public String jobStatus() { + return this.jobStatus; + } + + /** + * Set the jobStatus property: JobStatus for the Event. + * + * @param jobStatus the jobStatus value to set. + * @return the JobStatusEventDetails object itself. + */ + public JobStatusEventDetails withJobStatus(String jobStatus) { + this.jobStatus = jobStatus; + return this; + } + + /** + * Get the affectedObjectType property: AffectedObjectType for the event. + * + * @return the affectedObjectType value. + */ + public String affectedObjectType() { + return this.affectedObjectType; + } + + /** + * Set the affectedObjectType property: AffectedObjectType for the event. + * + * @param affectedObjectType the affectedObjectType value to set. + * @return the JobStatusEventDetails object itself. + */ + public JobStatusEventDetails withAffectedObjectType(String affectedObjectType) { + this.affectedObjectType = affectedObjectType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobTaskDetails.java new file mode 100644 index 000000000000..d408bc1773b4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobTaskDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** This class represents a task which is actually a workflow so that one can navigate to its individual drill down. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = JobTaskDetails.class) +@JsonTypeName("JobTaskDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FabricReplicationGroupTaskDetails", value = FabricReplicationGroupTaskDetails.class), + @JsonSubTypes.Type(name = "VirtualMachineTaskDetails", value = VirtualMachineTaskDetails.class) +}) +@Fluent +public class JobTaskDetails extends TaskTypeDetails { + /* + * The job entity. + */ + @JsonProperty(value = "jobTask") + private JobEntity jobTask; + + /** Creates an instance of JobTaskDetails class. */ + public JobTaskDetails() { + } + + /** + * Get the jobTask property: The job entity. + * + * @return the jobTask value. + */ + public JobEntity jobTask() { + return this.jobTask; + } + + /** + * Set the jobTask property: The job entity. + * + * @param jobTask the jobTask value to set. + * @return the JobTaskDetails object itself. + */ + public JobTaskDetails withJobTask(JobEntity jobTask) { + this.jobTask = jobTask; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (jobTask() != null) { + jobTask().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/KeyEncryptionKeyInfo.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/KeyEncryptionKeyInfo.java new file mode 100644 index 000000000000..9ee2b355042c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/KeyEncryptionKeyInfo.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key Encryption Key (KEK) information. */ +@Fluent +public final class KeyEncryptionKeyInfo { + /* + * The key URL / identifier. + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * The KeyVault resource ARM Id for key. + */ + @JsonProperty(value = "keyVaultResourceArmId") + private String keyVaultResourceArmId; + + /** Creates an instance of KeyEncryptionKeyInfo class. */ + public KeyEncryptionKeyInfo() { + } + + /** + * Get the keyIdentifier property: The key URL / identifier. + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: The key URL / identifier. + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the KeyEncryptionKeyInfo object itself. + */ + public KeyEncryptionKeyInfo withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the keyVaultResourceArmId property: The KeyVault resource ARM Id for key. + * + * @return the keyVaultResourceArmId value. + */ + public String keyVaultResourceArmId() { + return this.keyVaultResourceArmId; + } + + /** + * Set the keyVaultResourceArmId property: The KeyVault resource ARM Id for key. + * + * @param keyVaultResourceArmId the keyVaultResourceArmId value to set. + * @return the KeyEncryptionKeyInfo object itself. + */ + public KeyEncryptionKeyInfo withKeyVaultResourceArmId(String keyVaultResourceArmId) { + this.keyVaultResourceArmId = keyVaultResourceArmId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LicenseType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LicenseType.java new file mode 100644 index 000000000000..924c7de468bc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LicenseType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** License type. */ +public final class LicenseType extends ExpandableStringEnum { + /** Static value NotSpecified for LicenseType. */ + public static final LicenseType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value NoLicenseType for LicenseType. */ + public static final LicenseType NO_LICENSE_TYPE = fromString("NoLicenseType"); + + /** Static value WindowsServer for LicenseType. */ + public static final LicenseType WINDOWS_SERVER = fromString("WindowsServer"); + + /** + * Creates or finds a LicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicenseType. + */ + @JsonCreator + public static LicenseType fromString(String name) { + return fromString(name, LicenseType.class); + } + + /** + * Gets known LicenseType values. + * + * @return known LicenseType values. + */ + public static Collection values() { + return values(LicenseType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetwork.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetwork.java new file mode 100644 index 000000000000..ad74460a6e88 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetwork.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner; + +/** An immutable client-side representation of LogicalNetwork. */ +public interface LogicalNetwork { + /** + * 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: The Logical Network Properties. + * + * @return the properties value. + */ + LogicalNetworkProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner object. + * + * @return the inner object. + */ + LogicalNetworkInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetworkCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetworkCollection.java new file mode 100644 index 000000000000..3b995f5c18c7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetworkCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of logical networks. */ +@Fluent +public final class LogicalNetworkCollection { + /* + * The Logical Networks list details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of LogicalNetworkCollection class. */ + public LogicalNetworkCollection() { + } + + /** + * Get the value property: The Logical Networks list details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Logical Networks list details. + * + * @param value the value value to set. + * @return the LogicalNetworkCollection object itself. + */ + public LogicalNetworkCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the LogicalNetworkCollection object itself. + */ + public LogicalNetworkCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetworkProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetworkProperties.java new file mode 100644 index 000000000000..aa8488654b60 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetworkProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Logical Network Properties. */ +@Fluent +public final class LogicalNetworkProperties { + /* + * The Friendly Name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * A value indicating whether Network Virtualization is enabled for the logical network. + */ + @JsonProperty(value = "networkVirtualizationStatus") + private String networkVirtualizationStatus; + + /* + * A value indicating whether logical network is used as private test network by test failover. + */ + @JsonProperty(value = "logicalNetworkUsage") + private String logicalNetworkUsage; + + /* + * A value indicating whether logical network definitions are isolated. + */ + @JsonProperty(value = "logicalNetworkDefinitionsStatus") + private String logicalNetworkDefinitionsStatus; + + /** Creates an instance of LogicalNetworkProperties class. */ + public LogicalNetworkProperties() { + } + + /** + * Get the friendlyName property: The Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the LogicalNetworkProperties object itself. + */ + public LogicalNetworkProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the networkVirtualizationStatus property: A value indicating whether Network Virtualization is enabled for + * the logical network. + * + * @return the networkVirtualizationStatus value. + */ + public String networkVirtualizationStatus() { + return this.networkVirtualizationStatus; + } + + /** + * Set the networkVirtualizationStatus property: A value indicating whether Network Virtualization is enabled for + * the logical network. + * + * @param networkVirtualizationStatus the networkVirtualizationStatus value to set. + * @return the LogicalNetworkProperties object itself. + */ + public LogicalNetworkProperties withNetworkVirtualizationStatus(String networkVirtualizationStatus) { + this.networkVirtualizationStatus = networkVirtualizationStatus; + return this; + } + + /** + * Get the logicalNetworkUsage property: A value indicating whether logical network is used as private test network + * by test failover. + * + * @return the logicalNetworkUsage value. + */ + public String logicalNetworkUsage() { + return this.logicalNetworkUsage; + } + + /** + * Set the logicalNetworkUsage property: A value indicating whether logical network is used as private test network + * by test failover. + * + * @param logicalNetworkUsage the logicalNetworkUsage value to set. + * @return the LogicalNetworkProperties object itself. + */ + public LogicalNetworkProperties withLogicalNetworkUsage(String logicalNetworkUsage) { + this.logicalNetworkUsage = logicalNetworkUsage; + return this; + } + + /** + * Get the logicalNetworkDefinitionsStatus property: A value indicating whether logical network definitions are + * isolated. + * + * @return the logicalNetworkDefinitionsStatus value. + */ + public String logicalNetworkDefinitionsStatus() { + return this.logicalNetworkDefinitionsStatus; + } + + /** + * Set the logicalNetworkDefinitionsStatus property: A value indicating whether logical network definitions are + * isolated. + * + * @param logicalNetworkDefinitionsStatus the logicalNetworkDefinitionsStatus value to set. + * @return the LogicalNetworkProperties object itself. + */ + public LogicalNetworkProperties withLogicalNetworkDefinitionsStatus(String logicalNetworkDefinitionsStatus) { + this.logicalNetworkDefinitionsStatus = logicalNetworkDefinitionsStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ManualActionTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ManualActionTaskDetails.java new file mode 100644 index 000000000000..18d88fa453ed --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ManualActionTaskDetails.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** This class represents the manual action task details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("ManualActionTaskDetails") +@Fluent +public final class ManualActionTaskDetails extends TaskTypeDetails { + /* + * The name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The instructions. + */ + @JsonProperty(value = "instructions") + private String instructions; + + /* + * The observation. + */ + @JsonProperty(value = "observation") + private String observation; + + /** Creates an instance of ManualActionTaskDetails class. */ + public ManualActionTaskDetails() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name. + * + * @param name the name value to set. + * @return the ManualActionTaskDetails object itself. + */ + public ManualActionTaskDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the instructions property: The instructions. + * + * @return the instructions value. + */ + public String instructions() { + return this.instructions; + } + + /** + * Set the instructions property: The instructions. + * + * @param instructions the instructions value to set. + * @return the ManualActionTaskDetails object itself. + */ + public ManualActionTaskDetails withInstructions(String instructions) { + this.instructions = instructions; + return this; + } + + /** + * Get the observation property: The observation. + * + * @return the observation value. + */ + public String observation() { + return this.observation; + } + + /** + * Set the observation property: The observation. + * + * @param observation the observation value to set. + * @return the ManualActionTaskDetails object itself. + */ + public ManualActionTaskDetails withObservation(String observation) { + this.observation = observation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MarsAgentDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MarsAgentDetails.java new file mode 100644 index 000000000000..4f012d08a6dc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MarsAgentDetails.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Mars agent details. */ +@Immutable +public final class MarsAgentDetails { + /* + * The Mars agent Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The Mars agent name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The Mars agent Bios Id. + */ + @JsonProperty(value = "biosId", access = JsonProperty.Access.WRITE_ONLY) + private String biosId; + + /* + * The fabric object Id. + */ + @JsonProperty(value = "fabricObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricObjectId; + + /* + * The Mars agent Fqdn. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The last heartbeat received from the Mars agent. + */ + @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeatUtc; + + /* + * The health of the Mars agent. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth health; + + /* + * The health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /** Creates an instance of MarsAgentDetails class. */ + public MarsAgentDetails() { + } + + /** + * Get the id property: The Mars agent Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The Mars agent name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the biosId property: The Mars agent Bios Id. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Get the fabricObjectId property: The fabric object Id. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Get the fqdn property: The Mars agent Fqdn. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the lastHeartbeatUtc property: The last heartbeat received from the Mars agent. + * + * @return the lastHeartbeatUtc value. + */ + public OffsetDateTime lastHeartbeatUtc() { + return this.lastHeartbeatUtc; + } + + /** + * Get the health property: The health of the Mars agent. + * + * @return the health value. + */ + public ProtectionHealth health() { + return this.health; + } + + /** + * Get the healthErrors property: The health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MasterTargetServer.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MasterTargetServer.java new file mode 100644 index 000000000000..128d043f9303 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MasterTargetServer.java @@ -0,0 +1,512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of a Master Target Server. */ +@Fluent +public final class MasterTargetServer { + /* + * The server Id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The IP address of the server. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The server name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The OS type of the server. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The version of the scout component on the server. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * The last heartbeat received from the server. + */ + @JsonProperty(value = "lastHeartbeat") + private OffsetDateTime lastHeartbeat; + + /* + * Version status. + */ + @JsonProperty(value = "versionStatus") + private String versionStatus; + + /* + * The retention volumes of Master target Server. + */ + @JsonProperty(value = "retentionVolumes") + private List retentionVolumes; + + /* + * The list of data stores in the fabric. + */ + @JsonProperty(value = "dataStores") + private List dataStores; + + /* + * Validation errors. + */ + @JsonProperty(value = "validationErrors") + private List validationErrors; + + /* + * Health errors. + */ + @JsonProperty(value = "healthErrors") + private List healthErrors; + + /* + * Disk count of the master target. + */ + @JsonProperty(value = "diskCount") + private Integer diskCount; + + /* + * OS Version of the master target. + */ + @JsonProperty(value = "osVersion") + private String osVersion; + + /* + * Agent expiry date. + */ + @JsonProperty(value = "agentExpiryDate") + private OffsetDateTime agentExpiryDate; + + /* + * MARS agent version. + */ + @JsonProperty(value = "marsAgentVersion") + private String marsAgentVersion; + + /* + * MARS agent expiry date. + */ + @JsonProperty(value = "marsAgentExpiryDate") + private OffsetDateTime marsAgentExpiryDate; + + /* + * Agent version details. + */ + @JsonProperty(value = "agentVersionDetails") + private VersionDetails agentVersionDetails; + + /* + * Mars agent version details. + */ + @JsonProperty(value = "marsAgentVersionDetails") + private VersionDetails marsAgentVersionDetails; + + /** Creates an instance of MasterTargetServer class. */ + public MasterTargetServer() { + } + + /** + * Get the id property: The server Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The server Id. + * + * @param id the id value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withId(String id) { + this.id = id; + return this; + } + + /** + * Get the ipAddress property: The IP address of the server. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address of the server. + * + * @param ipAddress the ipAddress value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the name property: The server name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The server name. + * + * @param name the name value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the osType property: The OS type of the server. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type of the server. + * + * @param osType the osType value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the agentVersion property: The version of the scout component on the server. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The version of the scout component on the server. + * + * @param agentVersion the agentVersion value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the lastHeartbeat property: The last heartbeat received from the server. + * + * @return the lastHeartbeat value. + */ + public OffsetDateTime lastHeartbeat() { + return this.lastHeartbeat; + } + + /** + * Set the lastHeartbeat property: The last heartbeat received from the server. + * + * @param lastHeartbeat the lastHeartbeat value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withLastHeartbeat(OffsetDateTime lastHeartbeat) { + this.lastHeartbeat = lastHeartbeat; + return this; + } + + /** + * Get the versionStatus property: Version status. + * + * @return the versionStatus value. + */ + public String versionStatus() { + return this.versionStatus; + } + + /** + * Set the versionStatus property: Version status. + * + * @param versionStatus the versionStatus value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withVersionStatus(String versionStatus) { + this.versionStatus = versionStatus; + return this; + } + + /** + * Get the retentionVolumes property: The retention volumes of Master target Server. + * + * @return the retentionVolumes value. + */ + public List retentionVolumes() { + return this.retentionVolumes; + } + + /** + * Set the retentionVolumes property: The retention volumes of Master target Server. + * + * @param retentionVolumes the retentionVolumes value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withRetentionVolumes(List retentionVolumes) { + this.retentionVolumes = retentionVolumes; + return this; + } + + /** + * Get the dataStores property: The list of data stores in the fabric. + * + * @return the dataStores value. + */ + public List dataStores() { + return this.dataStores; + } + + /** + * Set the dataStores property: The list of data stores in the fabric. + * + * @param dataStores the dataStores value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withDataStores(List dataStores) { + this.dataStores = dataStores; + return this; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Set the validationErrors property: Validation errors. + * + * @param validationErrors the validationErrors value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withValidationErrors(List validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Get the healthErrors property: Health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Set the healthErrors property: Health errors. + * + * @param healthErrors the healthErrors value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withHealthErrors(List healthErrors) { + this.healthErrors = healthErrors; + return this; + } + + /** + * Get the diskCount property: Disk count of the master target. + * + * @return the diskCount value. + */ + public Integer diskCount() { + return this.diskCount; + } + + /** + * Set the diskCount property: Disk count of the master target. + * + * @param diskCount the diskCount value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withDiskCount(Integer diskCount) { + this.diskCount = diskCount; + return this; + } + + /** + * Get the osVersion property: OS Version of the master target. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Set the osVersion property: OS Version of the master target. + * + * @param osVersion the osVersion value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withOsVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get the agentExpiryDate property: Agent expiry date. + * + * @return the agentExpiryDate value. + */ + public OffsetDateTime agentExpiryDate() { + return this.agentExpiryDate; + } + + /** + * Set the agentExpiryDate property: Agent expiry date. + * + * @param agentExpiryDate the agentExpiryDate value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withAgentExpiryDate(OffsetDateTime agentExpiryDate) { + this.agentExpiryDate = agentExpiryDate; + return this; + } + + /** + * Get the marsAgentVersion property: MARS agent version. + * + * @return the marsAgentVersion value. + */ + public String marsAgentVersion() { + return this.marsAgentVersion; + } + + /** + * Set the marsAgentVersion property: MARS agent version. + * + * @param marsAgentVersion the marsAgentVersion value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withMarsAgentVersion(String marsAgentVersion) { + this.marsAgentVersion = marsAgentVersion; + return this; + } + + /** + * Get the marsAgentExpiryDate property: MARS agent expiry date. + * + * @return the marsAgentExpiryDate value. + */ + public OffsetDateTime marsAgentExpiryDate() { + return this.marsAgentExpiryDate; + } + + /** + * Set the marsAgentExpiryDate property: MARS agent expiry date. + * + * @param marsAgentExpiryDate the marsAgentExpiryDate value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withMarsAgentExpiryDate(OffsetDateTime marsAgentExpiryDate) { + this.marsAgentExpiryDate = marsAgentExpiryDate; + return this; + } + + /** + * Get the agentVersionDetails property: Agent version details. + * + * @return the agentVersionDetails value. + */ + public VersionDetails agentVersionDetails() { + return this.agentVersionDetails; + } + + /** + * Set the agentVersionDetails property: Agent version details. + * + * @param agentVersionDetails the agentVersionDetails value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withAgentVersionDetails(VersionDetails agentVersionDetails) { + this.agentVersionDetails = agentVersionDetails; + return this; + } + + /** + * Get the marsAgentVersionDetails property: Mars agent version details. + * + * @return the marsAgentVersionDetails value. + */ + public VersionDetails marsAgentVersionDetails() { + return this.marsAgentVersionDetails; + } + + /** + * Set the marsAgentVersionDetails property: Mars agent version details. + * + * @param marsAgentVersionDetails the marsAgentVersionDetails value to set. + * @return the MasterTargetServer object itself. + */ + public MasterTargetServer withMarsAgentVersionDetails(VersionDetails marsAgentVersionDetails) { + this.marsAgentVersionDetails = marsAgentVersionDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retentionVolumes() != null) { + retentionVolumes().forEach(e -> e.validate()); + } + if (dataStores() != null) { + dataStores().forEach(e -> e.validate()); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + if (agentVersionDetails() != null) { + agentVersionDetails().validate(); + } + if (marsAgentVersionDetails() != null) { + marsAgentVersionDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInput.java new file mode 100644 index 000000000000..04fea7186c7e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInput.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for migrate. */ +@Fluent +public final class MigrateInput { + /* + * Migrate input properties. + */ + @JsonProperty(value = "properties", required = true) + private MigrateInputProperties properties; + + /** Creates an instance of MigrateInput class. */ + public MigrateInput() { + } + + /** + * Get the properties property: Migrate input properties. + * + * @return the properties value. + */ + public MigrateInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Migrate input properties. + * + * @param properties the properties value to set. + * @return the MigrateInput object itself. + */ + public MigrateInput withProperties(MigrateInputProperties 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 MigrateInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInputProperties.java new file mode 100644 index 000000000000..0444e44c535b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Migrate input properties. */ +@Fluent +public final class MigrateInputProperties { + /* + * The provider specific details. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private MigrateProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of MigrateInputProperties class. */ + public MigrateInputProperties() { + } + + /** + * Get the providerSpecificDetails property: The provider specific details. + * + * @return the providerSpecificDetails value. + */ + public MigrateProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific details. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the MigrateInputProperties object itself. + */ + public MigrateInputProperties withProviderSpecificDetails(MigrateProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerSpecificDetails in model MigrateInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateProviderSpecificInput.java new file mode 100644 index 000000000000..b0b73c80f001 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Migrate provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = MigrateProviderSpecificInput.class) +@JsonTypeName("MigrateProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtMigrateInput.class)}) +@Immutable +public class MigrateProviderSpecificInput { + /** Creates an instance of MigrateProviderSpecificInput class. */ + public MigrateProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItem.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItem.java new file mode 100644 index 000000000000..6686535b493b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItem.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationItemInner; + +/** An immutable client-side representation of MigrationItem. */ +public interface MigrationItem { + /** + * 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: The migration item properties. + * + * @return the properties value. + */ + MigrationItemProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * 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.recoveryservicessiterecovery.fluent.models.MigrationItemInner object. + * + * @return the inner object. + */ + MigrationItemInner innerModel(); + + /** The entirety of the MigrationItem definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The MigrationItem definition stages. */ + interface DefinitionStages { + /** The first stage of the MigrationItem definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the MigrationItem definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName, fabricName, protectionContainerName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @return the next definition stage. + */ + WithProperties withExistingReplicationProtectionContainer( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + } + /** The stage of the MigrationItem definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Enable migration input properties.. + * + * @param properties Enable migration input properties. + * @return the next definition stage. + */ + WithCreate withProperties(EnableMigrationInputProperties properties); + } + /** + * The stage of the MigrationItem 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. + */ + MigrationItem create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MigrationItem create(Context context); + } + } + /** + * Begins update for the MigrationItem resource. + * + * @return the stage of resource update. + */ + MigrationItem.Update update(); + + /** The template for MigrationItem update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MigrationItem apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MigrationItem apply(Context context); + } + /** The MigrationItem update stages. */ + interface UpdateStages { + /** The stage of the MigrationItem update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Update migration item input properties.. + * + * @param properties Update migration item input properties. + * @return the next definition stage. + */ + Update withProperties(UpdateMigrationItemInputProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MigrationItem refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MigrationItem refresh(Context context); + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param migrateInput Migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem migrate(MigrateInput migrateInput); + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param migrateInput Migrate input. + * @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 migration item. + */ + MigrationItem migrate(MigrateInput migrateInput, Context context); + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param pauseReplicationInput Pause replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem pauseReplication(PauseReplicationInput pauseReplicationInput); + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param pauseReplicationInput Pause replication input. + * @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 migration item. + */ + MigrationItem pauseReplication(PauseReplicationInput pauseReplicationInput, Context context); + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resumeReplicationInput Resume replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem resumeReplication(ResumeReplicationInput resumeReplicationInput); + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resumeReplicationInput Resume replication input. + * @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 migration item. + */ + MigrationItem resumeReplication(ResumeReplicationInput resumeReplicationInput, Context context); + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param input Resync input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem resync(ResyncInput input); + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param input Resync input. + * @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 migration item. + */ + MigrationItem resync(ResyncInput input, Context context); + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param testMigrateInput Test migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem testMigrate(TestMigrateInput testMigrateInput); + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param testMigrateInput Test migrate input. + * @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 migration item. + */ + MigrationItem testMigrate(TestMigrateInput testMigrateInput, Context context); + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param testMigrateCleanupInput Test migrate cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem testMigrateCleanup(TestMigrateCleanupInput testMigrateCleanupInput); + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param testMigrateCleanupInput Test migrate cleanup input. + * @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 migration item. + */ + MigrationItem testMigrateCleanup(TestMigrateCleanupInput testMigrateCleanupInput, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemCollection.java new file mode 100644 index 000000000000..9d22dc874ac3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationItemInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Migration item collection. */ +@Fluent +public final class MigrationItemCollection { + /* + * The list of migration items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of MigrationItemCollection class. */ + public MigrationItemCollection() { + } + + /** + * Get the value property: The list of migration items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of migration items. + * + * @param value the value value to set. + * @return the MigrationItemCollection object itself. + */ + public MigrationItemCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the MigrationItemCollection object itself. + */ + public MigrationItemCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemOperation.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemOperation.java new file mode 100644 index 000000000000..ccfc6c19221e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemOperation.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationItemOperation. */ +public final class MigrationItemOperation extends ExpandableStringEnum { + /** Static value DisableMigration for MigrationItemOperation. */ + public static final MigrationItemOperation DISABLE_MIGRATION = fromString("DisableMigration"); + + /** Static value TestMigrate for MigrationItemOperation. */ + public static final MigrationItemOperation TEST_MIGRATE = fromString("TestMigrate"); + + /** Static value TestMigrateCleanup for MigrationItemOperation. */ + public static final MigrationItemOperation TEST_MIGRATE_CLEANUP = fromString("TestMigrateCleanup"); + + /** Static value Migrate for MigrationItemOperation. */ + public static final MigrationItemOperation MIGRATE = fromString("Migrate"); + + /** Static value StartResync for MigrationItemOperation. */ + public static final MigrationItemOperation START_RESYNC = fromString("StartResync"); + + /** Static value PauseReplication for MigrationItemOperation. */ + public static final MigrationItemOperation PAUSE_REPLICATION = fromString("PauseReplication"); + + /** Static value ResumeReplication for MigrationItemOperation. */ + public static final MigrationItemOperation RESUME_REPLICATION = fromString("ResumeReplication"); + + /** + * Creates or finds a MigrationItemOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationItemOperation. + */ + @JsonCreator + public static MigrationItemOperation fromString(String name) { + return fromString(name, MigrationItemOperation.class); + } + + /** + * Gets known MigrationItemOperation values. + * + * @return known MigrationItemOperation values. + */ + public static Collection values() { + return values(MigrationItemOperation.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemProperties.java new file mode 100644 index 000000000000..f1dcdc401f04 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemProperties.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Migration item properties. */ +@Fluent +public final class MigrationItemProperties { + /* + * The on-premise virtual machine name. + */ + @JsonProperty(value = "machineName", access = JsonProperty.Access.WRITE_ONLY) + private String machineName; + + /* + * The ARM Id of policy governing this item. + */ + @JsonProperty(value = "policyId", access = JsonProperty.Access.WRITE_ONLY) + private String policyId; + + /* + * The name of policy governing this item. + */ + @JsonProperty(value = "policyFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String policyFriendlyName; + + /* + * The recovery services provider ARM Id. + */ + @JsonProperty(value = "recoveryServicesProviderId", access = JsonProperty.Access.WRITE_ONLY) + private String recoveryServicesProviderId; + + /* + * The replication status. + */ + @JsonProperty(value = "replicationStatus", access = JsonProperty.Access.WRITE_ONLY) + private String replicationStatus; + + /* + * The migration status. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState migrationState; + + /* + * The migration state description. + */ + @JsonProperty(value = "migrationStateDescription", access = JsonProperty.Access.WRITE_ONLY) + private String migrationStateDescription; + + /* + * The last test migration time. + */ + @JsonProperty(value = "lastTestMigrationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastTestMigrationTime; + + /* + * The status of the last test migration. + */ + @JsonProperty(value = "lastTestMigrationStatus", access = JsonProperty.Access.WRITE_ONLY) + private String lastTestMigrationStatus; + + /* + * The last migration time. + */ + @JsonProperty(value = "lastMigrationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastMigrationTime; + + /* + * The status of the last migration. + */ + @JsonProperty(value = "lastMigrationStatus", access = JsonProperty.Access.WRITE_ONLY) + private String lastMigrationStatus; + + /* + * The test migrate state. + */ + @JsonProperty(value = "testMigrateState", access = JsonProperty.Access.WRITE_ONLY) + private TestMigrationState testMigrateState; + + /* + * The test migrate state description. + */ + @JsonProperty(value = "testMigrateStateDescription", access = JsonProperty.Access.WRITE_ONLY) + private String testMigrateStateDescription; + + /* + * The consolidated health. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth health; + + /* + * The list of health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /* + * The allowed operations on the migration item based on the current migration state of the item. + */ + @JsonProperty(value = "allowedOperations", access = JsonProperty.Access.WRITE_ONLY) + private List allowedOperations; + + /* + * The current job details. + */ + @JsonProperty(value = "currentJob", access = JsonProperty.Access.WRITE_ONLY) + private CurrentJobDetails currentJob; + + /* + * The critical past job details. + */ + @JsonProperty(value = "criticalJobHistory", access = JsonProperty.Access.WRITE_ONLY) + private List criticalJobHistory; + + /* + * The correlation Id for events associated with this migration item. + */ + @JsonProperty(value = "eventCorrelationId", access = JsonProperty.Access.WRITE_ONLY) + private String eventCorrelationId; + + /* + * The migration provider custom settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private MigrationProviderSpecificSettings providerSpecificDetails; + + /** Creates an instance of MigrationItemProperties class. */ + public MigrationItemProperties() { + } + + /** + * Get the machineName property: The on-premise virtual machine name. + * + * @return the machineName value. + */ + public String machineName() { + return this.machineName; + } + + /** + * Get the policyId property: The ARM Id of policy governing this item. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Get the policyFriendlyName property: The name of policy governing this item. + * + * @return the policyFriendlyName value. + */ + public String policyFriendlyName() { + return this.policyFriendlyName; + } + + /** + * Get the recoveryServicesProviderId property: The recovery services provider ARM Id. + * + * @return the recoveryServicesProviderId value. + */ + public String recoveryServicesProviderId() { + return this.recoveryServicesProviderId; + } + + /** + * Get the replicationStatus property: The replication status. + * + * @return the replicationStatus value. + */ + public String replicationStatus() { + return this.replicationStatus; + } + + /** + * Get the migrationState property: The migration status. + * + * @return the migrationState value. + */ + public MigrationState migrationState() { + return this.migrationState; + } + + /** + * Get the migrationStateDescription property: The migration state description. + * + * @return the migrationStateDescription value. + */ + public String migrationStateDescription() { + return this.migrationStateDescription; + } + + /** + * Get the lastTestMigrationTime property: The last test migration time. + * + * @return the lastTestMigrationTime value. + */ + public OffsetDateTime lastTestMigrationTime() { + return this.lastTestMigrationTime; + } + + /** + * Get the lastTestMigrationStatus property: The status of the last test migration. + * + * @return the lastTestMigrationStatus value. + */ + public String lastTestMigrationStatus() { + return this.lastTestMigrationStatus; + } + + /** + * Get the lastMigrationTime property: The last migration time. + * + * @return the lastMigrationTime value. + */ + public OffsetDateTime lastMigrationTime() { + return this.lastMigrationTime; + } + + /** + * Get the lastMigrationStatus property: The status of the last migration. + * + * @return the lastMigrationStatus value. + */ + public String lastMigrationStatus() { + return this.lastMigrationStatus; + } + + /** + * Get the testMigrateState property: The test migrate state. + * + * @return the testMigrateState value. + */ + public TestMigrationState testMigrateState() { + return this.testMigrateState; + } + + /** + * Get the testMigrateStateDescription property: The test migrate state description. + * + * @return the testMigrateStateDescription value. + */ + public String testMigrateStateDescription() { + return this.testMigrateStateDescription; + } + + /** + * Get the health property: The consolidated health. + * + * @return the health value. + */ + public ProtectionHealth health() { + return this.health; + } + + /** + * Get the healthErrors property: The list of health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Get the allowedOperations property: The allowed operations on the migration item based on the current migration + * state of the item. + * + * @return the allowedOperations value. + */ + public List allowedOperations() { + return this.allowedOperations; + } + + /** + * Get the currentJob property: The current job details. + * + * @return the currentJob value. + */ + public CurrentJobDetails currentJob() { + return this.currentJob; + } + + /** + * Get the criticalJobHistory property: The critical past job details. + * + * @return the criticalJobHistory value. + */ + public List criticalJobHistory() { + return this.criticalJobHistory; + } + + /** + * Get the eventCorrelationId property: The correlation Id for events associated with this migration item. + * + * @return the eventCorrelationId value. + */ + public String eventCorrelationId() { + return this.eventCorrelationId; + } + + /** + * Get the providerSpecificDetails property: The migration provider custom settings. + * + * @return the providerSpecificDetails value. + */ + public MigrationProviderSpecificSettings providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The migration provider custom settings. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the MigrationItemProperties object itself. + */ + public MigrationItemProperties withProviderSpecificDetails( + MigrationProviderSpecificSettings providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + 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 (currentJob() != null) { + currentJob().validate(); + } + if (criticalJobHistory() != null) { + criticalJobHistory().forEach(e -> e.validate()); + } + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationProviderSpecificSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationProviderSpecificSettings.java new file mode 100644 index 000000000000..3258294b4cf5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationProviderSpecificSettings.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.recoveryservicessiterecovery.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; + +/** Migration provider specific settings. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = MigrationProviderSpecificSettings.class) +@JsonTypeName("MigrationProviderSpecificSettings") +@JsonSubTypes({@JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtMigrationDetails.class)}) +@Immutable +public class MigrationProviderSpecificSettings { + /** Creates an instance of MigrationProviderSpecificSettings class. */ + public MigrationProviderSpecificSettings() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPoint.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPoint.java new file mode 100644 index 000000000000..0a4509ef0a51 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPoint.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner; + +/** An immutable client-side representation of MigrationRecoveryPoint. */ +public interface MigrationRecoveryPoint { + /** + * 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: Recovery point properties. + * + * @return the properties value. + */ + MigrationRecoveryPointProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner + * object. + * + * @return the inner object. + */ + MigrationRecoveryPointInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointCollection.java new file mode 100644 index 000000000000..a968419c7b30 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of migration recovery points. */ +@Fluent +public final class MigrationRecoveryPointCollection { + /* + * The migration recovery point details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of MigrationRecoveryPointCollection class. */ + public MigrationRecoveryPointCollection() { + } + + /** + * Get the value property: The migration recovery point details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The migration recovery point details. + * + * @param value the value value to set. + * @return the MigrationRecoveryPointCollection object itself. + */ + public MigrationRecoveryPointCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the MigrationRecoveryPointCollection object itself. + */ + public MigrationRecoveryPointCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointProperties.java new file mode 100644 index 000000000000..ba45bd950869 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Migration item recovery point properties. */ +@Immutable +public final class MigrationRecoveryPointProperties { + /* + * The recovery point time. + */ + @JsonProperty(value = "recoveryPointTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime recoveryPointTime; + + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType", access = JsonProperty.Access.WRITE_ONLY) + private MigrationRecoveryPointType recoveryPointType; + + /** Creates an instance of MigrationRecoveryPointProperties class. */ + public MigrationRecoveryPointProperties() { + } + + /** + * Get the recoveryPointTime property: The recovery point time. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Get the recoveryPointType property: The recovery point type. + * + * @return the recoveryPointType value. + */ + public MigrationRecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointType.java new file mode 100644 index 000000000000..368f24dba91f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recovery point type. */ +public final class MigrationRecoveryPointType extends ExpandableStringEnum { + /** Static value NotSpecified for MigrationRecoveryPointType. */ + public static final MigrationRecoveryPointType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value ApplicationConsistent for MigrationRecoveryPointType. */ + public static final MigrationRecoveryPointType APPLICATION_CONSISTENT = fromString("ApplicationConsistent"); + + /** Static value CrashConsistent for MigrationRecoveryPointType. */ + public static final MigrationRecoveryPointType CRASH_CONSISTENT = fromString("CrashConsistent"); + + /** + * Creates or finds a MigrationRecoveryPointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationRecoveryPointType. + */ + @JsonCreator + public static MigrationRecoveryPointType fromString(String name) { + return fromString(name, MigrationRecoveryPointType.class); + } + + /** + * Gets known MigrationRecoveryPointType values. + * + * @return known MigrationRecoveryPointType values. + */ + public static Collection values() { + return values(MigrationRecoveryPointType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPoints.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPoints.java new file mode 100644 index 000000000000..9f507ee9542b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPoints.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.recoveryservicessiterecovery.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 MigrationRecoveryPoints. */ +public interface MigrationRecoveryPoints { + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationMigrationItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName); + + /** + * Gets the recovery points for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 recovery points for a migration item as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationMigrationItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context); + + /** + * Gets a recovery point for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrationRecoveryPointName The migration 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 a recovery point for a migration item along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName, + Context context); + + /** + * Gets a recovery point for a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrationRecoveryPointName The migration 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 a recovery point for a migration item. + */ + MigrationRecoveryPoint get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationState.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationState.java new file mode 100644 index 000000000000..940100c50c2e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationState.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The migration status. */ +public final class MigrationState extends ExpandableStringEnum { + /** Static value None for MigrationState. */ + public static final MigrationState NONE = fromString("None"); + + /** Static value EnableMigrationInProgress for MigrationState. */ + public static final MigrationState ENABLE_MIGRATION_IN_PROGRESS = fromString("EnableMigrationInProgress"); + + /** Static value EnableMigrationFailed for MigrationState. */ + public static final MigrationState ENABLE_MIGRATION_FAILED = fromString("EnableMigrationFailed"); + + /** Static value DisableMigrationInProgress for MigrationState. */ + public static final MigrationState DISABLE_MIGRATION_IN_PROGRESS = fromString("DisableMigrationInProgress"); + + /** Static value DisableMigrationFailed for MigrationState. */ + public static final MigrationState DISABLE_MIGRATION_FAILED = fromString("DisableMigrationFailed"); + + /** Static value InitialSeedingInProgress for MigrationState. */ + public static final MigrationState INITIAL_SEEDING_IN_PROGRESS = fromString("InitialSeedingInProgress"); + + /** Static value InitialSeedingFailed for MigrationState. */ + public static final MigrationState INITIAL_SEEDING_FAILED = fromString("InitialSeedingFailed"); + + /** Static value Replicating for MigrationState. */ + public static final MigrationState REPLICATING = fromString("Replicating"); + + /** Static value MigrationInProgress for MigrationState. */ + public static final MigrationState MIGRATION_IN_PROGRESS = fromString("MigrationInProgress"); + + /** Static value MigrationSucceeded for MigrationState. */ + public static final MigrationState MIGRATION_SUCCEEDED = fromString("MigrationSucceeded"); + + /** Static value MigrationFailed for MigrationState. */ + public static final MigrationState MIGRATION_FAILED = fromString("MigrationFailed"); + + /** Static value ResumeInProgress for MigrationState. */ + public static final MigrationState RESUME_IN_PROGRESS = fromString("ResumeInProgress"); + + /** Static value ResumeInitiated for MigrationState. */ + public static final MigrationState RESUME_INITIATED = fromString("ResumeInitiated"); + + /** Static value SuspendingProtection for MigrationState. */ + public static final MigrationState SUSPENDING_PROTECTION = fromString("SuspendingProtection"); + + /** Static value ProtectionSuspended for MigrationState. */ + public static final MigrationState PROTECTION_SUSPENDED = fromString("ProtectionSuspended"); + + /** Static value MigrationCompletedWithInformation for MigrationState. */ + public static final MigrationState MIGRATION_COMPLETED_WITH_INFORMATION = + fromString("MigrationCompletedWithInformation"); + + /** Static value MigrationPartiallySucceeded for MigrationState. */ + public static final MigrationState MIGRATION_PARTIALLY_SUCCEEDED = fromString("MigrationPartiallySucceeded"); + + /** + * Creates or finds a MigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationState. + */ + @JsonCreator + public static MigrationState fromString(String name) { + return fromString(name, MigrationState.class); + } + + /** + * Gets known MigrationState values. + * + * @return known MigrationState values. + */ + public static Collection values() { + return values(MigrationState.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MobilityAgentUpgradeState.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MobilityAgentUpgradeState.java new file mode 100644 index 000000000000..c33ceca6a350 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MobilityAgentUpgradeState.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The agent auto upgrade state. */ +public final class MobilityAgentUpgradeState extends ExpandableStringEnum { + /** Static value None for MobilityAgentUpgradeState. */ + public static final MobilityAgentUpgradeState NONE = fromString("None"); + + /** Static value Started for MobilityAgentUpgradeState. */ + public static final MobilityAgentUpgradeState STARTED = fromString("Started"); + + /** Static value Completed for MobilityAgentUpgradeState. */ + public static final MobilityAgentUpgradeState COMPLETED = fromString("Completed"); + + /** Static value Commit for MobilityAgentUpgradeState. */ + public static final MobilityAgentUpgradeState COMMIT = fromString("Commit"); + + /** + * Creates or finds a MobilityAgentUpgradeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MobilityAgentUpgradeState. + */ + @JsonCreator + public static MobilityAgentUpgradeState fromString(String name) { + return fromString(name, MobilityAgentUpgradeState.class); + } + + /** + * Gets known MobilityAgentUpgradeState values. + * + * @return known MobilityAgentUpgradeState values. + */ + public static Collection values() { + return values(MobilityAgentUpgradeState.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MobilityServiceUpdate.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MobilityServiceUpdate.java new file mode 100644 index 000000000000..e9b2bd5504f7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MobilityServiceUpdate.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Mobility Service update details. */ +@Fluent +public final class MobilityServiceUpdate { + /* + * The version of the latest update. + */ + @JsonProperty(value = "version") + private String version; + + /* + * The reboot status of the update - whether it is required or not. + */ + @JsonProperty(value = "rebootStatus") + private String rebootStatus; + + /* + * The OS type. + */ + @JsonProperty(value = "osType") + private String osType; + + /** Creates an instance of MobilityServiceUpdate class. */ + public MobilityServiceUpdate() { + } + + /** + * Get the version property: The version of the latest update. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the latest update. + * + * @param version the version value to set. + * @return the MobilityServiceUpdate object itself. + */ + public MobilityServiceUpdate withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the rebootStatus property: The reboot status of the update - whether it is required or not. + * + * @return the rebootStatus value. + */ + public String rebootStatus() { + return this.rebootStatus; + } + + /** + * Set the rebootStatus property: The reboot status of the update - whether it is required or not. + * + * @param rebootStatus the rebootStatus value to set. + * @return the MobilityServiceUpdate object itself. + */ + public MobilityServiceUpdate withRebootStatus(String rebootStatus) { + this.rebootStatus = rebootStatus; + return this; + } + + /** + * Get the osType property: The OS type. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type. + * + * @param osType the osType value to set. + * @return the MobilityServiceUpdate object itself. + */ + public MobilityServiceUpdate withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmGroupCreateOption.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmGroupCreateOption.java new file mode 100644 index 000000000000..3d5acad2d201 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmGroupCreateOption.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether Multi VM group is auto created or specified by user. */ +public final class MultiVmGroupCreateOption extends ExpandableStringEnum { + /** Static value AutoCreated for MultiVmGroupCreateOption. */ + public static final MultiVmGroupCreateOption AUTO_CREATED = fromString("AutoCreated"); + + /** Static value UserSpecified for MultiVmGroupCreateOption. */ + public static final MultiVmGroupCreateOption USER_SPECIFIED = fromString("UserSpecified"); + + /** + * Creates or finds a MultiVmGroupCreateOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding MultiVmGroupCreateOption. + */ + @JsonCreator + public static MultiVmGroupCreateOption fromString(String name) { + return fromString(name, MultiVmGroupCreateOption.class); + } + + /** + * Gets known MultiVmGroupCreateOption values. + * + * @return known MultiVmGroupCreateOption values. + */ + public static Collection values() { + return values(MultiVmGroupCreateOption.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmSyncPointOption.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmSyncPointOption.java new file mode 100644 index 000000000000..b62d27bf8502 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmSyncPointOption.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. */ +public final class MultiVmSyncPointOption extends ExpandableStringEnum { + /** Static value UseMultiVmSyncRecoveryPoint for MultiVmSyncPointOption. */ + public static final MultiVmSyncPointOption USE_MULTI_VM_SYNC_RECOVERY_POINT = + fromString("UseMultiVmSyncRecoveryPoint"); + + /** Static value UsePerVmRecoveryPoint for MultiVmSyncPointOption. */ + public static final MultiVmSyncPointOption USE_PER_VM_RECOVERY_POINT = fromString("UsePerVmRecoveryPoint"); + + /** + * Creates or finds a MultiVmSyncPointOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding MultiVmSyncPointOption. + */ + @JsonCreator + public static MultiVmSyncPointOption fromString(String name) { + return fromString(name, MultiVmSyncPointOption.class); + } + + /** + * Gets known MultiVmSyncPointOption values. + * + * @return known MultiVmSyncPointOption values. + */ + public static Collection values() { + return values(MultiVmSyncPointOption.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Network.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Network.java new file mode 100644 index 000000000000..ba17c5faa69b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Network.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkInner; + +/** An immutable client-side representation of Network. */ +public interface Network { + /** + * 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: The Network Properties. + * + * @return the properties value. + */ + NetworkProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkInner object. + * + * @return the inner object. + */ + NetworkInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkCollection.java new file mode 100644 index 000000000000..13772349e26b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of networks. */ +@Fluent +public final class NetworkCollection { + /* + * The Networks list details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkCollection class. */ + public NetworkCollection() { + } + + /** + * Get the value property: The Networks list details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Networks list details. + * + * @param value the value value to set. + * @return the NetworkCollection object itself. + */ + public NetworkCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the NetworkCollection object itself. + */ + public NetworkCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMapping.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMapping.java new file mode 100644 index 000000000000..7780908240da --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMapping.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkMappingInner; + +/** An immutable client-side representation of NetworkMapping. */ +public interface NetworkMapping { + /** + * 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: The Network Mapping Properties. + * + * @return the properties value. + */ + NetworkMappingProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * 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.recoveryservicessiterecovery.fluent.models.NetworkMappingInner object. + * + * @return the inner object. + */ + NetworkMappingInner innerModel(); + + /** The entirety of the NetworkMapping definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The NetworkMapping definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkMapping definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the NetworkMapping definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName, fabricName, networkName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @return the next definition stage. + */ + WithProperties withExistingReplicationNetwork( + String resourceName, String resourceGroupName, String fabricName, String networkName); + } + /** The stage of the NetworkMapping definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Input properties for creating network mapping.. + * + * @param properties Input properties for creating network mapping. + * @return the next definition stage. + */ + WithCreate withProperties(CreateNetworkMappingInputProperties properties); + } + /** + * The stage of the NetworkMapping 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. + */ + NetworkMapping create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkMapping create(Context context); + } + } + /** + * Begins update for the NetworkMapping resource. + * + * @return the stage of resource update. + */ + NetworkMapping.Update update(); + + /** The template for NetworkMapping update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkMapping apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkMapping apply(Context context); + } + /** The NetworkMapping update stages. */ + interface UpdateStages { + /** The stage of the NetworkMapping update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The input properties needed to update network mapping.. + * + * @param properties The input properties needed to update network mapping. + * @return the next definition stage. + */ + Update withProperties(UpdateNetworkMappingInputProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkMapping refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkMapping refresh(Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingCollection.java new file mode 100644 index 000000000000..cbcbdb578320 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingCollection.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkMappingInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of network mappings. As with NetworkMapping, it should be possible to reuse a prev version of this class. It + * doesn't seem likely this class could be anything more than a slightly bespoke collection of NetworkMapping. Hence it + * makes sense to override Load with Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. + */ +@Fluent +public final class NetworkMappingCollection { + /* + * The Network Mappings list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkMappingCollection class. */ + public NetworkMappingCollection() { + } + + /** + * Get the value property: The Network Mappings list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Network Mappings list. + * + * @param value the value value to set. + * @return the NetworkMappingCollection object itself. + */ + public NetworkMappingCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the NetworkMappingCollection object itself. + */ + public NetworkMappingCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingFabricSpecificSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingFabricSpecificSettings.java new file mode 100644 index 000000000000..a1f2320600d8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingFabricSpecificSettings.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.recoveryservicessiterecovery.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; + +/** Network Mapping fabric specific settings. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = NetworkMappingFabricSpecificSettings.class) +@JsonTypeName("NetworkMappingFabricSpecificSettings") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureToAzure", value = AzureToAzureNetworkMappingSettings.class), + @JsonSubTypes.Type(name = "VmmToAzure", value = VmmToAzureNetworkMappingSettings.class), + @JsonSubTypes.Type(name = "VmmToVmm", value = VmmToVmmNetworkMappingSettings.class) +}) +@Immutable +public class NetworkMappingFabricSpecificSettings { + /** Creates an instance of NetworkMappingFabricSpecificSettings class. */ + public NetworkMappingFabricSpecificSettings() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingProperties.java new file mode 100644 index 000000000000..b13a8925d277 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMappingProperties.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Mapping Properties. */ +@Fluent +public final class NetworkMappingProperties { + /* + * The pairing state for network mapping. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The primary network friendly name. + */ + @JsonProperty(value = "primaryNetworkFriendlyName") + private String primaryNetworkFriendlyName; + + /* + * The primary network id for network mapping. + */ + @JsonProperty(value = "primaryNetworkId") + private String primaryNetworkId; + + /* + * The primary fabric friendly name. + */ + @JsonProperty(value = "primaryFabricFriendlyName") + private String primaryFabricFriendlyName; + + /* + * The recovery network friendly name. + */ + @JsonProperty(value = "recoveryNetworkFriendlyName") + private String recoveryNetworkFriendlyName; + + /* + * The recovery network id for network mapping. + */ + @JsonProperty(value = "recoveryNetworkId") + private String recoveryNetworkId; + + /* + * The recovery fabric ARM id. + */ + @JsonProperty(value = "recoveryFabricArmId") + private String recoveryFabricArmId; + + /* + * The recovery fabric friendly name. + */ + @JsonProperty(value = "recoveryFabricFriendlyName") + private String recoveryFabricFriendlyName; + + /* + * The fabric specific settings. + */ + @JsonProperty(value = "fabricSpecificSettings") + private NetworkMappingFabricSpecificSettings fabricSpecificSettings; + + /** Creates an instance of NetworkMappingProperties class. */ + public NetworkMappingProperties() { + } + + /** + * Get the state property: The pairing state for network mapping. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The pairing state for network mapping. + * + * @param state the state value to set. + * @return the NetworkMappingProperties object itself. + */ + public NetworkMappingProperties withState(String state) { + this.state = state; + return this; + } + + /** + * Get the primaryNetworkFriendlyName property: The primary network friendly name. + * + * @return the primaryNetworkFriendlyName value. + */ + public String primaryNetworkFriendlyName() { + return this.primaryNetworkFriendlyName; + } + + /** + * Set the primaryNetworkFriendlyName property: The primary network friendly name. + * + * @param primaryNetworkFriendlyName the primaryNetworkFriendlyName value to set. + * @return the NetworkMappingProperties object itself. + */ + public NetworkMappingProperties withPrimaryNetworkFriendlyName(String primaryNetworkFriendlyName) { + this.primaryNetworkFriendlyName = primaryNetworkFriendlyName; + return this; + } + + /** + * Get the primaryNetworkId property: The primary network id for network mapping. + * + * @return the primaryNetworkId value. + */ + public String primaryNetworkId() { + return this.primaryNetworkId; + } + + /** + * Set the primaryNetworkId property: The primary network id for network mapping. + * + * @param primaryNetworkId the primaryNetworkId value to set. + * @return the NetworkMappingProperties object itself. + */ + public NetworkMappingProperties withPrimaryNetworkId(String primaryNetworkId) { + this.primaryNetworkId = primaryNetworkId; + return this; + } + + /** + * Get the primaryFabricFriendlyName property: The primary fabric friendly name. + * + * @return the primaryFabricFriendlyName value. + */ + public String primaryFabricFriendlyName() { + return this.primaryFabricFriendlyName; + } + + /** + * Set the primaryFabricFriendlyName property: The primary fabric friendly name. + * + * @param primaryFabricFriendlyName the primaryFabricFriendlyName value to set. + * @return the NetworkMappingProperties object itself. + */ + public NetworkMappingProperties withPrimaryFabricFriendlyName(String primaryFabricFriendlyName) { + this.primaryFabricFriendlyName = primaryFabricFriendlyName; + return this; + } + + /** + * Get the recoveryNetworkFriendlyName property: The recovery network friendly name. + * + * @return the recoveryNetworkFriendlyName value. + */ + public String recoveryNetworkFriendlyName() { + return this.recoveryNetworkFriendlyName; + } + + /** + * Set the recoveryNetworkFriendlyName property: The recovery network friendly name. + * + * @param recoveryNetworkFriendlyName the recoveryNetworkFriendlyName value to set. + * @return the NetworkMappingProperties object itself. + */ + public NetworkMappingProperties withRecoveryNetworkFriendlyName(String recoveryNetworkFriendlyName) { + this.recoveryNetworkFriendlyName = recoveryNetworkFriendlyName; + return this; + } + + /** + * Get the recoveryNetworkId property: The recovery network id for network mapping. + * + * @return the recoveryNetworkId value. + */ + public String recoveryNetworkId() { + return this.recoveryNetworkId; + } + + /** + * Set the recoveryNetworkId property: The recovery network id for network mapping. + * + * @param recoveryNetworkId the recoveryNetworkId value to set. + * @return the NetworkMappingProperties object itself. + */ + public NetworkMappingProperties withRecoveryNetworkId(String recoveryNetworkId) { + this.recoveryNetworkId = recoveryNetworkId; + return this; + } + + /** + * Get the recoveryFabricArmId property: The recovery fabric ARM id. + * + * @return the recoveryFabricArmId value. + */ + public String recoveryFabricArmId() { + return this.recoveryFabricArmId; + } + + /** + * Set the recoveryFabricArmId property: The recovery fabric ARM id. + * + * @param recoveryFabricArmId the recoveryFabricArmId value to set. + * @return the NetworkMappingProperties object itself. + */ + public NetworkMappingProperties withRecoveryFabricArmId(String recoveryFabricArmId) { + this.recoveryFabricArmId = recoveryFabricArmId; + return this; + } + + /** + * Get the recoveryFabricFriendlyName property: The recovery fabric friendly name. + * + * @return the recoveryFabricFriendlyName value. + */ + public String recoveryFabricFriendlyName() { + return this.recoveryFabricFriendlyName; + } + + /** + * Set the recoveryFabricFriendlyName property: The recovery fabric friendly name. + * + * @param recoveryFabricFriendlyName the recoveryFabricFriendlyName value to set. + * @return the NetworkMappingProperties object itself. + */ + public NetworkMappingProperties withRecoveryFabricFriendlyName(String recoveryFabricFriendlyName) { + this.recoveryFabricFriendlyName = recoveryFabricFriendlyName; + return this; + } + + /** + * Get the fabricSpecificSettings property: The fabric specific settings. + * + * @return the fabricSpecificSettings value. + */ + public NetworkMappingFabricSpecificSettings fabricSpecificSettings() { + return this.fabricSpecificSettings; + } + + /** + * Set the fabricSpecificSettings property: The fabric specific settings. + * + * @param fabricSpecificSettings the fabricSpecificSettings value to set. + * @return the NetworkMappingProperties object itself. + */ + public NetworkMappingProperties withFabricSpecificSettings( + NetworkMappingFabricSpecificSettings fabricSpecificSettings) { + this.fabricSpecificSettings = fabricSpecificSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fabricSpecificSettings() != null) { + fabricSpecificSettings().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkProperties.java new file mode 100644 index 000000000000..0750774aedc2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Properties. */ +@Fluent +public final class NetworkProperties { + /* + * The Fabric Type. + */ + @JsonProperty(value = "fabricType") + private String fabricType; + + /* + * The List of subnets. + */ + @JsonProperty(value = "subnets") + private List subnets; + + /* + * The Friendly Name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The Network Type. + */ + @JsonProperty(value = "networkType") + private String networkType; + + /** Creates an instance of NetworkProperties class. */ + public NetworkProperties() { + } + + /** + * Get the fabricType property: The Fabric Type. + * + * @return the fabricType value. + */ + public String fabricType() { + return this.fabricType; + } + + /** + * Set the fabricType property: The Fabric Type. + * + * @param fabricType the fabricType value to set. + * @return the NetworkProperties object itself. + */ + public NetworkProperties withFabricType(String fabricType) { + this.fabricType = fabricType; + return this; + } + + /** + * Get the subnets property: The List of subnets. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: The List of subnets. + * + * @param subnets the subnets value to set. + * @return the NetworkProperties object itself. + */ + public NetworkProperties withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get the friendlyName property: The Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the NetworkProperties object itself. + */ + public NetworkProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the networkType property: The Network Type. + * + * @return the networkType value. + */ + public String networkType() { + return this.networkType; + } + + /** + * Set the networkType property: The Network Type. + * + * @param networkType the networkType value to set. + * @return the NetworkProperties object itself. + */ + public NetworkProperties withNetworkType(String networkType) { + this.networkType = networkType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnets() != null) { + subnets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewProtectionProfile.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewProtectionProfile.java new file mode 100644 index 000000000000..c630a8cf6dfe --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewProtectionProfile.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** New Protection profile input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("New") +@Fluent +public final class NewProtectionProfile extends ProtectionProfileCustomDetails { + /* + * The protection profile input. + */ + @JsonProperty(value = "policyName", required = true) + private String policyName; + + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistory") + private Integer recoveryPointHistory; + + /* + * The crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /* + * The app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. + */ + @JsonProperty(value = "multiVmSyncStatus", required = true) + private SetMultiVmSyncStatus multiVmSyncStatus; + + /** Creates an instance of NewProtectionProfile class. */ + public NewProtectionProfile() { + } + + /** + * Get the policyName property: The protection profile input. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: The protection profile input. + * + * @param policyName the policyName value to set. + * @return the NewProtectionProfile object itself. + */ + public NewProtectionProfile withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @return the recoveryPointHistory value. + */ + public Integer recoveryPointHistory() { + return this.recoveryPointHistory; + } + + /** + * Set the recoveryPointHistory property: The duration in minutes until which the recovery points need to be stored. + * + * @param recoveryPointHistory the recoveryPointHistory value to set. + * @return the NewProtectionProfile object itself. + */ + public NewProtectionProfile withRecoveryPointHistory(Integer recoveryPointHistory) { + this.recoveryPointHistory = recoveryPointHistory; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the NewProtectionProfile object itself. + */ + public NewProtectionProfile withCrashConsistentFrequencyInMinutes(Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the NewProtectionProfile object itself. + */ + public NewProtectionProfile withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. Value should be + * 'Enabled' or 'Disabled'. + * + * @return the multiVmSyncStatus value. + */ + public SetMultiVmSyncStatus multiVmSyncStatus() { + return this.multiVmSyncStatus; + } + + /** + * Set the multiVmSyncStatus property: A value indicating whether multi-VM sync has to be enabled. Value should be + * 'Enabled' or 'Disabled'. + * + * @param multiVmSyncStatus the multiVmSyncStatus value to set. + * @return the NewProtectionProfile object itself. + */ + public NewProtectionProfile withMultiVmSyncStatus(SetMultiVmSyncStatus multiVmSyncStatus) { + this.multiVmSyncStatus = multiVmSyncStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (policyName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property policyName in model NewProtectionProfile")); + } + if (multiVmSyncStatus() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property multiVmSyncStatus in model NewProtectionProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NewProtectionProfile.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewRecoveryVirtualNetwork.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewRecoveryVirtualNetwork.java new file mode 100644 index 000000000000..dd785ef8ad3e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewRecoveryVirtualNetwork.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.recoveryservicessiterecovery.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; + +/** Recovery virtual network input to create new virtual network from given source network. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("New") +@Fluent +public final class NewRecoveryVirtualNetwork extends RecoveryVirtualNetworkCustomDetails { + /* + * The name of the resource group to be used to create the recovery virtual network. If absent, target network + * would be created in the same resource group as target VM. + */ + @JsonProperty(value = "recoveryVirtualNetworkResourceGroupName") + private String recoveryVirtualNetworkResourceGroupName; + + /* + * The recovery virtual network name. + */ + @JsonProperty(value = "recoveryVirtualNetworkName") + private String recoveryVirtualNetworkName; + + /** Creates an instance of NewRecoveryVirtualNetwork class. */ + public NewRecoveryVirtualNetwork() { + } + + /** + * Get the recoveryVirtualNetworkResourceGroupName property: The name of the resource group to be used to create the + * recovery virtual network. If absent, target network would be created in the same resource group as target VM. + * + * @return the recoveryVirtualNetworkResourceGroupName value. + */ + public String recoveryVirtualNetworkResourceGroupName() { + return this.recoveryVirtualNetworkResourceGroupName; + } + + /** + * Set the recoveryVirtualNetworkResourceGroupName property: The name of the resource group to be used to create the + * recovery virtual network. If absent, target network would be created in the same resource group as target VM. + * + * @param recoveryVirtualNetworkResourceGroupName the recoveryVirtualNetworkResourceGroupName value to set. + * @return the NewRecoveryVirtualNetwork object itself. + */ + public NewRecoveryVirtualNetwork withRecoveryVirtualNetworkResourceGroupName( + String recoveryVirtualNetworkResourceGroupName) { + this.recoveryVirtualNetworkResourceGroupName = recoveryVirtualNetworkResourceGroupName; + return this; + } + + /** + * Get the recoveryVirtualNetworkName property: The recovery virtual network name. + * + * @return the recoveryVirtualNetworkName value. + */ + public String recoveryVirtualNetworkName() { + return this.recoveryVirtualNetworkName; + } + + /** + * Set the recoveryVirtualNetworkName property: The recovery virtual network name. + * + * @param recoveryVirtualNetworkName the recoveryVirtualNetworkName value to set. + * @return the NewRecoveryVirtualNetwork object itself. + */ + public NewRecoveryVirtualNetwork withRecoveryVirtualNetworkName(String recoveryVirtualNetworkName) { + this.recoveryVirtualNetworkName = recoveryVirtualNetworkName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSDetails.java new file mode 100644 index 000000000000..203e700ab965 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSDetails.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk Details. */ +@Fluent +public final class OSDetails { + /* + * VM Disk details. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * Product type. + */ + @JsonProperty(value = "productType") + private String productType; + + /* + * The OSEdition. + */ + @JsonProperty(value = "osEdition") + private String osEdition; + + /* + * The OS Version. + */ + @JsonProperty(value = "oSVersion") + private String oSVersion; + + /* + * The OS Major Version. + */ + @JsonProperty(value = "oSMajorVersion") + private String oSMajorVersion; + + /* + * The OS Minor Version. + */ + @JsonProperty(value = "oSMinorVersion") + private String oSMinorVersion; + + /** Creates an instance of OSDetails class. */ + public OSDetails() { + } + + /** + * Get the osType property: VM Disk details. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: VM Disk details. + * + * @param osType the osType value to set. + * @return the OSDetails object itself. + */ + public OSDetails withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the productType property: Product type. + * + * @return the productType value. + */ + public String productType() { + return this.productType; + } + + /** + * Set the productType property: Product type. + * + * @param productType the productType value to set. + * @return the OSDetails object itself. + */ + public OSDetails withProductType(String productType) { + this.productType = productType; + return this; + } + + /** + * Get the osEdition property: The OSEdition. + * + * @return the osEdition value. + */ + public String osEdition() { + return this.osEdition; + } + + /** + * Set the osEdition property: The OSEdition. + * + * @param osEdition the osEdition value to set. + * @return the OSDetails object itself. + */ + public OSDetails withOsEdition(String osEdition) { + this.osEdition = osEdition; + return this; + } + + /** + * Get the oSVersion property: The OS Version. + * + * @return the oSVersion value. + */ + public String oSVersion() { + return this.oSVersion; + } + + /** + * Set the oSVersion property: The OS Version. + * + * @param oSVersion the oSVersion value to set. + * @return the OSDetails object itself. + */ + public OSDetails withOSVersion(String oSVersion) { + this.oSVersion = oSVersion; + return this; + } + + /** + * Get the oSMajorVersion property: The OS Major Version. + * + * @return the oSMajorVersion value. + */ + public String oSMajorVersion() { + return this.oSMajorVersion; + } + + /** + * Set the oSMajorVersion property: The OS Major Version. + * + * @param oSMajorVersion the oSMajorVersion value to set. + * @return the OSDetails object itself. + */ + public OSDetails withOSMajorVersion(String oSMajorVersion) { + this.oSMajorVersion = oSMajorVersion; + return this; + } + + /** + * Get the oSMinorVersion property: The OS Minor Version. + * + * @return the oSMinorVersion value. + */ + public String oSMinorVersion() { + return this.oSMinorVersion; + } + + /** + * Set the oSMinorVersion property: The OS Minor Version. + * + * @param oSMinorVersion the oSMinorVersion value to set. + * @return the OSDetails object itself. + */ + public OSDetails withOSMinorVersion(String oSMinorVersion) { + this.oSMinorVersion = oSMinorVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSDiskDetails.java new file mode 100644 index 000000000000..a77842e5d742 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSDiskDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of the OS Disk. */ +@Fluent +public final class OSDiskDetails { + /* + * The id of the disk containing the OS. + */ + @JsonProperty(value = "osVhdId") + private String osVhdId; + + /* + * The type of the OS on the VM. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The OS disk VHD name. + */ + @JsonProperty(value = "vhdName") + private String vhdName; + + /** Creates an instance of OSDiskDetails class. */ + public OSDiskDetails() { + } + + /** + * Get the osVhdId property: The id of the disk containing the OS. + * + * @return the osVhdId value. + */ + public String osVhdId() { + return this.osVhdId; + } + + /** + * Set the osVhdId property: The id of the disk containing the OS. + * + * @param osVhdId the osVhdId value to set. + * @return the OSDiskDetails object itself. + */ + public OSDiskDetails withOsVhdId(String osVhdId) { + this.osVhdId = osVhdId; + return this; + } + + /** + * Get the osType property: The type of the OS on the VM. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The type of the OS on the VM. + * + * @param osType the osType value to set. + * @return the OSDiskDetails object itself. + */ + public OSDiskDetails withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the vhdName property: The OS disk VHD name. + * + * @return the vhdName value. + */ + public String vhdName() { + return this.vhdName; + } + + /** + * Set the vhdName property: The OS disk VHD name. + * + * @param vhdName the vhdName value to set. + * @return the OSDiskDetails object itself. + */ + public OSDiskDetails withVhdName(String vhdName) { + this.vhdName = vhdName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSVersionWrapper.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSVersionWrapper.java new file mode 100644 index 000000000000..11761c65b01b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OSVersionWrapper.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Wrapper model for OSVersion to include version and service pack info. */ +@Fluent +public final class OSVersionWrapper { + /* + * The version. + */ + @JsonProperty(value = "version") + private String version; + + /* + * The service pack. + */ + @JsonProperty(value = "servicePack") + private String servicePack; + + /** Creates an instance of OSVersionWrapper class. */ + public OSVersionWrapper() { + } + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version. + * + * @param version the version value to set. + * @return the OSVersionWrapper object itself. + */ + public OSVersionWrapper withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the servicePack property: The service pack. + * + * @return the servicePack value. + */ + public String servicePack() { + return this.servicePack; + } + + /** + * Set the servicePack property: The service pack. + * + * @param servicePack the servicePack value to set. + * @return the OSVersionWrapper object itself. + */ + public OSVersionWrapper withServicePack(String servicePack) { + this.servicePack = servicePack; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Operations.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Operations.java new file mode 100644 index 000000000000..5851488b5b30 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Operations.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns the list of available operations. + * + *

Operation to return the list of available operations. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of ClientDiscovery details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OperationsDiscovery.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OperationsDiscovery.java new file mode 100644 index 000000000000..3bacdbbb1759 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OperationsDiscovery.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner; + +/** An immutable client-side representation of OperationsDiscovery. */ +public interface OperationsDiscovery { + /** + * Gets the name property: Name of the API. The name of the operation being performed on this particular object. It + * should match the action name that appears in RBAC / the event service. Examples of operations include: * + * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * + * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * + * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) + * Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, + * Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should + * be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action + * should be used. As a note: all resource providers would need to include the "{Resource Provider + * Namespace}/register/action" operation in their response. This API is used to register for their service, and + * should include details about the operation (e.g. a localized name for the resource provider + any special + * considerations like PII release). + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Object type. + * + * @return the display value. + */ + Display display(); + + /** + * Gets the origin property: Origin. The intended executor of the operation; governs the display of the operation in + * the RBAC UX and the audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Properties. Reserved for future use. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner + * object. + * + * @return the inner object. + */ + OperationsDiscoveryInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OperationsDiscoveryCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OperationsDiscoveryCollection.java new file mode 100644 index 000000000000..31353a2020af --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/OperationsDiscoveryCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of ClientDiscovery details. */ +@Fluent +public final class OperationsDiscoveryCollection { + /* + * The ClientDiscovery details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of OperationsDiscoveryCollection class. */ + public OperationsDiscoveryCollection() { + } + + /** + * Get the value property: The ClientDiscovery details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ClientDiscovery details. + * + * @param value the value value to set. + * @return the OperationsDiscoveryCollection object itself. + */ + public OperationsDiscoveryCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the OperationsDiscoveryCollection object itself. + */ + public OperationsDiscoveryCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PauseReplicationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PauseReplicationInput.java new file mode 100644 index 000000000000..0346534cde30 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PauseReplicationInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Pause replication input. */ +@Fluent +public final class PauseReplicationInput { + /* + * Pause replication input properties. + */ + @JsonProperty(value = "properties", required = true) + private PauseReplicationInputProperties properties; + + /** Creates an instance of PauseReplicationInput class. */ + public PauseReplicationInput() { + } + + /** + * Get the properties property: Pause replication input properties. + * + * @return the properties value. + */ + public PauseReplicationInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Pause replication input properties. + * + * @param properties the properties value to set. + * @return the PauseReplicationInput object itself. + */ + public PauseReplicationInput withProperties(PauseReplicationInputProperties 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 PauseReplicationInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PauseReplicationInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PauseReplicationInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PauseReplicationInputProperties.java new file mode 100644 index 000000000000..e47bc8917db4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PauseReplicationInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Pause replication input properties. */ +@Fluent +public final class PauseReplicationInputProperties { + /* + * The class type. + */ + @JsonProperty(value = "instanceType", required = true) + private String instanceType; + + /** Creates an instance of PauseReplicationInputProperties class. */ + public PauseReplicationInputProperties() { + } + + /** + * Get the instanceType property: The class type. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: The class type. + * + * @param instanceType the instanceType value to set. + * @return the PauseReplicationInputProperties object itself. + */ + public PauseReplicationInputProperties 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 PauseReplicationInputProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PauseReplicationInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverInput.java new file mode 100644 index 000000000000..95df812dc57d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for planned failover. */ +@Fluent +public final class PlannedFailoverInput { + /* + * Planned failover input properties. + */ + @JsonProperty(value = "properties") + private PlannedFailoverInputProperties properties; + + /** Creates an instance of PlannedFailoverInput class. */ + public PlannedFailoverInput() { + } + + /** + * Get the properties property: Planned failover input properties. + * + * @return the properties value. + */ + public PlannedFailoverInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Planned failover input properties. + * + * @param properties the properties value to set. + * @return the PlannedFailoverInput object itself. + */ + public PlannedFailoverInput withProperties(PlannedFailoverInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverInputProperties.java new file mode 100644 index 000000000000..6f9318671c9b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for planned failover input properties. */ +@Fluent +public final class PlannedFailoverInputProperties { + /* + * Failover direction. + */ + @JsonProperty(value = "failoverDirection") + private String failoverDirection; + + /* + * Provider specific settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private PlannedFailoverProviderSpecificFailoverInput providerSpecificDetails; + + /** Creates an instance of PlannedFailoverInputProperties class. */ + public PlannedFailoverInputProperties() { + } + + /** + * Get the failoverDirection property: Failover direction. + * + * @return the failoverDirection value. + */ + public String failoverDirection() { + return this.failoverDirection; + } + + /** + * Set the failoverDirection property: Failover direction. + * + * @param failoverDirection the failoverDirection value to set. + * @return the PlannedFailoverInputProperties object itself. + */ + public PlannedFailoverInputProperties withFailoverDirection(String failoverDirection) { + this.failoverDirection = failoverDirection; + return this; + } + + /** + * Get the providerSpecificDetails property: Provider specific settings. + * + * @return the providerSpecificDetails value. + */ + public PlannedFailoverProviderSpecificFailoverInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: Provider specific settings. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the PlannedFailoverInputProperties object itself. + */ + public PlannedFailoverInputProperties withProviderSpecificDetails( + PlannedFailoverProviderSpecificFailoverInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverProviderSpecificFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverProviderSpecificFailoverInput.java new file mode 100644 index 000000000000..12368e34ea5c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverProviderSpecificFailoverInput.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.recoveryservicessiterecovery.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; + +/** Provider specific failover input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = PlannedFailoverProviderSpecificFailoverInput.class) +@JsonTypeName("PlannedFailoverProviderSpecificFailoverInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "HyperVReplicaAzureFailback", value = HyperVReplicaAzureFailbackProviderInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzurePlannedFailoverProviderInput.class), + @JsonSubTypes.Type(name = "InMageRcmFailback", value = InMageRcmFailbackPlannedFailoverProviderInput.class) +}) +@Immutable +public class PlannedFailoverProviderSpecificFailoverInput { + /** Creates an instance of PlannedFailoverProviderSpecificFailoverInput class. */ + public PlannedFailoverProviderSpecificFailoverInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverStatus.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverStatus.java new file mode 100644 index 000000000000..716e0c793513 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverStatus.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The last planned failover status. */ +public final class PlannedFailoverStatus extends ExpandableStringEnum { + /** Static value Succeeded for PlannedFailoverStatus. */ + public static final PlannedFailoverStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for PlannedFailoverStatus. */ + public static final PlannedFailoverStatus FAILED = fromString("Failed"); + + /** Static value Cancelled for PlannedFailoverStatus. */ + public static final PlannedFailoverStatus CANCELLED = fromString("Cancelled"); + + /** Static value Unknown for PlannedFailoverStatus. */ + public static final PlannedFailoverStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a PlannedFailoverStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PlannedFailoverStatus. + */ + @JsonCreator + public static PlannedFailoverStatus fromString(String name) { + return fromString(name, PlannedFailoverStatus.class); + } + + /** + * Gets known PlannedFailoverStatus values. + * + * @return known PlannedFailoverStatus values. + */ + public static Collection values() { + return values(PlannedFailoverStatus.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Policy.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Policy.java new file mode 100644 index 000000000000..2f4cc168d0f0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Policy.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.PolicyInner; + +/** An immutable client-side representation of Policy. */ +public interface Policy { + /** + * 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: The custom data. + * + * @return the properties value. + */ + PolicyProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * 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.recoveryservicessiterecovery.fluent.models.PolicyInner object. + * + * @return the inner object. + */ + PolicyInner innerModel(); + + /** The entirety of the Policy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Policy definition stages. */ + interface DefinitionStages { + /** The first stage of the Policy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Policy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @return the next definition stage. + */ + WithCreate withExistingVault(String resourceName, String resourceGroupName); + } + /** + * The stage of the Policy 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Policy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Policy create(Context context); + } + /** The stage of the Policy definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Policy creation properties.. + * + * @param properties Policy creation properties. + * @return the next definition stage. + */ + WithCreate withProperties(CreatePolicyInputProperties properties); + } + } + /** + * Begins update for the Policy resource. + * + * @return the stage of resource update. + */ + Policy.Update update(); + + /** The template for Policy update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Policy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Policy apply(Context context); + } + /** The Policy update stages. */ + interface UpdateStages { + /** The stage of the Policy update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The ReplicationProviderSettings.. + * + * @param properties The ReplicationProviderSettings. + * @return the next definition stage. + */ + Update withProperties(UpdatePolicyInputProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Policy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Policy refresh(Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyCollection.java new file mode 100644 index 000000000000..e9bcaf3a1ccb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.PolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protection Profile Collection details. */ +@Fluent +public final class PolicyCollection { + /* + * The policy details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of PolicyCollection class. */ + public PolicyCollection() { + } + + /** + * Get the value property: The policy details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The policy details. + * + * @param value the value value to set. + * @return the PolicyCollection object itself. + */ + public PolicyCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the PolicyCollection object itself. + */ + public PolicyCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProperties.java new file mode 100644 index 000000000000..39022d6d5225 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection profile custom data details. */ +@Fluent +public final class PolicyProperties { + /* + * The FriendlyName. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The ReplicationChannelSetting. + */ + @JsonProperty(value = "providerSpecificDetails") + private PolicyProviderSpecificDetails providerSpecificDetails; + + /** Creates an instance of PolicyProperties class. */ + public PolicyProperties() { + } + + /** + * Get the friendlyName property: The FriendlyName. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The FriendlyName. + * + * @param friendlyName the friendlyName value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the providerSpecificDetails property: The ReplicationChannelSetting. + * + * @return the providerSpecificDetails value. + */ + public PolicyProviderSpecificDetails providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The ReplicationChannelSetting. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withProviderSpecificDetails(PolicyProviderSpecificDetails providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProviderSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProviderSpecificDetails.java new file mode 100644 index 000000000000..237190dcef1a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProviderSpecificDetails.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.recoveryservicessiterecovery.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; + +/** Base class for Provider specific details for policies. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = PolicyProviderSpecificDetails.class) +@JsonTypeName("PolicyProviderSpecificDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2APolicyDetails.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzurePolicyDetails.class), + @JsonSubTypes.Type(name = "HyperVReplicaBasePolicyDetails", value = HyperVReplicaBasePolicyDetails.class), + @JsonSubTypes.Type(name = "HyperVReplica2012R2", value = HyperVReplicaBluePolicyDetails.class), + @JsonSubTypes.Type(name = "HyperVReplica2012", value = HyperVReplicaPolicyDetails.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2PolicyDetails.class), + @JsonSubTypes.Type(name = "InMageBasePolicyDetails", value = InMageBasePolicyDetails.class), + @JsonSubTypes.Type(name = "InMage", value = InMagePolicyDetails.class), + @JsonSubTypes.Type(name = "InMageRcmFailback", value = InMageRcmFailbackPolicyDetails.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmPolicyDetails.class), + @JsonSubTypes.Type(name = "VMwareCbt", value = VmwareCbtPolicyDetails.class) +}) +@Immutable +public class PolicyProviderSpecificDetails { + /** Creates an instance of PolicyProviderSpecificDetails class. */ + public PolicyProviderSpecificDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProviderSpecificInput.java new file mode 100644 index 000000000000..b0528fb8c3cc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Base class for provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = PolicyProviderSpecificInput.class) +@JsonTypeName("PolicyProviderSpecificInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2ACrossClusterMigration", value = A2ACrossClusterMigrationPolicyCreationInput.class), + @JsonSubTypes.Type(name = "A2A", value = A2APolicyCreationInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzurePolicyInput.class), + @JsonSubTypes.Type(name = "HyperVReplica2012", value = HyperVReplicaPolicyInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2PolicyInput.class), + @JsonSubTypes.Type(name = "InMage", value = InMagePolicyInput.class), + @JsonSubTypes.Type(name = "InMageRcmFailback", value = InMageRcmFailbackPolicyCreationInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmPolicyCreationInput.class), + @JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtPolicyCreationInput.class) +}) +@Immutable +public class PolicyProviderSpecificInput { + /** Creates an instance of PolicyProviderSpecificInput class. */ + public PolicyProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PossibleOperationsDirections.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PossibleOperationsDirections.java new file mode 100644 index 000000000000..04bb193a72ce --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PossibleOperationsDirections.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PossibleOperationsDirections. */ +public final class PossibleOperationsDirections extends ExpandableStringEnum { + /** Static value PrimaryToRecovery for PossibleOperationsDirections. */ + public static final PossibleOperationsDirections PRIMARY_TO_RECOVERY = fromString("PrimaryToRecovery"); + + /** Static value RecoveryToPrimary for PossibleOperationsDirections. */ + public static final PossibleOperationsDirections RECOVERY_TO_PRIMARY = fromString("RecoveryToPrimary"); + + /** + * Creates or finds a PossibleOperationsDirections from its string representation. + * + * @param name a name to look for. + * @return the corresponding PossibleOperationsDirections. + */ + @JsonCreator + public static PossibleOperationsDirections fromString(String name) { + return fromString(name, PossibleOperationsDirections.class); + } + + /** + * Gets known PossibleOperationsDirections values. + * + * @return known PossibleOperationsDirections values. + */ + public static Collection values() { + return values(PossibleOperationsDirections.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PresenceStatus.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PresenceStatus.java new file mode 100644 index 000000000000..edf563988198 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PresenceStatus.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. + */ +public final class PresenceStatus extends ExpandableStringEnum { + /** Static value Unknown for PresenceStatus. */ + public static final PresenceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Present for PresenceStatus. */ + public static final PresenceStatus PRESENT = fromString("Present"); + + /** Static value NotPresent for PresenceStatus. */ + public static final PresenceStatus NOT_PRESENT = fromString("NotPresent"); + + /** + * Creates or finds a PresenceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PresenceStatus. + */ + @JsonCreator + public static PresenceStatus fromString(String name) { + return fromString(name, PresenceStatus.class); + } + + /** + * Gets known PresenceStatus values. + * + * @return known PresenceStatus values. + */ + public static Collection values() { + return values(PresenceStatus.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServer.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServer.java new file mode 100644 index 000000000000..87cf94c0a5f9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServer.java @@ -0,0 +1,887 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of the Process Server. */ +@Fluent +public final class ProcessServer { + /* + * The Process Server's friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The Process Server Id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The IP address of the server. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The OS type of the server. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The version of the scout component on the server. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * The last heartbeat received from the server. + */ + @JsonProperty(value = "lastHeartbeat") + private OffsetDateTime lastHeartbeat; + + /* + * Version status. + */ + @JsonProperty(value = "versionStatus") + private String versionStatus; + + /* + * The list of the mobility service updates available on the Process Server. + */ + @JsonProperty(value = "mobilityServiceUpdates") + private List mobilityServiceUpdates; + + /* + * The agent generated Id. + */ + @JsonProperty(value = "hostId") + private String hostId; + + /* + * The servers configured with this PS. + */ + @JsonProperty(value = "machineCount") + private String machineCount; + + /* + * The number of replication pairs configured in this PS. + */ + @JsonProperty(value = "replicationPairCount") + private String replicationPairCount; + + /* + * The percentage of the system load. + */ + @JsonProperty(value = "systemLoad") + private String systemLoad; + + /* + * The system load status. + */ + @JsonProperty(value = "systemLoadStatus") + private String systemLoadStatus; + + /* + * The percentage of the CPU load. + */ + @JsonProperty(value = "cpuLoad") + private String cpuLoad; + + /* + * The CPU load status. + */ + @JsonProperty(value = "cpuLoadStatus") + private String cpuLoadStatus; + + /* + * The total memory. + */ + @JsonProperty(value = "totalMemoryInBytes") + private Long totalMemoryInBytes; + + /* + * The available memory. + */ + @JsonProperty(value = "availableMemoryInBytes") + private Long availableMemoryInBytes; + + /* + * The memory usage status. + */ + @JsonProperty(value = "memoryUsageStatus") + private String memoryUsageStatus; + + /* + * The total space. + */ + @JsonProperty(value = "totalSpaceInBytes") + private Long totalSpaceInBytes; + + /* + * The available space. + */ + @JsonProperty(value = "availableSpaceInBytes") + private Long availableSpaceInBytes; + + /* + * The space usage status. + */ + @JsonProperty(value = "spaceUsageStatus") + private String spaceUsageStatus; + + /* + * The PS service status. + */ + @JsonProperty(value = "psServiceStatus") + private String psServiceStatus; + + /* + * The PS SSL cert expiry date. + */ + @JsonProperty(value = "sslCertExpiryDate") + private OffsetDateTime sslCertExpiryDate; + + /* + * CS SSL cert expiry date. + */ + @JsonProperty(value = "sslCertExpiryRemainingDays") + private Integer sslCertExpiryRemainingDays; + + /* + * OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. + */ + @JsonProperty(value = "osVersion") + private String osVersion; + + /* + * Health errors. + */ + @JsonProperty(value = "healthErrors") + private List healthErrors; + + /* + * Agent expiry date. + */ + @JsonProperty(value = "agentExpiryDate") + private OffsetDateTime agentExpiryDate; + + /* + * The agent version details. + */ + @JsonProperty(value = "agentVersionDetails") + private VersionDetails agentVersionDetails; + + /* + * The health of Process Server. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth health; + + /* + * The process server stats refresh time. + */ + @JsonProperty(value = "psStatsRefreshTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime psStatsRefreshTime; + + /* + * The uploading pending data in bytes. + */ + @JsonProperty(value = "throughputUploadPendingDataInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long throughputUploadPendingDataInBytes; + + /* + * The throughput in MBps. + */ + @JsonProperty(value = "throughputInMBps", access = JsonProperty.Access.WRITE_ONLY) + private Long throughputInMBps; + + /* + * The throughput in bytes. + */ + @JsonProperty(value = "throughputInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long throughputInBytes; + + /* + * The throughput status. + */ + @JsonProperty(value = "throughputStatus", access = JsonProperty.Access.WRITE_ONLY) + private String throughputStatus; + + /* + * The MARS communication status. + */ + @JsonProperty(value = "marsCommunicationStatus", access = JsonProperty.Access.WRITE_ONLY) + private String marsCommunicationStatus; + + /* + * The MARS registration status. + */ + @JsonProperty(value = "marsRegistrationStatus", access = JsonProperty.Access.WRITE_ONLY) + private String marsRegistrationStatus; + + /** Creates an instance of ProcessServer class. */ + public ProcessServer() { + } + + /** + * Get the friendlyName property: The Process Server's friendly name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The Process Server's friendly name. + * + * @param friendlyName the friendlyName value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the id property: The Process Server Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The Process Server Id. + * + * @param id the id value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withId(String id) { + this.id = id; + return this; + } + + /** + * Get the ipAddress property: The IP address of the server. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address of the server. + * + * @param ipAddress the ipAddress value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the osType property: The OS type of the server. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type of the server. + * + * @param osType the osType value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the agentVersion property: The version of the scout component on the server. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The version of the scout component on the server. + * + * @param agentVersion the agentVersion value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the lastHeartbeat property: The last heartbeat received from the server. + * + * @return the lastHeartbeat value. + */ + public OffsetDateTime lastHeartbeat() { + return this.lastHeartbeat; + } + + /** + * Set the lastHeartbeat property: The last heartbeat received from the server. + * + * @param lastHeartbeat the lastHeartbeat value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withLastHeartbeat(OffsetDateTime lastHeartbeat) { + this.lastHeartbeat = lastHeartbeat; + return this; + } + + /** + * Get the versionStatus property: Version status. + * + * @return the versionStatus value. + */ + public String versionStatus() { + return this.versionStatus; + } + + /** + * Set the versionStatus property: Version status. + * + * @param versionStatus the versionStatus value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withVersionStatus(String versionStatus) { + this.versionStatus = versionStatus; + return this; + } + + /** + * Get the mobilityServiceUpdates property: The list of the mobility service updates available on the Process + * Server. + * + * @return the mobilityServiceUpdates value. + */ + public List mobilityServiceUpdates() { + return this.mobilityServiceUpdates; + } + + /** + * Set the mobilityServiceUpdates property: The list of the mobility service updates available on the Process + * Server. + * + * @param mobilityServiceUpdates the mobilityServiceUpdates value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withMobilityServiceUpdates(List mobilityServiceUpdates) { + this.mobilityServiceUpdates = mobilityServiceUpdates; + return this; + } + + /** + * Get the hostId property: The agent generated Id. + * + * @return the hostId value. + */ + public String hostId() { + return this.hostId; + } + + /** + * Set the hostId property: The agent generated Id. + * + * @param hostId the hostId value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withHostId(String hostId) { + this.hostId = hostId; + return this; + } + + /** + * Get the machineCount property: The servers configured with this PS. + * + * @return the machineCount value. + */ + public String machineCount() { + return this.machineCount; + } + + /** + * Set the machineCount property: The servers configured with this PS. + * + * @param machineCount the machineCount value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withMachineCount(String machineCount) { + this.machineCount = machineCount; + return this; + } + + /** + * Get the replicationPairCount property: The number of replication pairs configured in this PS. + * + * @return the replicationPairCount value. + */ + public String replicationPairCount() { + return this.replicationPairCount; + } + + /** + * Set the replicationPairCount property: The number of replication pairs configured in this PS. + * + * @param replicationPairCount the replicationPairCount value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withReplicationPairCount(String replicationPairCount) { + this.replicationPairCount = replicationPairCount; + return this; + } + + /** + * Get the systemLoad property: The percentage of the system load. + * + * @return the systemLoad value. + */ + public String systemLoad() { + return this.systemLoad; + } + + /** + * Set the systemLoad property: The percentage of the system load. + * + * @param systemLoad the systemLoad value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withSystemLoad(String systemLoad) { + this.systemLoad = systemLoad; + return this; + } + + /** + * Get the systemLoadStatus property: The system load status. + * + * @return the systemLoadStatus value. + */ + public String systemLoadStatus() { + return this.systemLoadStatus; + } + + /** + * Set the systemLoadStatus property: The system load status. + * + * @param systemLoadStatus the systemLoadStatus value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withSystemLoadStatus(String systemLoadStatus) { + this.systemLoadStatus = systemLoadStatus; + return this; + } + + /** + * Get the cpuLoad property: The percentage of the CPU load. + * + * @return the cpuLoad value. + */ + public String cpuLoad() { + return this.cpuLoad; + } + + /** + * Set the cpuLoad property: The percentage of the CPU load. + * + * @param cpuLoad the cpuLoad value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withCpuLoad(String cpuLoad) { + this.cpuLoad = cpuLoad; + return this; + } + + /** + * Get the cpuLoadStatus property: The CPU load status. + * + * @return the cpuLoadStatus value. + */ + public String cpuLoadStatus() { + return this.cpuLoadStatus; + } + + /** + * Set the cpuLoadStatus property: The CPU load status. + * + * @param cpuLoadStatus the cpuLoadStatus value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withCpuLoadStatus(String cpuLoadStatus) { + this.cpuLoadStatus = cpuLoadStatus; + return this; + } + + /** + * Get the totalMemoryInBytes property: The total memory. + * + * @return the totalMemoryInBytes value. + */ + public Long totalMemoryInBytes() { + return this.totalMemoryInBytes; + } + + /** + * Set the totalMemoryInBytes property: The total memory. + * + * @param totalMemoryInBytes the totalMemoryInBytes value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withTotalMemoryInBytes(Long totalMemoryInBytes) { + this.totalMemoryInBytes = totalMemoryInBytes; + return this; + } + + /** + * Get the availableMemoryInBytes property: The available memory. + * + * @return the availableMemoryInBytes value. + */ + public Long availableMemoryInBytes() { + return this.availableMemoryInBytes; + } + + /** + * Set the availableMemoryInBytes property: The available memory. + * + * @param availableMemoryInBytes the availableMemoryInBytes value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withAvailableMemoryInBytes(Long availableMemoryInBytes) { + this.availableMemoryInBytes = availableMemoryInBytes; + return this; + } + + /** + * Get the memoryUsageStatus property: The memory usage status. + * + * @return the memoryUsageStatus value. + */ + public String memoryUsageStatus() { + return this.memoryUsageStatus; + } + + /** + * Set the memoryUsageStatus property: The memory usage status. + * + * @param memoryUsageStatus the memoryUsageStatus value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withMemoryUsageStatus(String memoryUsageStatus) { + this.memoryUsageStatus = memoryUsageStatus; + return this; + } + + /** + * Get the totalSpaceInBytes property: The total space. + * + * @return the totalSpaceInBytes value. + */ + public Long totalSpaceInBytes() { + return this.totalSpaceInBytes; + } + + /** + * Set the totalSpaceInBytes property: The total space. + * + * @param totalSpaceInBytes the totalSpaceInBytes value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withTotalSpaceInBytes(Long totalSpaceInBytes) { + this.totalSpaceInBytes = totalSpaceInBytes; + return this; + } + + /** + * Get the availableSpaceInBytes property: The available space. + * + * @return the availableSpaceInBytes value. + */ + public Long availableSpaceInBytes() { + return this.availableSpaceInBytes; + } + + /** + * Set the availableSpaceInBytes property: The available space. + * + * @param availableSpaceInBytes the availableSpaceInBytes value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withAvailableSpaceInBytes(Long availableSpaceInBytes) { + this.availableSpaceInBytes = availableSpaceInBytes; + return this; + } + + /** + * Get the spaceUsageStatus property: The space usage status. + * + * @return the spaceUsageStatus value. + */ + public String spaceUsageStatus() { + return this.spaceUsageStatus; + } + + /** + * Set the spaceUsageStatus property: The space usage status. + * + * @param spaceUsageStatus the spaceUsageStatus value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withSpaceUsageStatus(String spaceUsageStatus) { + this.spaceUsageStatus = spaceUsageStatus; + return this; + } + + /** + * Get the psServiceStatus property: The PS service status. + * + * @return the psServiceStatus value. + */ + public String psServiceStatus() { + return this.psServiceStatus; + } + + /** + * Set the psServiceStatus property: The PS service status. + * + * @param psServiceStatus the psServiceStatus value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withPsServiceStatus(String psServiceStatus) { + this.psServiceStatus = psServiceStatus; + return this; + } + + /** + * Get the sslCertExpiryDate property: The PS SSL cert expiry date. + * + * @return the sslCertExpiryDate value. + */ + public OffsetDateTime sslCertExpiryDate() { + return this.sslCertExpiryDate; + } + + /** + * Set the sslCertExpiryDate property: The PS SSL cert expiry date. + * + * @param sslCertExpiryDate the sslCertExpiryDate value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withSslCertExpiryDate(OffsetDateTime sslCertExpiryDate) { + this.sslCertExpiryDate = sslCertExpiryDate; + return this; + } + + /** + * Get the sslCertExpiryRemainingDays property: CS SSL cert expiry date. + * + * @return the sslCertExpiryRemainingDays value. + */ + public Integer sslCertExpiryRemainingDays() { + return this.sslCertExpiryRemainingDays; + } + + /** + * Set the sslCertExpiryRemainingDays property: CS SSL cert expiry date. + * + * @param sslCertExpiryRemainingDays the sslCertExpiryRemainingDays value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withSslCertExpiryRemainingDays(Integer sslCertExpiryRemainingDays) { + this.sslCertExpiryRemainingDays = sslCertExpiryRemainingDays; + return this; + } + + /** + * Get the osVersion property: OS Version of the process server. Note: This will get populated if user has CS + * version greater than 9.12.0.0. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Set the osVersion property: OS Version of the process server. Note: This will get populated if user has CS + * version greater than 9.12.0.0. + * + * @param osVersion the osVersion value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withOsVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get the healthErrors property: Health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Set the healthErrors property: Health errors. + * + * @param healthErrors the healthErrors value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withHealthErrors(List healthErrors) { + this.healthErrors = healthErrors; + return this; + } + + /** + * Get the agentExpiryDate property: Agent expiry date. + * + * @return the agentExpiryDate value. + */ + public OffsetDateTime agentExpiryDate() { + return this.agentExpiryDate; + } + + /** + * Set the agentExpiryDate property: Agent expiry date. + * + * @param agentExpiryDate the agentExpiryDate value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withAgentExpiryDate(OffsetDateTime agentExpiryDate) { + this.agentExpiryDate = agentExpiryDate; + return this; + } + + /** + * Get the agentVersionDetails property: The agent version details. + * + * @return the agentVersionDetails value. + */ + public VersionDetails agentVersionDetails() { + return this.agentVersionDetails; + } + + /** + * Set the agentVersionDetails property: The agent version details. + * + * @param agentVersionDetails the agentVersionDetails value to set. + * @return the ProcessServer object itself. + */ + public ProcessServer withAgentVersionDetails(VersionDetails agentVersionDetails) { + this.agentVersionDetails = agentVersionDetails; + return this; + } + + /** + * Get the health property: The health of Process Server. + * + * @return the health value. + */ + public ProtectionHealth health() { + return this.health; + } + + /** + * Get the psStatsRefreshTime property: The process server stats refresh time. + * + * @return the psStatsRefreshTime value. + */ + public OffsetDateTime psStatsRefreshTime() { + return this.psStatsRefreshTime; + } + + /** + * Get the throughputUploadPendingDataInBytes property: The uploading pending data in bytes. + * + * @return the throughputUploadPendingDataInBytes value. + */ + public Long throughputUploadPendingDataInBytes() { + return this.throughputUploadPendingDataInBytes; + } + + /** + * Get the throughputInMBps property: The throughput in MBps. + * + * @return the throughputInMBps value. + */ + public Long throughputInMBps() { + return this.throughputInMBps; + } + + /** + * Get the throughputInBytes property: The throughput in bytes. + * + * @return the throughputInBytes value. + */ + public Long throughputInBytes() { + return this.throughputInBytes; + } + + /** + * Get the throughputStatus property: The throughput status. + * + * @return the throughputStatus value. + */ + public String throughputStatus() { + return this.throughputStatus; + } + + /** + * Get the marsCommunicationStatus property: The MARS communication status. + * + * @return the marsCommunicationStatus value. + */ + public String marsCommunicationStatus() { + return this.marsCommunicationStatus; + } + + /** + * Get the marsRegistrationStatus property: The MARS registration status. + * + * @return the marsRegistrationStatus value. + */ + public String marsRegistrationStatus() { + return this.marsRegistrationStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mobilityServiceUpdates() != null) { + mobilityServiceUpdates().forEach(e -> e.validate()); + } + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + if (agentVersionDetails() != null) { + agentVersionDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServerDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServerDetails.java new file mode 100644 index 000000000000..2647f1b089d1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServerDetails.java @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Process server details. */ +@Immutable +public final class ProcessServerDetails { + /* + * The process server Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The process server name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The process server Bios Id. + */ + @JsonProperty(value = "biosId", access = JsonProperty.Access.WRITE_ONLY) + private String biosId; + + /* + * The fabric object Id. + */ + @JsonProperty(value = "fabricObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricObjectId; + + /* + * The process server Fqdn. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The list of IP addresses for communicating with the RCM component. + */ + @JsonProperty(value = "ipAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List ipAddresses; + + /* + * The version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The last heartbeat received from the process server. + */ + @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeatUtc; + + /* + * The total memory. + */ + @JsonProperty(value = "totalMemoryInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long totalMemoryInBytes; + + /* + * The available memory. + */ + @JsonProperty(value = "availableMemoryInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long availableMemoryInBytes; + + /* + * The used memory. + */ + @JsonProperty(value = "usedMemoryInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long usedMemoryInBytes; + + /* + * The memory usage percentage. + */ + @JsonProperty(value = "memoryUsagePercentage", access = JsonProperty.Access.WRITE_ONLY) + private Double memoryUsagePercentage; + + /* + * The total disk space. + */ + @JsonProperty(value = "totalSpaceInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long totalSpaceInBytes; + + /* + * The available disk space. + */ + @JsonProperty(value = "availableSpaceInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long availableSpaceInBytes; + + /* + * The used disk space. + */ + @JsonProperty(value = "usedSpaceInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long usedSpaceInBytes; + + /* + * The free disk space percentage. + */ + @JsonProperty(value = "freeSpacePercentage", access = JsonProperty.Access.WRITE_ONLY) + private Double freeSpacePercentage; + + /* + * The uploading pending data in bytes. + */ + @JsonProperty(value = "throughputUploadPendingDataInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long throughputUploadPendingDataInBytes; + + /* + * The throughput in bytes. + */ + @JsonProperty(value = "throughputInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long throughputInBytes; + + /* + * The processor usage percentage. + */ + @JsonProperty(value = "processorUsagePercentage", access = JsonProperty.Access.WRITE_ONLY) + private Double processorUsagePercentage; + + /* + * The throughput status. + */ + @JsonProperty(value = "throughputStatus", access = JsonProperty.Access.WRITE_ONLY) + private RcmComponentStatus throughputStatus; + + /* + * The system load. + */ + @JsonProperty(value = "systemLoad", access = JsonProperty.Access.WRITE_ONLY) + private Long systemLoad; + + /* + * The system load status. + */ + @JsonProperty(value = "systemLoadStatus", access = JsonProperty.Access.WRITE_ONLY) + private RcmComponentStatus systemLoadStatus; + + /* + * The disk usage status. + */ + @JsonProperty(value = "diskUsageStatus", access = JsonProperty.Access.WRITE_ONLY) + private RcmComponentStatus diskUsageStatus; + + /* + * The memory usage status. + */ + @JsonProperty(value = "memoryUsageStatus", access = JsonProperty.Access.WRITE_ONLY) + private RcmComponentStatus memoryUsageStatus; + + /* + * The processor usage status. + */ + @JsonProperty(value = "processorUsageStatus", access = JsonProperty.Access.WRITE_ONLY) + private RcmComponentStatus processorUsageStatus; + + /* + * The health of the process server. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth health; + + /* + * The health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /* + * The protected item count. + */ + @JsonProperty(value = "protectedItemCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer protectedItemCount; + + /* + * The historic health of the process server based on the health in last 24 hours. + */ + @JsonProperty(value = "historicHealth", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth historicHealth; + + /** Creates an instance of ProcessServerDetails class. */ + public ProcessServerDetails() { + } + + /** + * Get the id property: The process server Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The process server name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the biosId property: The process server Bios Id. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Get the fabricObjectId property: The fabric object Id. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Get the fqdn property: The process server Fqdn. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the ipAddresses property: The list of IP addresses for communicating with the RCM component. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the lastHeartbeatUtc property: The last heartbeat received from the process server. + * + * @return the lastHeartbeatUtc value. + */ + public OffsetDateTime lastHeartbeatUtc() { + return this.lastHeartbeatUtc; + } + + /** + * Get the totalMemoryInBytes property: The total memory. + * + * @return the totalMemoryInBytes value. + */ + public Long totalMemoryInBytes() { + return this.totalMemoryInBytes; + } + + /** + * Get the availableMemoryInBytes property: The available memory. + * + * @return the availableMemoryInBytes value. + */ + public Long availableMemoryInBytes() { + return this.availableMemoryInBytes; + } + + /** + * Get the usedMemoryInBytes property: The used memory. + * + * @return the usedMemoryInBytes value. + */ + public Long usedMemoryInBytes() { + return this.usedMemoryInBytes; + } + + /** + * Get the memoryUsagePercentage property: The memory usage percentage. + * + * @return the memoryUsagePercentage value. + */ + public Double memoryUsagePercentage() { + return this.memoryUsagePercentage; + } + + /** + * Get the totalSpaceInBytes property: The total disk space. + * + * @return the totalSpaceInBytes value. + */ + public Long totalSpaceInBytes() { + return this.totalSpaceInBytes; + } + + /** + * Get the availableSpaceInBytes property: The available disk space. + * + * @return the availableSpaceInBytes value. + */ + public Long availableSpaceInBytes() { + return this.availableSpaceInBytes; + } + + /** + * Get the usedSpaceInBytes property: The used disk space. + * + * @return the usedSpaceInBytes value. + */ + public Long usedSpaceInBytes() { + return this.usedSpaceInBytes; + } + + /** + * Get the freeSpacePercentage property: The free disk space percentage. + * + * @return the freeSpacePercentage value. + */ + public Double freeSpacePercentage() { + return this.freeSpacePercentage; + } + + /** + * Get the throughputUploadPendingDataInBytes property: The uploading pending data in bytes. + * + * @return the throughputUploadPendingDataInBytes value. + */ + public Long throughputUploadPendingDataInBytes() { + return this.throughputUploadPendingDataInBytes; + } + + /** + * Get the throughputInBytes property: The throughput in bytes. + * + * @return the throughputInBytes value. + */ + public Long throughputInBytes() { + return this.throughputInBytes; + } + + /** + * Get the processorUsagePercentage property: The processor usage percentage. + * + * @return the processorUsagePercentage value. + */ + public Double processorUsagePercentage() { + return this.processorUsagePercentage; + } + + /** + * Get the throughputStatus property: The throughput status. + * + * @return the throughputStatus value. + */ + public RcmComponentStatus throughputStatus() { + return this.throughputStatus; + } + + /** + * Get the systemLoad property: The system load. + * + * @return the systemLoad value. + */ + public Long systemLoad() { + return this.systemLoad; + } + + /** + * Get the systemLoadStatus property: The system load status. + * + * @return the systemLoadStatus value. + */ + public RcmComponentStatus systemLoadStatus() { + return this.systemLoadStatus; + } + + /** + * Get the diskUsageStatus property: The disk usage status. + * + * @return the diskUsageStatus value. + */ + public RcmComponentStatus diskUsageStatus() { + return this.diskUsageStatus; + } + + /** + * Get the memoryUsageStatus property: The memory usage status. + * + * @return the memoryUsageStatus value. + */ + public RcmComponentStatus memoryUsageStatus() { + return this.memoryUsageStatus; + } + + /** + * Get the processorUsageStatus property: The processor usage status. + * + * @return the processorUsageStatus value. + */ + public RcmComponentStatus processorUsageStatus() { + return this.processorUsageStatus; + } + + /** + * Get the health property: The health of the process server. + * + * @return the health value. + */ + public ProtectionHealth health() { + return this.health; + } + + /** + * Get the healthErrors property: The health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Get the protectedItemCount property: The protected item count. + * + * @return the protectedItemCount value. + */ + public Integer protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Get the historicHealth property: The historic health of the process server based on the health in last 24 hours. + * + * @return the historicHealth value. + */ + public ProtectionHealth historicHealth() { + return this.historicHealth; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItem.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItem.java new file mode 100644 index 000000000000..dfeedb829fb0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItem.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectableItemInner; + +/** An immutable client-side representation of ProtectableItem. */ +public interface ProtectableItem { + /** + * 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: The custom data. + * + * @return the properties value. + */ + ProtectableItemProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectableItemInner object. + * + * @return the inner object. + */ + ProtectableItemInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItemCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItemCollection.java new file mode 100644 index 000000000000..8c0ce502e0c5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItemCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectableItemInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protectable item collection. */ +@Fluent +public final class ProtectableItemCollection { + /* + * The Protectable item details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ProtectableItemCollection class. */ + public ProtectableItemCollection() { + } + + /** + * Get the value property: The Protectable item details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Protectable item details. + * + * @param value the value value to set. + * @return the ProtectableItemCollection object itself. + */ + public ProtectableItemCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the ProtectableItemCollection object itself. + */ + public ProtectableItemCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItemProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItemProperties.java new file mode 100644 index 000000000000..52299470d5a8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectableItemProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication protected item custom data details. */ +@Fluent +public final class ProtectableItemProperties { + /* + * The name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The protection status. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /* + * The ARM resource of protected items. + */ + @JsonProperty(value = "replicationProtectedItemId") + private String replicationProtectedItemId; + + /* + * The recovery provider ARM Id. + */ + @JsonProperty(value = "recoveryServicesProviderId") + private String recoveryServicesProviderId; + + /* + * The Current protection readiness errors. + */ + @JsonProperty(value = "protectionReadinessErrors") + private List protectionReadinessErrors; + + /* + * The list of replication providers supported for the protectable item. + */ + @JsonProperty(value = "supportedReplicationProviders") + private List supportedReplicationProviders; + + /* + * The Replication provider custom settings. + */ + @JsonProperty(value = "customDetails") + private ConfigurationSettings customDetails; + + /** Creates an instance of ProtectableItemProperties class. */ + public ProtectableItemProperties() { + } + + /** + * Get the friendlyName property: The name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The name. + * + * @param friendlyName the friendlyName value to set. + * @return the ProtectableItemProperties object itself. + */ + public ProtectableItemProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the protectionStatus property: The protection status. + * + * @return the protectionStatus value. + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set the protectionStatus property: The protection status. + * + * @param protectionStatus the protectionStatus value to set. + * @return the ProtectableItemProperties object itself. + */ + public ProtectableItemProperties withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get the replicationProtectedItemId property: The ARM resource of protected items. + * + * @return the replicationProtectedItemId value. + */ + public String replicationProtectedItemId() { + return this.replicationProtectedItemId; + } + + /** + * Set the replicationProtectedItemId property: The ARM resource of protected items. + * + * @param replicationProtectedItemId the replicationProtectedItemId value to set. + * @return the ProtectableItemProperties object itself. + */ + public ProtectableItemProperties withReplicationProtectedItemId(String replicationProtectedItemId) { + this.replicationProtectedItemId = replicationProtectedItemId; + return this; + } + + /** + * Get the recoveryServicesProviderId property: The recovery provider ARM Id. + * + * @return the recoveryServicesProviderId value. + */ + public String recoveryServicesProviderId() { + return this.recoveryServicesProviderId; + } + + /** + * Set the recoveryServicesProviderId property: The recovery provider ARM Id. + * + * @param recoveryServicesProviderId the recoveryServicesProviderId value to set. + * @return the ProtectableItemProperties object itself. + */ + public ProtectableItemProperties withRecoveryServicesProviderId(String recoveryServicesProviderId) { + this.recoveryServicesProviderId = recoveryServicesProviderId; + return this; + } + + /** + * Get the protectionReadinessErrors property: The Current protection readiness errors. + * + * @return the protectionReadinessErrors value. + */ + public List protectionReadinessErrors() { + return this.protectionReadinessErrors; + } + + /** + * Set the protectionReadinessErrors property: The Current protection readiness errors. + * + * @param protectionReadinessErrors the protectionReadinessErrors value to set. + * @return the ProtectableItemProperties object itself. + */ + public ProtectableItemProperties withProtectionReadinessErrors(List protectionReadinessErrors) { + this.protectionReadinessErrors = protectionReadinessErrors; + return this; + } + + /** + * Get the supportedReplicationProviders property: The list of replication providers supported for the protectable + * item. + * + * @return the supportedReplicationProviders value. + */ + public List supportedReplicationProviders() { + return this.supportedReplicationProviders; + } + + /** + * Set the supportedReplicationProviders property: The list of replication providers supported for the protectable + * item. + * + * @param supportedReplicationProviders the supportedReplicationProviders value to set. + * @return the ProtectableItemProperties object itself. + */ + public ProtectableItemProperties withSupportedReplicationProviders(List supportedReplicationProviders) { + this.supportedReplicationProviders = supportedReplicationProviders; + return this; + } + + /** + * Get the customDetails property: The Replication provider custom settings. + * + * @return the customDetails value. + */ + public ConfigurationSettings customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: The Replication provider custom settings. + * + * @param customDetails the customDetails value to set. + * @return the ProtectableItemProperties object itself. + */ + public ProtectableItemProperties withCustomDetails(ConfigurationSettings customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customDetails() != null) { + customDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainer.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainer.java new file mode 100644 index 000000000000..99498f5a2d73 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainer.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner; + +/** An immutable client-side representation of ProtectionContainer. */ +public interface ProtectionContainer { + /** + * 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: The custom data. + * + * @return the properties value. + */ + ProtectionContainerProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner + * object. + * + * @return the inner object. + */ + ProtectionContainerInner innerModel(); + + /** The entirety of the ProtectionContainer definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ProtectionContainer definition stages. */ + interface DefinitionStages { + /** The first stage of the ProtectionContainer definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ProtectionContainer definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName, fabricName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @return the next definition stage. + */ + WithCreate withExistingReplicationFabric(String resourceName, String resourceGroupName, String fabricName); + } + /** + * The stage of the ProtectionContainer 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProtectionContainer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProtectionContainer create(Context context); + } + /** The stage of the ProtectionContainer definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Create protection container input properties.. + * + * @param properties Create protection container input properties. + * @return the next definition stage. + */ + WithCreate withProperties(CreateProtectionContainerInputProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProtectionContainer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProtectionContainer refresh(Context context); + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + ProtectionContainer discoverProtectableItem(DiscoverProtectableItemRequest discoverProtectableItemRequest); + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @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 protection container details. + */ + ProtectionContainer discoverProtectableItem( + DiscoverProtectableItemRequest discoverProtectableItemRequest, Context context); + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @throws com.azure.core.management.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(); + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @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(Context context); + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param switchInput Switch protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + ProtectionContainer switchProtection(SwitchProtectionInput switchInput); + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param switchInput Switch protection input. + * @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 protection container details. + */ + ProtectionContainer switchProtection(SwitchProtectionInput switchInput, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerCollection.java new file mode 100644 index 000000000000..a8ef1629e9b8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protection Container collection. */ +@Fluent +public final class ProtectionContainerCollection { + /* + * The Protection Container details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ProtectionContainerCollection class. */ + public ProtectionContainerCollection() { + } + + /** + * Get the value property: The Protection Container details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Protection Container details. + * + * @param value the value value to set. + * @return the ProtectionContainerCollection object itself. + */ + public ProtectionContainerCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the ProtectionContainerCollection object itself. + */ + public ProtectionContainerCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerFabricSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerFabricSpecificDetails.java new file mode 100644 index 000000000000..30dfdfd0396b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerFabricSpecificDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base class for fabric specific details of container. */ +@Immutable +public final class ProtectionContainerFabricSpecificDetails { + /* + * Gets the class type. Overridden in derived classes. + */ + @JsonProperty(value = "instanceType", access = JsonProperty.Access.WRITE_ONLY) + private String instanceType; + + /** Creates an instance of ProtectionContainerFabricSpecificDetails class. */ + public ProtectionContainerFabricSpecificDetails() { + } + + /** + * Get the instanceType property: Gets the class type. Overridden in derived classes. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMapping.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMapping.java new file mode 100644 index 000000000000..d6e5e8e2e76b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMapping.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner; + +/** An immutable client-side representation of ProtectionContainerMapping. */ +public interface ProtectionContainerMapping { + /** + * 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: The custom data. + * + * @return the properties value. + */ + ProtectionContainerMappingProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * 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.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner object. + * + * @return the inner object. + */ + ProtectionContainerMappingInner innerModel(); + + /** The entirety of the ProtectionContainerMapping definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ProtectionContainerMapping definition stages. */ + interface DefinitionStages { + /** The first stage of the ProtectionContainerMapping definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ProtectionContainerMapping definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName, fabricName, protectionContainerName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @return the next definition stage. + */ + WithCreate withExistingReplicationProtectionContainer( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + } + /** + * The stage of the ProtectionContainerMapping 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProtectionContainerMapping create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProtectionContainerMapping create(Context context); + } + /** The stage of the ProtectionContainerMapping definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Configure protection input properties.. + * + * @param properties Configure protection input properties. + * @return the next definition stage. + */ + WithCreate withProperties(CreateProtectionContainerMappingInputProperties properties); + } + } + /** + * Begins update for the ProtectionContainerMapping resource. + * + * @return the stage of resource update. + */ + ProtectionContainerMapping.Update update(); + + /** The template for ProtectionContainerMapping update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProtectionContainerMapping apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProtectionContainerMapping apply(Context context); + } + /** The ProtectionContainerMapping update stages. */ + interface UpdateStages { + /** The stage of the ProtectionContainerMapping update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Update protection container mapping input properties.. + * + * @param properties Update protection container mapping input properties. + * @return the next definition stage. + */ + Update withProperties(UpdateProtectionContainerMappingInputProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProtectionContainerMapping refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProtectionContainerMapping refresh(Context context); + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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(RemoveProtectionContainerMappingInput removalInput); + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param removalInput Removal input. + * @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(RemoveProtectionContainerMappingInput removalInput, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingCollection.java new file mode 100644 index 000000000000..e34d90d6b5a9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protection container mapping collection class. */ +@Fluent +public final class ProtectionContainerMappingCollection { + /* + * List of container mappings. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to fetch rest of the data. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ProtectionContainerMappingCollection class. */ + public ProtectionContainerMappingCollection() { + } + + /** + * Get the value property: List of container mappings. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of container mappings. + * + * @param value the value value to set. + * @return the ProtectionContainerMappingCollection object itself. + */ + public ProtectionContainerMappingCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to fetch rest of the data. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to fetch rest of the data. + * + * @param nextLink the nextLink value to set. + * @return the ProtectionContainerMappingCollection object itself. + */ + public ProtectionContainerMappingCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingProperties.java new file mode 100644 index 000000000000..a073a9706fcf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingProperties.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protection container mapping properties. */ +@Fluent +public final class ProtectionContainerMappingProperties { + /* + * Paired protection container ARM ID. + */ + @JsonProperty(value = "targetProtectionContainerId") + private String targetProtectionContainerId; + + /* + * Friendly name of paired container. + */ + @JsonProperty(value = "targetProtectionContainerFriendlyName") + private String targetProtectionContainerFriendlyName; + + /* + * Provider specific provider details. + */ + @JsonProperty(value = "providerSpecificDetails") + private ProtectionContainerMappingProviderSpecificDetails providerSpecificDetails; + + /* + * Health of pairing. + */ + @JsonProperty(value = "health") + private String health; + + /* + * Health error. + */ + @JsonProperty(value = "healthErrorDetails") + private List healthErrorDetails; + + /* + * Policy ARM Id. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * Association Status. + */ + @JsonProperty(value = "state") + private String state; + + /* + * Friendly name of source protection container. + */ + @JsonProperty(value = "sourceProtectionContainerFriendlyName") + private String sourceProtectionContainerFriendlyName; + + /* + * Friendly name of source fabric. + */ + @JsonProperty(value = "sourceFabricFriendlyName") + private String sourceFabricFriendlyName; + + /* + * Friendly name of target fabric. + */ + @JsonProperty(value = "targetFabricFriendlyName") + private String targetFabricFriendlyName; + + /* + * Friendly name of replication policy. + */ + @JsonProperty(value = "policyFriendlyName") + private String policyFriendlyName; + + /** Creates an instance of ProtectionContainerMappingProperties class. */ + public ProtectionContainerMappingProperties() { + } + + /** + * Get the targetProtectionContainerId property: Paired protection container ARM ID. + * + * @return the targetProtectionContainerId value. + */ + public String targetProtectionContainerId() { + return this.targetProtectionContainerId; + } + + /** + * Set the targetProtectionContainerId property: Paired protection container ARM ID. + * + * @param targetProtectionContainerId the targetProtectionContainerId value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withTargetProtectionContainerId(String targetProtectionContainerId) { + this.targetProtectionContainerId = targetProtectionContainerId; + return this; + } + + /** + * Get the targetProtectionContainerFriendlyName property: Friendly name of paired container. + * + * @return the targetProtectionContainerFriendlyName value. + */ + public String targetProtectionContainerFriendlyName() { + return this.targetProtectionContainerFriendlyName; + } + + /** + * Set the targetProtectionContainerFriendlyName property: Friendly name of paired container. + * + * @param targetProtectionContainerFriendlyName the targetProtectionContainerFriendlyName value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withTargetProtectionContainerFriendlyName( + String targetProtectionContainerFriendlyName) { + this.targetProtectionContainerFriendlyName = targetProtectionContainerFriendlyName; + return this; + } + + /** + * Get the providerSpecificDetails property: Provider specific provider details. + * + * @return the providerSpecificDetails value. + */ + public ProtectionContainerMappingProviderSpecificDetails providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: Provider specific provider details. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withProviderSpecificDetails( + ProtectionContainerMappingProviderSpecificDetails providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Get the health property: Health of pairing. + * + * @return the health value. + */ + public String health() { + return this.health; + } + + /** + * Set the health property: Health of pairing. + * + * @param health the health value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withHealth(String health) { + this.health = health; + return this; + } + + /** + * Get the healthErrorDetails property: Health error. + * + * @return the healthErrorDetails value. + */ + public List healthErrorDetails() { + return this.healthErrorDetails; + } + + /** + * Set the healthErrorDetails property: Health error. + * + * @param healthErrorDetails the healthErrorDetails value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withHealthErrorDetails(List healthErrorDetails) { + this.healthErrorDetails = healthErrorDetails; + return this; + } + + /** + * Get the policyId property: Policy ARM Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: Policy ARM Id. + * + * @param policyId the policyId value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the state property: Association Status. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: Association Status. + * + * @param state the state value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withState(String state) { + this.state = state; + return this; + } + + /** + * Get the sourceProtectionContainerFriendlyName property: Friendly name of source protection container. + * + * @return the sourceProtectionContainerFriendlyName value. + */ + public String sourceProtectionContainerFriendlyName() { + return this.sourceProtectionContainerFriendlyName; + } + + /** + * Set the sourceProtectionContainerFriendlyName property: Friendly name of source protection container. + * + * @param sourceProtectionContainerFriendlyName the sourceProtectionContainerFriendlyName value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withSourceProtectionContainerFriendlyName( + String sourceProtectionContainerFriendlyName) { + this.sourceProtectionContainerFriendlyName = sourceProtectionContainerFriendlyName; + return this; + } + + /** + * Get the sourceFabricFriendlyName property: Friendly name of source fabric. + * + * @return the sourceFabricFriendlyName value. + */ + public String sourceFabricFriendlyName() { + return this.sourceFabricFriendlyName; + } + + /** + * Set the sourceFabricFriendlyName property: Friendly name of source fabric. + * + * @param sourceFabricFriendlyName the sourceFabricFriendlyName value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withSourceFabricFriendlyName(String sourceFabricFriendlyName) { + this.sourceFabricFriendlyName = sourceFabricFriendlyName; + return this; + } + + /** + * Get the targetFabricFriendlyName property: Friendly name of target fabric. + * + * @return the targetFabricFriendlyName value. + */ + public String targetFabricFriendlyName() { + return this.targetFabricFriendlyName; + } + + /** + * Set the targetFabricFriendlyName property: Friendly name of target fabric. + * + * @param targetFabricFriendlyName the targetFabricFriendlyName value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withTargetFabricFriendlyName(String targetFabricFriendlyName) { + this.targetFabricFriendlyName = targetFabricFriendlyName; + return this; + } + + /** + * Get the policyFriendlyName property: Friendly name of replication policy. + * + * @return the policyFriendlyName value. + */ + public String policyFriendlyName() { + return this.policyFriendlyName; + } + + /** + * Set the policyFriendlyName property: Friendly name of replication policy. + * + * @param policyFriendlyName the policyFriendlyName value to set. + * @return the ProtectionContainerMappingProperties object itself. + */ + public ProtectionContainerMappingProperties withPolicyFriendlyName(String policyFriendlyName) { + this.policyFriendlyName = policyFriendlyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + if (healthErrorDetails() != null) { + healthErrorDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingProviderSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingProviderSpecificDetails.java new file mode 100644 index 000000000000..48f15d661da3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMappingProviderSpecificDetails.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.recoveryservicessiterecovery.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; + +/** Container mapping provider specific details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ProtectionContainerMappingProviderSpecificDetails.class) +@JsonTypeName("ProtectionContainerMappingProviderSpecificDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AProtectionContainerMappingDetails.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmProtectionContainerMappingDetails.class), + @JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtProtectionContainerMappingDetails.class) +}) +@Immutable +public class ProtectionContainerMappingProviderSpecificDetails { + /** Creates an instance of ProtectionContainerMappingProviderSpecificDetails class. */ + public ProtectionContainerMappingProviderSpecificDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerProperties.java new file mode 100644 index 000000000000..40f5947102d1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerProperties.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection profile custom data details. */ +@Fluent +public final class ProtectionContainerProperties { + /* + * Fabric friendly name. + */ + @JsonProperty(value = "fabricFriendlyName") + private String fabricFriendlyName; + + /* + * The name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The fabric type. + */ + @JsonProperty(value = "fabricType") + private String fabricType; + + /* + * Number of protected PEs. + */ + @JsonProperty(value = "protectedItemCount") + private Integer protectedItemCount; + + /* + * The pairing status of this cloud. + */ + @JsonProperty(value = "pairingStatus") + private String pairingStatus; + + /* + * The role of this cloud. + */ + @JsonProperty(value = "role") + private String role; + + /* + * Fabric specific details. + */ + @JsonProperty(value = "fabricSpecificDetails") + private ProtectionContainerFabricSpecificDetails fabricSpecificDetails; + + /** Creates an instance of ProtectionContainerProperties class. */ + public ProtectionContainerProperties() { + } + + /** + * Get the fabricFriendlyName property: Fabric friendly name. + * + * @return the fabricFriendlyName value. + */ + public String fabricFriendlyName() { + return this.fabricFriendlyName; + } + + /** + * Set the fabricFriendlyName property: Fabric friendly name. + * + * @param fabricFriendlyName the fabricFriendlyName value to set. + * @return the ProtectionContainerProperties object itself. + */ + public ProtectionContainerProperties withFabricFriendlyName(String fabricFriendlyName) { + this.fabricFriendlyName = fabricFriendlyName; + return this; + } + + /** + * Get the friendlyName property: The name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The name. + * + * @param friendlyName the friendlyName value to set. + * @return the ProtectionContainerProperties object itself. + */ + public ProtectionContainerProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the fabricType property: The fabric type. + * + * @return the fabricType value. + */ + public String fabricType() { + return this.fabricType; + } + + /** + * Set the fabricType property: The fabric type. + * + * @param fabricType the fabricType value to set. + * @return the ProtectionContainerProperties object itself. + */ + public ProtectionContainerProperties withFabricType(String fabricType) { + this.fabricType = fabricType; + return this; + } + + /** + * Get the protectedItemCount property: Number of protected PEs. + * + * @return the protectedItemCount value. + */ + public Integer protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set the protectedItemCount property: Number of protected PEs. + * + * @param protectedItemCount the protectedItemCount value to set. + * @return the ProtectionContainerProperties object itself. + */ + public ProtectionContainerProperties withProtectedItemCount(Integer protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + + /** + * Get the pairingStatus property: The pairing status of this cloud. + * + * @return the pairingStatus value. + */ + public String pairingStatus() { + return this.pairingStatus; + } + + /** + * Set the pairingStatus property: The pairing status of this cloud. + * + * @param pairingStatus the pairingStatus value to set. + * @return the ProtectionContainerProperties object itself. + */ + public ProtectionContainerProperties withPairingStatus(String pairingStatus) { + this.pairingStatus = pairingStatus; + return this; + } + + /** + * Get the role property: The role of this cloud. + * + * @return the role value. + */ + public String role() { + return this.role; + } + + /** + * Set the role property: The role of this cloud. + * + * @param role the role value to set. + * @return the ProtectionContainerProperties object itself. + */ + public ProtectionContainerProperties withRole(String role) { + this.role = role; + return this; + } + + /** + * Get the fabricSpecificDetails property: Fabric specific details. + * + * @return the fabricSpecificDetails value. + */ + public ProtectionContainerFabricSpecificDetails fabricSpecificDetails() { + return this.fabricSpecificDetails; + } + + /** + * Set the fabricSpecificDetails property: Fabric specific details. + * + * @param fabricSpecificDetails the fabricSpecificDetails value to set. + * @return the ProtectionContainerProperties object itself. + */ + public ProtectionContainerProperties withFabricSpecificDetails( + ProtectionContainerFabricSpecificDetails fabricSpecificDetails) { + this.fabricSpecificDetails = fabricSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fabricSpecificDetails() != null) { + fabricSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionHealth.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionHealth.java new file mode 100644 index 000000000000..bbd29c9ef2a0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionHealth.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The health. */ +public final class ProtectionHealth extends ExpandableStringEnum { + /** Static value None for ProtectionHealth. */ + public static final ProtectionHealth NONE = fromString("None"); + + /** Static value Normal for ProtectionHealth. */ + public static final ProtectionHealth NORMAL = fromString("Normal"); + + /** Static value Warning for ProtectionHealth. */ + public static final ProtectionHealth WARNING = fromString("Warning"); + + /** Static value Critical for ProtectionHealth. */ + public static final ProtectionHealth CRITICAL = fromString("Critical"); + + /** + * Creates or finds a ProtectionHealth from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectionHealth. + */ + @JsonCreator + public static ProtectionHealth fromString(String name) { + return fromString(name, ProtectionHealth.class); + } + + /** + * Gets known ProtectionHealth values. + * + * @return known ProtectionHealth values. + */ + public static Collection values() { + return values(ProtectionHealth.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionProfileCustomDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionProfileCustomDetails.java new file mode 100644 index 000000000000..091980fab80c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionProfileCustomDetails.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.recoveryservicessiterecovery.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; + +/** Protection Profile custom input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resourceType", + defaultImpl = ProtectionProfileCustomDetails.class) +@JsonTypeName("ProtectionProfileCustomDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Existing", value = ExistingProtectionProfile.class), + @JsonSubTypes.Type(name = "New", value = NewProtectionProfile.class) +}) +@Immutable +public class ProtectionProfileCustomDetails { + /** Creates an instance of ProtectionProfileCustomDetails class. */ + public ProtectionProfileCustomDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderError.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderError.java new file mode 100644 index 000000000000..77692f952c63 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderError.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This class contains the error details per object. */ +@Fluent +public final class ProviderError { + /* + * The Error code. + */ + @JsonProperty(value = "errorCode") + private Integer errorCode; + + /* + * The Error message. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * The Provider error Id. + */ + @JsonProperty(value = "errorId") + private String errorId; + + /* + * The possible causes for the error. + */ + @JsonProperty(value = "possibleCauses") + private String possibleCauses; + + /* + * The recommended action to resolve the error. + */ + @JsonProperty(value = "recommendedAction") + private String recommendedAction; + + /** Creates an instance of ProviderError class. */ + public ProviderError() { + } + + /** + * Get the errorCode property: The Error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: The Error code. + * + * @param errorCode the errorCode value to set. + * @return the ProviderError object itself. + */ + public ProviderError withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: The Error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: The Error message. + * + * @param errorMessage the errorMessage value to set. + * @return the ProviderError object itself. + */ + public ProviderError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the errorId property: The Provider error Id. + * + * @return the errorId value. + */ + public String errorId() { + return this.errorId; + } + + /** + * Set the errorId property: The Provider error Id. + * + * @param errorId the errorId value to set. + * @return the ProviderError object itself. + */ + public ProviderError withErrorId(String errorId) { + this.errorId = errorId; + return this; + } + + /** + * Get the possibleCauses property: The possible causes for the error. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Set the possibleCauses property: The possible causes for the error. + * + * @param possibleCauses the possibleCauses value to set. + * @return the ProviderError object itself. + */ + public ProviderError withPossibleCauses(String possibleCauses) { + this.possibleCauses = possibleCauses; + return this; + } + + /** + * Get the recommendedAction property: The recommended action to resolve the error. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Set the recommendedAction property: The recommended action to resolve the error. + * + * @param recommendedAction the recommendedAction value to set. + * @return the ProviderError object itself. + */ + public ProviderError withRecommendedAction(String recommendedAction) { + this.recommendedAction = recommendedAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderSpecificRecoveryPointDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderSpecificRecoveryPointDetails.java new file mode 100644 index 000000000000..ba4855daee1b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderSpecificRecoveryPointDetails.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.recoveryservicessiterecovery.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 provider specific recovery point details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ProviderSpecificRecoveryPointDetails.class) +@JsonTypeName("ProviderSpecificRecoveryPointDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2ARecoveryPointDetails.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2RecoveryPointDetails.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmRecoveryPointDetails.class) +}) +@Immutable +public class ProviderSpecificRecoveryPointDetails { + /** Creates an instance of ProviderSpecificRecoveryPointDetails class. */ + public ProviderSpecificRecoveryPointDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PushInstallerDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PushInstallerDetails.java new file mode 100644 index 000000000000..4dc9d98d0684 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PushInstallerDetails.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Push installer details. */ +@Immutable +public final class PushInstallerDetails { + /* + * The push installer Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The push installer name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The push installer Bios Id. + */ + @JsonProperty(value = "biosId", access = JsonProperty.Access.WRITE_ONLY) + private String biosId; + + /* + * The fabric object Id. + */ + @JsonProperty(value = "fabricObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricObjectId; + + /* + * The push installer Fqdn. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The last heartbeat received from the push installer. + */ + @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeatUtc; + + /* + * The health of the push installer. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth health; + + /* + * The health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /** Creates an instance of PushInstallerDetails class. */ + public PushInstallerDetails() { + } + + /** + * Get the id property: The push installer Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The push installer name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the biosId property: The push installer Bios Id. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Get the fabricObjectId property: The fabric object Id. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Get the fqdn property: The push installer Fqdn. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the lastHeartbeatUtc property: The last heartbeat received from the push installer. + * + * @return the lastHeartbeatUtc value. + */ + public OffsetDateTime lastHeartbeatUtc() { + return this.lastHeartbeatUtc; + } + + /** + * Get the health property: The health of the push installer. + * + * @return the health value. + */ + public ProtectionHealth health() { + return this.health; + } + + /** + * Get the healthErrors property: The health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmComponentStatus.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmComponentStatus.java new file mode 100644 index 000000000000..258502f9de5a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmComponentStatus.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The throughput status. */ +public final class RcmComponentStatus extends ExpandableStringEnum { + /** Static value Healthy for RcmComponentStatus. */ + public static final RcmComponentStatus HEALTHY = fromString("Healthy"); + + /** Static value Warning for RcmComponentStatus. */ + public static final RcmComponentStatus WARNING = fromString("Warning"); + + /** Static value Critical for RcmComponentStatus. */ + public static final RcmComponentStatus CRITICAL = fromString("Critical"); + + /** Static value Unknown for RcmComponentStatus. */ + public static final RcmComponentStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a RcmComponentStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RcmComponentStatus. + */ + @JsonCreator + public static RcmComponentStatus fromString(String name) { + return fromString(name, RcmComponentStatus.class); + } + + /** + * Gets known RcmComponentStatus values. + * + * @return known RcmComponentStatus values. + */ + public static Collection values() { + return values(RcmComponentStatus.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmProxyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmProxyDetails.java new file mode 100644 index 000000000000..1769a3f1047e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmProxyDetails.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** RCM proxy details. */ +@Immutable +public final class RcmProxyDetails { + /* + * The RCM proxy Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The RCM proxy name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The RCM proxy Bios Id. + */ + @JsonProperty(value = "biosId", access = JsonProperty.Access.WRITE_ONLY) + private String biosId; + + /* + * The fabric object Id. + */ + @JsonProperty(value = "fabricObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricObjectId; + + /* + * The RCM proxy Fqdn. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The client authentication type. + */ + @JsonProperty(value = "clientAuthenticationType", access = JsonProperty.Access.WRITE_ONLY) + private String clientAuthenticationType; + + /* + * The version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The last heartbeat received from the RCM proxy. + */ + @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeatUtc; + + /* + * The health of the RCM proxy. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth health; + + /* + * The health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /** Creates an instance of RcmProxyDetails class. */ + public RcmProxyDetails() { + } + + /** + * Get the id property: The RCM proxy Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The RCM proxy name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the biosId property: The RCM proxy Bios Id. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Get the fabricObjectId property: The fabric object Id. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Get the fqdn property: The RCM proxy Fqdn. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the clientAuthenticationType property: The client authentication type. + * + * @return the clientAuthenticationType value. + */ + public String clientAuthenticationType() { + return this.clientAuthenticationType; + } + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the lastHeartbeatUtc property: The last heartbeat received from the RCM proxy. + * + * @return the lastHeartbeatUtc value. + */ + public OffsetDateTime lastHeartbeatUtc() { + return this.lastHeartbeatUtc; + } + + /** + * Get the health property: The health of the RCM proxy. + * + * @return the health value. + */ + public ProtectionHealth health() { + return this.health; + } + + /** + * Get the healthErrors property: The health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryAvailabilitySetCustomDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryAvailabilitySetCustomDetails.java new file mode 100644 index 000000000000..5e70e3b24229 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryAvailabilitySetCustomDetails.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.recoveryservicessiterecovery.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 Availability Set custom input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resourceType", + defaultImpl = RecoveryAvailabilitySetCustomDetails.class) +@JsonTypeName("RecoveryAvailabilitySetCustomDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "Existing", value = ExistingRecoveryAvailabilitySet.class)}) +@Immutable +public class RecoveryAvailabilitySetCustomDetails { + /** Creates an instance of RecoveryAvailabilitySetCustomDetails class. */ + public RecoveryAvailabilitySetCustomDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlan.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlan.java new file mode 100644 index 000000000000..d43508d34ad2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlan.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner; + +/** An immutable client-side representation of RecoveryPlan. */ +public interface RecoveryPlan { + /** + * 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: The custom details. + * + * @return the properties value. + */ + RecoveryPlanProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * 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.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner object. + * + * @return the inner object. + */ + RecoveryPlanInner innerModel(); + + /** The entirety of the RecoveryPlan definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The RecoveryPlan definition stages. */ + interface DefinitionStages { + /** The first stage of the RecoveryPlan definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the RecoveryPlan definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @return the next definition stage. + */ + WithProperties withExistingVault(String resourceName, String resourceGroupName); + } + /** The stage of the RecoveryPlan definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Recovery plan creation properties.. + * + * @param properties Recovery plan creation properties. + * @return the next definition stage. + */ + WithCreate withProperties(CreateRecoveryPlanInputProperties properties); + } + /** + * The stage of the RecoveryPlan 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. + */ + RecoveryPlan create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RecoveryPlan create(Context context); + } + } + /** + * Begins update for the RecoveryPlan resource. + * + * @return the stage of resource update. + */ + RecoveryPlan.Update update(); + + /** The template for RecoveryPlan update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RecoveryPlan apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RecoveryPlan apply(Context context); + } + /** The RecoveryPlan update stages. */ + interface UpdateStages { + /** The stage of the RecoveryPlan update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Recovery plan update properties.. + * + * @param properties Recovery plan update properties. + * @return the next definition stage. + */ + Update withProperties(UpdateRecoveryPlanInputProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RecoveryPlan refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RecoveryPlan refresh(Context context); + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan failoverCancel(); + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @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 recovery plan details. + */ + RecoveryPlan failoverCancel(Context context); + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan failoverCommit(); + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @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 recovery plan details. + */ + RecoveryPlan failoverCommit(Context context); + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param input Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan plannedFailover(RecoveryPlanPlannedFailoverInput input); + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param input Failover input. + * @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 recovery plan details. + */ + RecoveryPlan plannedFailover(RecoveryPlanPlannedFailoverInput input, Context context); + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan reprotect(); + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @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 recovery plan details. + */ + RecoveryPlan reprotect(Context context); + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param input Recovery plan test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan testFailover(RecoveryPlanTestFailoverInput input); + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param input Recovery plan test failover input. + * @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 recovery plan details. + */ + RecoveryPlan testFailover(RecoveryPlanTestFailoverInput input, Context context); + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param input Recovery plan test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan testFailoverCleanup(RecoveryPlanTestFailoverCleanupInput input); + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param input Recovery plan test failover cleanup input. + * @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 recovery plan details. + */ + RecoveryPlan testFailoverCleanup(RecoveryPlanTestFailoverCleanupInput input, Context context); + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param input Recovery plan unplanned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan unplannedFailover(RecoveryPlanUnplannedFailoverInput input); + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param input Recovery plan unplanned failover input. + * @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 recovery plan details. + */ + RecoveryPlan unplannedFailover(RecoveryPlanUnplannedFailoverInput input, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2ADetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2ADetails.java new file mode 100644 index 000000000000..252d318344cc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2ADetails.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.recoveryservicessiterecovery.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; + +/** Recovery plan A2A specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class RecoveryPlanA2ADetails extends RecoveryPlanProviderSpecificDetails { + /* + * The primary zone. + */ + @JsonProperty(value = "primaryZone") + private String primaryZone; + + /* + * The recovery zone. + */ + @JsonProperty(value = "recoveryZone") + private String recoveryZone; + + /* + * The primary extended location. + */ + @JsonProperty(value = "primaryExtendedLocation") + private ExtendedLocation primaryExtendedLocation; + + /* + * The recovery extended location. + */ + @JsonProperty(value = "recoveryExtendedLocation") + private ExtendedLocation recoveryExtendedLocation; + + /** Creates an instance of RecoveryPlanA2ADetails class. */ + public RecoveryPlanA2ADetails() { + } + + /** + * Get the primaryZone property: The primary zone. + * + * @return the primaryZone value. + */ + public String primaryZone() { + return this.primaryZone; + } + + /** + * Set the primaryZone property: The primary zone. + * + * @param primaryZone the primaryZone value to set. + * @return the RecoveryPlanA2ADetails object itself. + */ + public RecoveryPlanA2ADetails withPrimaryZone(String primaryZone) { + this.primaryZone = primaryZone; + return this; + } + + /** + * Get the recoveryZone property: The recovery zone. + * + * @return the recoveryZone value. + */ + public String recoveryZone() { + return this.recoveryZone; + } + + /** + * Set the recoveryZone property: The recovery zone. + * + * @param recoveryZone the recoveryZone value to set. + * @return the RecoveryPlanA2ADetails object itself. + */ + public RecoveryPlanA2ADetails withRecoveryZone(String recoveryZone) { + this.recoveryZone = recoveryZone; + return this; + } + + /** + * Get the primaryExtendedLocation property: The primary extended location. + * + * @return the primaryExtendedLocation value. + */ + public ExtendedLocation primaryExtendedLocation() { + return this.primaryExtendedLocation; + } + + /** + * Set the primaryExtendedLocation property: The primary extended location. + * + * @param primaryExtendedLocation the primaryExtendedLocation value to set. + * @return the RecoveryPlanA2ADetails object itself. + */ + public RecoveryPlanA2ADetails withPrimaryExtendedLocation(ExtendedLocation primaryExtendedLocation) { + this.primaryExtendedLocation = primaryExtendedLocation; + return this; + } + + /** + * Get the recoveryExtendedLocation property: The recovery extended location. + * + * @return the recoveryExtendedLocation value. + */ + public ExtendedLocation recoveryExtendedLocation() { + return this.recoveryExtendedLocation; + } + + /** + * Set the recoveryExtendedLocation property: The recovery extended location. + * + * @param recoveryExtendedLocation the recoveryExtendedLocation value to set. + * @return the RecoveryPlanA2ADetails object itself. + */ + public RecoveryPlanA2ADetails withRecoveryExtendedLocation(ExtendedLocation recoveryExtendedLocation) { + this.recoveryExtendedLocation = recoveryExtendedLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (primaryExtendedLocation() != null) { + primaryExtendedLocation().validate(); + } + if (recoveryExtendedLocation() != null) { + recoveryExtendedLocation().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AFailoverInput.java new file mode 100644 index 000000000000..78f4152520f6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AFailoverInput.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.recoveryservicessiterecovery.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; + +/** Recovery plan A2A failover input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class RecoveryPlanA2AFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType", required = true) + private A2ARpRecoveryPointType recoveryPointType; + + /* + * A value indicating whether to use recovery cloud service for TFO or not. + */ + @JsonProperty(value = "cloudServiceCreationOption") + private String cloudServiceCreationOption; + + /* + * A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + */ + @JsonProperty(value = "multiVmSyncPointOption") + private MultiVmSyncPointOption multiVmSyncPointOption; + + /** Creates an instance of RecoveryPlanA2AFailoverInput class. */ + public RecoveryPlanA2AFailoverInput() { + } + + /** + * Get the recoveryPointType property: The recovery point type. + * + * @return the recoveryPointType value. + */ + public A2ARpRecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the RecoveryPlanA2AFailoverInput object itself. + */ + public RecoveryPlanA2AFailoverInput withRecoveryPointType(A2ARpRecoveryPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the cloudServiceCreationOption property: A value indicating whether to use recovery cloud service for TFO or + * not. + * + * @return the cloudServiceCreationOption value. + */ + public String cloudServiceCreationOption() { + return this.cloudServiceCreationOption; + } + + /** + * Set the cloudServiceCreationOption property: A value indicating whether to use recovery cloud service for TFO or + * not. + * + * @param cloudServiceCreationOption the cloudServiceCreationOption value to set. + * @return the RecoveryPlanA2AFailoverInput object itself. + */ + public RecoveryPlanA2AFailoverInput withCloudServiceCreationOption(String cloudServiceCreationOption) { + this.cloudServiceCreationOption = cloudServiceCreationOption; + return this; + } + + /** + * Get the multiVmSyncPointOption property: A value indicating whether multi VM sync enabled VMs should use multi VM + * sync points for failover. + * + * @return the multiVmSyncPointOption value. + */ + public MultiVmSyncPointOption multiVmSyncPointOption() { + return this.multiVmSyncPointOption; + } + + /** + * Set the multiVmSyncPointOption property: A value indicating whether multi VM sync enabled VMs should use multi VM + * sync points for failover. + * + * @param multiVmSyncPointOption the multiVmSyncPointOption value to set. + * @return the RecoveryPlanA2AFailoverInput object itself. + */ + public RecoveryPlanA2AFailoverInput withMultiVmSyncPointOption(MultiVmSyncPointOption multiVmSyncPointOption) { + this.multiVmSyncPointOption = multiVmSyncPointOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointType in model RecoveryPlanA2AFailoverInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanA2AFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AInput.java new file mode 100644 index 000000000000..010d8990d827 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AInput.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.recoveryservicessiterecovery.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; + +/** Recovery plan A2A input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class RecoveryPlanA2AInput extends RecoveryPlanProviderSpecificInput { + /* + * The primary zone. + */ + @JsonProperty(value = "primaryZone") + private String primaryZone; + + /* + * The recovery zone. + */ + @JsonProperty(value = "recoveryZone") + private String recoveryZone; + + /* + * The primary extended location. + */ + @JsonProperty(value = "primaryExtendedLocation") + private ExtendedLocation primaryExtendedLocation; + + /* + * The recovery extended location. + */ + @JsonProperty(value = "recoveryExtendedLocation") + private ExtendedLocation recoveryExtendedLocation; + + /** Creates an instance of RecoveryPlanA2AInput class. */ + public RecoveryPlanA2AInput() { + } + + /** + * Get the primaryZone property: The primary zone. + * + * @return the primaryZone value. + */ + public String primaryZone() { + return this.primaryZone; + } + + /** + * Set the primaryZone property: The primary zone. + * + * @param primaryZone the primaryZone value to set. + * @return the RecoveryPlanA2AInput object itself. + */ + public RecoveryPlanA2AInput withPrimaryZone(String primaryZone) { + this.primaryZone = primaryZone; + return this; + } + + /** + * Get the recoveryZone property: The recovery zone. + * + * @return the recoveryZone value. + */ + public String recoveryZone() { + return this.recoveryZone; + } + + /** + * Set the recoveryZone property: The recovery zone. + * + * @param recoveryZone the recoveryZone value to set. + * @return the RecoveryPlanA2AInput object itself. + */ + public RecoveryPlanA2AInput withRecoveryZone(String recoveryZone) { + this.recoveryZone = recoveryZone; + return this; + } + + /** + * Get the primaryExtendedLocation property: The primary extended location. + * + * @return the primaryExtendedLocation value. + */ + public ExtendedLocation primaryExtendedLocation() { + return this.primaryExtendedLocation; + } + + /** + * Set the primaryExtendedLocation property: The primary extended location. + * + * @param primaryExtendedLocation the primaryExtendedLocation value to set. + * @return the RecoveryPlanA2AInput object itself. + */ + public RecoveryPlanA2AInput withPrimaryExtendedLocation(ExtendedLocation primaryExtendedLocation) { + this.primaryExtendedLocation = primaryExtendedLocation; + return this; + } + + /** + * Get the recoveryExtendedLocation property: The recovery extended location. + * + * @return the recoveryExtendedLocation value. + */ + public ExtendedLocation recoveryExtendedLocation() { + return this.recoveryExtendedLocation; + } + + /** + * Set the recoveryExtendedLocation property: The recovery extended location. + * + * @param recoveryExtendedLocation the recoveryExtendedLocation value to set. + * @return the RecoveryPlanA2AInput object itself. + */ + public RecoveryPlanA2AInput withRecoveryExtendedLocation(ExtendedLocation recoveryExtendedLocation) { + this.recoveryExtendedLocation = recoveryExtendedLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (primaryExtendedLocation() != null) { + primaryExtendedLocation().validate(); + } + if (recoveryExtendedLocation() != null) { + recoveryExtendedLocation().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAction.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAction.java new file mode 100644 index 000000000000..6492aecee3aa --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAction.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan action details. */ +@Fluent +public final class RecoveryPlanAction { + /* + * The action name. + */ + @JsonProperty(value = "actionName", required = true) + private String actionName; + + /* + * The list of failover types. + */ + @JsonProperty(value = "failoverTypes", required = true) + private List failoverTypes; + + /* + * The list of failover directions. + */ + @JsonProperty(value = "failoverDirections", required = true) + private List failoverDirections; + + /* + * The custom details. + */ + @JsonProperty(value = "customDetails", required = true) + private RecoveryPlanActionDetails customDetails; + + /** Creates an instance of RecoveryPlanAction class. */ + public RecoveryPlanAction() { + } + + /** + * Get the actionName property: The action name. + * + * @return the actionName value. + */ + public String actionName() { + return this.actionName; + } + + /** + * Set the actionName property: The action name. + * + * @param actionName the actionName value to set. + * @return the RecoveryPlanAction object itself. + */ + public RecoveryPlanAction withActionName(String actionName) { + this.actionName = actionName; + return this; + } + + /** + * Get the failoverTypes property: The list of failover types. + * + * @return the failoverTypes value. + */ + public List failoverTypes() { + return this.failoverTypes; + } + + /** + * Set the failoverTypes property: The list of failover types. + * + * @param failoverTypes the failoverTypes value to set. + * @return the RecoveryPlanAction object itself. + */ + public RecoveryPlanAction withFailoverTypes(List failoverTypes) { + this.failoverTypes = failoverTypes; + return this; + } + + /** + * Get the failoverDirections property: The list of failover directions. + * + * @return the failoverDirections value. + */ + public List failoverDirections() { + return this.failoverDirections; + } + + /** + * Set the failoverDirections property: The list of failover directions. + * + * @param failoverDirections the failoverDirections value to set. + * @return the RecoveryPlanAction object itself. + */ + public RecoveryPlanAction withFailoverDirections(List failoverDirections) { + this.failoverDirections = failoverDirections; + return this; + } + + /** + * Get the customDetails property: The custom details. + * + * @return the customDetails value. + */ + public RecoveryPlanActionDetails customDetails() { + return this.customDetails; + } + + /** + * Set the customDetails property: The custom details. + * + * @param customDetails the customDetails value to set. + * @return the RecoveryPlanAction object itself. + */ + public RecoveryPlanAction withCustomDetails(RecoveryPlanActionDetails customDetails) { + this.customDetails = customDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property actionName in model RecoveryPlanAction")); + } + if (failoverTypes() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property failoverTypes in model RecoveryPlanAction")); + } + if (failoverDirections() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property failoverDirections in model RecoveryPlanAction")); + } + if (customDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customDetails in model RecoveryPlanAction")); + } else { + customDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanAction.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanActionDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanActionDetails.java new file mode 100644 index 000000000000..e6df9a5652b8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanActionDetails.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.recoveryservicessiterecovery.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 plan action custom details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = RecoveryPlanActionDetails.class) +@JsonTypeName("RecoveryPlanActionDetails") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AutomationRunbookActionDetails", + value = RecoveryPlanAutomationRunbookActionDetails.class), + @JsonSubTypes.Type(name = "ManualActionDetails", value = RecoveryPlanManualActionDetails.class), + @JsonSubTypes.Type(name = "ScriptActionDetails", value = RecoveryPlanScriptActionDetails.class) +}) +@Immutable +public class RecoveryPlanActionDetails { + /** Creates an instance of RecoveryPlanActionDetails class. */ + public RecoveryPlanActionDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanActionLocation.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanActionLocation.java new file mode 100644 index 000000000000..4a154cf32bce --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanActionLocation.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The fabric location. */ +public final class RecoveryPlanActionLocation extends ExpandableStringEnum { + /** Static value Primary for RecoveryPlanActionLocation. */ + public static final RecoveryPlanActionLocation PRIMARY = fromString("Primary"); + + /** Static value Recovery for RecoveryPlanActionLocation. */ + public static final RecoveryPlanActionLocation RECOVERY = fromString("Recovery"); + + /** + * Creates or finds a RecoveryPlanActionLocation from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryPlanActionLocation. + */ + @JsonCreator + public static RecoveryPlanActionLocation fromString(String name) { + return fromString(name, RecoveryPlanActionLocation.class); + } + + /** + * Gets known RecoveryPlanActionLocation values. + * + * @return known RecoveryPlanActionLocation values. + */ + public static Collection values() { + return values(RecoveryPlanActionLocation.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAutomationRunbookActionDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAutomationRunbookActionDetails.java new file mode 100644 index 000000000000..b2d906bad3b2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAutomationRunbookActionDetails.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.recoveryservicessiterecovery.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; + +/** Recovery plan Automation runbook action details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("AutomationRunbookActionDetails") +@Fluent +public final class RecoveryPlanAutomationRunbookActionDetails extends RecoveryPlanActionDetails { + /* + * The runbook ARM Id. + */ + @JsonProperty(value = "runbookId") + private String runbookId; + + /* + * The runbook timeout. + */ + @JsonProperty(value = "timeout") + private String timeout; + + /* + * The fabric location. + */ + @JsonProperty(value = "fabricLocation", required = true) + private RecoveryPlanActionLocation fabricLocation; + + /** Creates an instance of RecoveryPlanAutomationRunbookActionDetails class. */ + public RecoveryPlanAutomationRunbookActionDetails() { + } + + /** + * Get the runbookId property: The runbook ARM Id. + * + * @return the runbookId value. + */ + public String runbookId() { + return this.runbookId; + } + + /** + * Set the runbookId property: The runbook ARM Id. + * + * @param runbookId the runbookId value to set. + * @return the RecoveryPlanAutomationRunbookActionDetails object itself. + */ + public RecoveryPlanAutomationRunbookActionDetails withRunbookId(String runbookId) { + this.runbookId = runbookId; + return this; + } + + /** + * Get the timeout property: The runbook timeout. + * + * @return the timeout value. + */ + public String timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The runbook timeout. + * + * @param timeout the timeout value to set. + * @return the RecoveryPlanAutomationRunbookActionDetails object itself. + */ + public RecoveryPlanAutomationRunbookActionDetails withTimeout(String timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the fabricLocation property: The fabric location. + * + * @return the fabricLocation value. + */ + public RecoveryPlanActionLocation fabricLocation() { + return this.fabricLocation; + } + + /** + * Set the fabricLocation property: The fabric location. + * + * @param fabricLocation the fabricLocation value to set. + * @return the RecoveryPlanAutomationRunbookActionDetails object itself. + */ + public RecoveryPlanAutomationRunbookActionDetails withFabricLocation(RecoveryPlanActionLocation fabricLocation) { + this.fabricLocation = fabricLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (fabricLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fabricLocation in model" + + " RecoveryPlanAutomationRunbookActionDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanAutomationRunbookActionDetails.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanCollection.java new file mode 100644 index 000000000000..2c2952b1f113 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan collection details. */ +@Fluent +public final class RecoveryPlanCollection { + /* + * The list of recovery plans. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RecoveryPlanCollection class. */ + public RecoveryPlanCollection() { + } + + /** + * Get the value property: The list of recovery plans. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of recovery plans. + * + * @param value the value value to set. + * @return the RecoveryPlanCollection object itself. + */ + public RecoveryPlanCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the RecoveryPlanCollection object itself. + */ + public RecoveryPlanCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroup.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroup.java new file mode 100644 index 000000000000..a6c0f4374227 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroup.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan group details. */ +@Fluent +public final class RecoveryPlanGroup { + /* + * The group type. + */ + @JsonProperty(value = "groupType", required = true) + private RecoveryPlanGroupType groupType; + + /* + * The list of protected items. + */ + @JsonProperty(value = "replicationProtectedItems") + private List replicationProtectedItems; + + /* + * The start group actions. + */ + @JsonProperty(value = "startGroupActions") + private List startGroupActions; + + /* + * The end group actions. + */ + @JsonProperty(value = "endGroupActions") + private List endGroupActions; + + /** Creates an instance of RecoveryPlanGroup class. */ + public RecoveryPlanGroup() { + } + + /** + * Get the groupType property: The group type. + * + * @return the groupType value. + */ + public RecoveryPlanGroupType groupType() { + return this.groupType; + } + + /** + * Set the groupType property: The group type. + * + * @param groupType the groupType value to set. + * @return the RecoveryPlanGroup object itself. + */ + public RecoveryPlanGroup withGroupType(RecoveryPlanGroupType groupType) { + this.groupType = groupType; + return this; + } + + /** + * Get the replicationProtectedItems property: The list of protected items. + * + * @return the replicationProtectedItems value. + */ + public List replicationProtectedItems() { + return this.replicationProtectedItems; + } + + /** + * Set the replicationProtectedItems property: The list of protected items. + * + * @param replicationProtectedItems the replicationProtectedItems value to set. + * @return the RecoveryPlanGroup object itself. + */ + public RecoveryPlanGroup withReplicationProtectedItems(List replicationProtectedItems) { + this.replicationProtectedItems = replicationProtectedItems; + return this; + } + + /** + * Get the startGroupActions property: The start group actions. + * + * @return the startGroupActions value. + */ + public List startGroupActions() { + return this.startGroupActions; + } + + /** + * Set the startGroupActions property: The start group actions. + * + * @param startGroupActions the startGroupActions value to set. + * @return the RecoveryPlanGroup object itself. + */ + public RecoveryPlanGroup withStartGroupActions(List startGroupActions) { + this.startGroupActions = startGroupActions; + return this; + } + + /** + * Get the endGroupActions property: The end group actions. + * + * @return the endGroupActions value. + */ + public List endGroupActions() { + return this.endGroupActions; + } + + /** + * Set the endGroupActions property: The end group actions. + * + * @param endGroupActions the endGroupActions value to set. + * @return the RecoveryPlanGroup object itself. + */ + public RecoveryPlanGroup withEndGroupActions(List endGroupActions) { + this.endGroupActions = endGroupActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groupType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property groupType in model RecoveryPlanGroup")); + } + if (replicationProtectedItems() != null) { + replicationProtectedItems().forEach(e -> e.validate()); + } + if (startGroupActions() != null) { + startGroupActions().forEach(e -> e.validate()); + } + if (endGroupActions() != null) { + endGroupActions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanGroup.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupTaskDetails.java new file mode 100644 index 000000000000..729fcf7dd8b3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupTaskDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +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.List; + +/** This class represents the recovery plan group task. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = RecoveryPlanGroupTaskDetails.class) +@JsonTypeName("RecoveryPlanGroupTaskDetails") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "RecoveryPlanShutdownGroupTaskDetails", + value = RecoveryPlanShutdownGroupTaskDetails.class) +}) +@Fluent +public class RecoveryPlanGroupTaskDetails extends GroupTaskDetails { + /* + * The name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The group identifier. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * The group type. + */ + @JsonProperty(value = "rpGroupType") + private String rpGroupType; + + /** Creates an instance of RecoveryPlanGroupTaskDetails class. */ + public RecoveryPlanGroupTaskDetails() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name. + * + * @param name the name value to set. + * @return the RecoveryPlanGroupTaskDetails object itself. + */ + public RecoveryPlanGroupTaskDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the groupId property: The group identifier. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The group identifier. + * + * @param groupId the groupId value to set. + * @return the RecoveryPlanGroupTaskDetails object itself. + */ + public RecoveryPlanGroupTaskDetails withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the rpGroupType property: The group type. + * + * @return the rpGroupType value. + */ + public String rpGroupType() { + return this.rpGroupType; + } + + /** + * Set the rpGroupType property: The group type. + * + * @param rpGroupType the rpGroupType value to set. + * @return the RecoveryPlanGroupTaskDetails object itself. + */ + public RecoveryPlanGroupTaskDetails withRpGroupType(String rpGroupType) { + this.rpGroupType = rpGroupType; + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPlanGroupTaskDetails withChildTasks(List childTasks) { + super.withChildTasks(childTasks); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupType.java new file mode 100644 index 000000000000..114dd803001c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The group type. */ +public final class RecoveryPlanGroupType extends ExpandableStringEnum { + /** Static value Shutdown for RecoveryPlanGroupType. */ + public static final RecoveryPlanGroupType SHUTDOWN = fromString("Shutdown"); + + /** Static value Boot for RecoveryPlanGroupType. */ + public static final RecoveryPlanGroupType BOOT = fromString("Boot"); + + /** Static value Failover for RecoveryPlanGroupType. */ + public static final RecoveryPlanGroupType FAILOVER = fromString("Failover"); + + /** + * Creates or finds a RecoveryPlanGroupType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryPlanGroupType. + */ + @JsonCreator + public static RecoveryPlanGroupType fromString(String name) { + return fromString(name, RecoveryPlanGroupType.class); + } + + /** + * Gets known RecoveryPlanGroupType values. + * + * @return known RecoveryPlanGroupType values. + */ + public static Collection values() { + return values(RecoveryPlanGroupType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailbackInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailbackInput.java new file mode 100644 index 000000000000..b9b910eec593 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailbackInput.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.recoveryservicessiterecovery.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; + +/** Recovery plan HVR Azure failback input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzureFailback") +@Fluent +public final class RecoveryPlanHyperVReplicaAzureFailbackInput extends RecoveryPlanProviderSpecificFailoverInput { + /* + * The data sync option. + */ + @JsonProperty(value = "dataSyncOption", required = true) + private DataSyncStatus dataSyncOption; + + /* + * The ALR option. + */ + @JsonProperty(value = "recoveryVmCreationOption", required = true) + private AlternateLocationRecoveryOption recoveryVmCreationOption; + + /** Creates an instance of RecoveryPlanHyperVReplicaAzureFailbackInput class. */ + public RecoveryPlanHyperVReplicaAzureFailbackInput() { + } + + /** + * Get the dataSyncOption property: The data sync option. + * + * @return the dataSyncOption value. + */ + public DataSyncStatus dataSyncOption() { + return this.dataSyncOption; + } + + /** + * Set the dataSyncOption property: The data sync option. + * + * @param dataSyncOption the dataSyncOption value to set. + * @return the RecoveryPlanHyperVReplicaAzureFailbackInput object itself. + */ + public RecoveryPlanHyperVReplicaAzureFailbackInput withDataSyncOption(DataSyncStatus dataSyncOption) { + this.dataSyncOption = dataSyncOption; + return this; + } + + /** + * Get the recoveryVmCreationOption property: The ALR option. + * + * @return the recoveryVmCreationOption value. + */ + public AlternateLocationRecoveryOption recoveryVmCreationOption() { + return this.recoveryVmCreationOption; + } + + /** + * Set the recoveryVmCreationOption property: The ALR option. + * + * @param recoveryVmCreationOption the recoveryVmCreationOption value to set. + * @return the RecoveryPlanHyperVReplicaAzureFailbackInput object itself. + */ + public RecoveryPlanHyperVReplicaAzureFailbackInput withRecoveryVmCreationOption( + AlternateLocationRecoveryOption recoveryVmCreationOption) { + this.recoveryVmCreationOption = recoveryVmCreationOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataSyncOption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataSyncOption in model" + + " RecoveryPlanHyperVReplicaAzureFailbackInput")); + } + if (recoveryVmCreationOption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryVmCreationOption in model" + + " RecoveryPlanHyperVReplicaAzureFailbackInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanHyperVReplicaAzureFailbackInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailoverInput.java new file mode 100644 index 000000000000..d1bcff51e6df --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailoverInput.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.recoveryservicessiterecovery.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; + +/** Recovery plan HVR Azure failover input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class RecoveryPlanHyperVReplicaAzureFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { + /* + * The primary KEK certificate PFX. + */ + @JsonProperty(value = "primaryKekCertificatePfx") + private String primaryKekCertificatePfx; + + /* + * The secondary KEK certificate PFX. + */ + @JsonProperty(value = "secondaryKekCertificatePfx") + private String secondaryKekCertificatePfx; + + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType") + private HyperVReplicaAzureRpRecoveryPointType recoveryPointType; + + /** Creates an instance of RecoveryPlanHyperVReplicaAzureFailoverInput class. */ + public RecoveryPlanHyperVReplicaAzureFailoverInput() { + } + + /** + * Get the primaryKekCertificatePfx property: The primary KEK certificate PFX. + * + * @return the primaryKekCertificatePfx value. + */ + public String primaryKekCertificatePfx() { + return this.primaryKekCertificatePfx; + } + + /** + * Set the primaryKekCertificatePfx property: The primary KEK certificate PFX. + * + * @param primaryKekCertificatePfx the primaryKekCertificatePfx value to set. + * @return the RecoveryPlanHyperVReplicaAzureFailoverInput object itself. + */ + public RecoveryPlanHyperVReplicaAzureFailoverInput withPrimaryKekCertificatePfx(String primaryKekCertificatePfx) { + this.primaryKekCertificatePfx = primaryKekCertificatePfx; + return this; + } + + /** + * Get the secondaryKekCertificatePfx property: The secondary KEK certificate PFX. + * + * @return the secondaryKekCertificatePfx value. + */ + public String secondaryKekCertificatePfx() { + return this.secondaryKekCertificatePfx; + } + + /** + * Set the secondaryKekCertificatePfx property: The secondary KEK certificate PFX. + * + * @param secondaryKekCertificatePfx the secondaryKekCertificatePfx value to set. + * @return the RecoveryPlanHyperVReplicaAzureFailoverInput object itself. + */ + public RecoveryPlanHyperVReplicaAzureFailoverInput withSecondaryKekCertificatePfx( + String secondaryKekCertificatePfx) { + this.secondaryKekCertificatePfx = secondaryKekCertificatePfx; + return this; + } + + /** + * Get the recoveryPointType property: The recovery point type. + * + * @return the recoveryPointType value. + */ + public HyperVReplicaAzureRpRecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the RecoveryPlanHyperVReplicaAzureFailoverInput object itself. + */ + public RecoveryPlanHyperVReplicaAzureFailoverInput withRecoveryPointType( + HyperVReplicaAzureRpRecoveryPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageAzureV2FailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageAzureV2FailoverInput.java new file mode 100644 index 000000000000..60a26871c531 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageAzureV2FailoverInput.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Recovery plan InMageAzureV2 failover input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class RecoveryPlanInMageAzureV2FailoverInput extends RecoveryPlanProviderSpecificFailoverInput { + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType", required = true) + private InMageV2RpRecoveryPointType recoveryPointType; + + /* + * A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + */ + @JsonProperty(value = "useMultiVmSyncPoint") + private String useMultiVmSyncPoint; + + /** Creates an instance of RecoveryPlanInMageAzureV2FailoverInput class. */ + public RecoveryPlanInMageAzureV2FailoverInput() { + } + + /** + * Get the recoveryPointType property: The recovery point type. + * + * @return the recoveryPointType value. + */ + public InMageV2RpRecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the RecoveryPlanInMageAzureV2FailoverInput object itself. + */ + public RecoveryPlanInMageAzureV2FailoverInput withRecoveryPointType(InMageV2RpRecoveryPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the useMultiVmSyncPoint property: A value indicating whether multi VM sync enabled VMs should use multi VM + * sync points for failover. + * + * @return the useMultiVmSyncPoint value. + */ + public String useMultiVmSyncPoint() { + return this.useMultiVmSyncPoint; + } + + /** + * Set the useMultiVmSyncPoint property: A value indicating whether multi VM sync enabled VMs should use multi VM + * sync points for failover. + * + * @param useMultiVmSyncPoint the useMultiVmSyncPoint value to set. + * @return the RecoveryPlanInMageAzureV2FailoverInput object itself. + */ + public RecoveryPlanInMageAzureV2FailoverInput withUseMultiVmSyncPoint(String useMultiVmSyncPoint) { + this.useMultiVmSyncPoint = useMultiVmSyncPoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointType in model RecoveryPlanInMageAzureV2FailoverInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanInMageAzureV2FailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageFailoverInput.java new file mode 100644 index 000000000000..e17c758427fe --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageFailoverInput.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.recoveryservicessiterecovery.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; + +/** Recovery plan InMage failover input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class RecoveryPlanInMageFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType", required = true) + private RpInMageRecoveryPointType recoveryPointType; + + /** Creates an instance of RecoveryPlanInMageFailoverInput class. */ + public RecoveryPlanInMageFailoverInput() { + } + + /** + * Get the recoveryPointType property: The recovery point type. + * + * @return the recoveryPointType value. + */ + public RpInMageRecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the RecoveryPlanInMageFailoverInput object itself. + */ + public RecoveryPlanInMageFailoverInput withRecoveryPointType(RpInMageRecoveryPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointType in model RecoveryPlanInMageFailoverInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanInMageFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageRcmFailbackFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageRcmFailbackFailoverInput.java new file mode 100644 index 000000000000..120c5ed2ce3c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageRcmFailbackFailoverInput.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Recovery plan InMageRcmFailback failover input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcmFailback") +@Fluent +public final class RecoveryPlanInMageRcmFailbackFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType", required = true) + private InMageRcmFailbackRecoveryPointType recoveryPointType; + + /* + * A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + */ + @JsonProperty(value = "useMultiVmSyncPoint") + private String useMultiVmSyncPoint; + + /** Creates an instance of RecoveryPlanInMageRcmFailbackFailoverInput class. */ + public RecoveryPlanInMageRcmFailbackFailoverInput() { + } + + /** + * Get the recoveryPointType property: The recovery point type. + * + * @return the recoveryPointType value. + */ + public InMageRcmFailbackRecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the RecoveryPlanInMageRcmFailbackFailoverInput object itself. + */ + public RecoveryPlanInMageRcmFailbackFailoverInput withRecoveryPointType( + InMageRcmFailbackRecoveryPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the useMultiVmSyncPoint property: A value indicating whether multi VM sync enabled VMs should use multi VM + * sync points for failover. + * + * @return the useMultiVmSyncPoint value. + */ + public String useMultiVmSyncPoint() { + return this.useMultiVmSyncPoint; + } + + /** + * Set the useMultiVmSyncPoint property: A value indicating whether multi VM sync enabled VMs should use multi VM + * sync points for failover. + * + * @param useMultiVmSyncPoint the useMultiVmSyncPoint value to set. + * @return the RecoveryPlanInMageRcmFailbackFailoverInput object itself. + */ + public RecoveryPlanInMageRcmFailbackFailoverInput withUseMultiVmSyncPoint(String useMultiVmSyncPoint) { + this.useMultiVmSyncPoint = useMultiVmSyncPoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointType in model" + + " RecoveryPlanInMageRcmFailbackFailoverInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanInMageRcmFailbackFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageRcmFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageRcmFailoverInput.java new file mode 100644 index 000000000000..9fe4f0ed1d3b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageRcmFailoverInput.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Recovery plan InMageRcm failover input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageRcm") +@Fluent +public final class RecoveryPlanInMageRcmFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType", required = true) + private RecoveryPlanPointType recoveryPointType; + + /* + * A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. + */ + @JsonProperty(value = "useMultiVmSyncPoint") + private String useMultiVmSyncPoint; + + /** Creates an instance of RecoveryPlanInMageRcmFailoverInput class. */ + public RecoveryPlanInMageRcmFailoverInput() { + } + + /** + * Get the recoveryPointType property: The recovery point type. + * + * @return the recoveryPointType value. + */ + public RecoveryPlanPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the RecoveryPlanInMageRcmFailoverInput object itself. + */ + public RecoveryPlanInMageRcmFailoverInput withRecoveryPointType(RecoveryPlanPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the useMultiVmSyncPoint property: A value indicating whether multi VM sync enabled VMs should use multi VM + * sync points for failover. + * + * @return the useMultiVmSyncPoint value. + */ + public String useMultiVmSyncPoint() { + return this.useMultiVmSyncPoint; + } + + /** + * Set the useMultiVmSyncPoint property: A value indicating whether multi VM sync enabled VMs should use multi VM + * sync points for failover. + * + * @param useMultiVmSyncPoint the useMultiVmSyncPoint value to set. + * @return the RecoveryPlanInMageRcmFailoverInput object itself. + */ + public RecoveryPlanInMageRcmFailoverInput withUseMultiVmSyncPoint(String useMultiVmSyncPoint) { + this.useMultiVmSyncPoint = useMultiVmSyncPoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointType in model RecoveryPlanInMageRcmFailoverInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanInMageRcmFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanManualActionDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanManualActionDetails.java new file mode 100644 index 000000000000..15d68de57bb5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanManualActionDetails.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.recoveryservicessiterecovery.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; + +/** Recovery plan manual action details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("ManualActionDetails") +@Fluent +public final class RecoveryPlanManualActionDetails extends RecoveryPlanActionDetails { + /* + * The manual action description. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of RecoveryPlanManualActionDetails class. */ + public RecoveryPlanManualActionDetails() { + } + + /** + * Get the description property: The manual action description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The manual action description. + * + * @param description the description value to set. + * @return the RecoveryPlanManualActionDetails object itself. + */ + public RecoveryPlanManualActionDetails withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInput.java new file mode 100644 index 000000000000..dd18fcd83c0e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan planned failover input. */ +@Fluent +public final class RecoveryPlanPlannedFailoverInput { + /* + * The recovery plan planned failover input properties. + */ + @JsonProperty(value = "properties", required = true) + private RecoveryPlanPlannedFailoverInputProperties properties; + + /** Creates an instance of RecoveryPlanPlannedFailoverInput class. */ + public RecoveryPlanPlannedFailoverInput() { + } + + /** + * Get the properties property: The recovery plan planned failover input properties. + * + * @return the properties value. + */ + public RecoveryPlanPlannedFailoverInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The recovery plan planned failover input properties. + * + * @param properties the properties value to set. + * @return the RecoveryPlanPlannedFailoverInput object itself. + */ + public RecoveryPlanPlannedFailoverInput withProperties(RecoveryPlanPlannedFailoverInputProperties 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 RecoveryPlanPlannedFailoverInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanPlannedFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInputProperties.java new file mode 100644 index 000000000000..62c164896423 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInputProperties.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan planned failover input properties. */ +@Fluent +public final class RecoveryPlanPlannedFailoverInputProperties { + /* + * The failover direction. + */ + @JsonProperty(value = "failoverDirection", required = true) + private PossibleOperationsDirections failoverDirection; + + /* + * The provider specific properties. + */ + @JsonProperty(value = "providerSpecificDetails") + private List providerSpecificDetails; + + /** Creates an instance of RecoveryPlanPlannedFailoverInputProperties class. */ + public RecoveryPlanPlannedFailoverInputProperties() { + } + + /** + * Get the failoverDirection property: The failover direction. + * + * @return the failoverDirection value. + */ + public PossibleOperationsDirections failoverDirection() { + return this.failoverDirection; + } + + /** + * Set the failoverDirection property: The failover direction. + * + * @param failoverDirection the failoverDirection value to set. + * @return the RecoveryPlanPlannedFailoverInputProperties object itself. + */ + public RecoveryPlanPlannedFailoverInputProperties withFailoverDirection( + PossibleOperationsDirections failoverDirection) { + this.failoverDirection = failoverDirection; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider specific properties. + * + * @return the providerSpecificDetails value. + */ + public List providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific properties. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the RecoveryPlanPlannedFailoverInputProperties object itself. + */ + public RecoveryPlanPlannedFailoverInputProperties withProviderSpecificDetails( + List providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (failoverDirection() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property failoverDirection in model" + + " RecoveryPlanPlannedFailoverInputProperties")); + } + if (providerSpecificDetails() != null) { + providerSpecificDetails().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanPlannedFailoverInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPointType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPointType.java new file mode 100644 index 000000000000..52e3e167feae --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPointType.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recovery point type. */ +public final class RecoveryPlanPointType extends ExpandableStringEnum { + /** Static value Latest for RecoveryPlanPointType. */ + public static final RecoveryPlanPointType LATEST = fromString("Latest"); + + /** Static value LatestApplicationConsistent for RecoveryPlanPointType. */ + public static final RecoveryPlanPointType LATEST_APPLICATION_CONSISTENT = fromString("LatestApplicationConsistent"); + + /** Static value LatestCrashConsistent for RecoveryPlanPointType. */ + public static final RecoveryPlanPointType LATEST_CRASH_CONSISTENT = fromString("LatestCrashConsistent"); + + /** Static value LatestProcessed for RecoveryPlanPointType. */ + public static final RecoveryPlanPointType LATEST_PROCESSED = fromString("LatestProcessed"); + + /** + * Creates or finds a RecoveryPlanPointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryPlanPointType. + */ + @JsonCreator + public static RecoveryPlanPointType fromString(String name) { + return fromString(name, RecoveryPlanPointType.class); + } + + /** + * Gets known RecoveryPlanPointType values. + * + * @return known RecoveryPlanPointType values. + */ + public static Collection values() { + return values(RecoveryPlanPointType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProperties.java new file mode 100644 index 000000000000..525ff32b758d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProperties.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Recovery plan properties. */ +@Fluent +public final class RecoveryPlanProperties { + /* + * The friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The primary fabric Id. + */ + @JsonProperty(value = "primaryFabricId") + private String primaryFabricId; + + /* + * The primary fabric friendly name. + */ + @JsonProperty(value = "primaryFabricFriendlyName") + private String primaryFabricFriendlyName; + + /* + * The recovery fabric Id. + */ + @JsonProperty(value = "recoveryFabricId") + private String recoveryFabricId; + + /* + * The recovery fabric friendly name. + */ + @JsonProperty(value = "recoveryFabricFriendlyName") + private String recoveryFabricFriendlyName; + + /* + * The failover deployment model. + */ + @JsonProperty(value = "failoverDeploymentModel") + private String failoverDeploymentModel; + + /* + * The list of replication providers. + */ + @JsonProperty(value = "replicationProviders") + private List replicationProviders; + + /* + * The list of allowed operations. + */ + @JsonProperty(value = "allowedOperations") + private List allowedOperations; + + /* + * The start time of the last planned failover. + */ + @JsonProperty(value = "lastPlannedFailoverTime") + private OffsetDateTime lastPlannedFailoverTime; + + /* + * The start time of the last unplanned failover. + */ + @JsonProperty(value = "lastUnplannedFailoverTime") + private OffsetDateTime lastUnplannedFailoverTime; + + /* + * The start time of the last test failover. + */ + @JsonProperty(value = "lastTestFailoverTime") + private OffsetDateTime lastTestFailoverTime; + + /* + * The current scenario details. + */ + @JsonProperty(value = "currentScenario") + private CurrentScenarioDetails currentScenario; + + /* + * The recovery plan status. + */ + @JsonProperty(value = "currentScenarioStatus") + private String currentScenarioStatus; + + /* + * The recovery plan status description. + */ + @JsonProperty(value = "currentScenarioStatusDescription") + private String currentScenarioStatusDescription; + + /* + * The recovery plan groups. + */ + @JsonProperty(value = "groups") + private List groups; + + /* + * The provider id and provider specific details. + */ + @JsonProperty(value = "providerSpecificDetails") + private List providerSpecificDetails; + + /** Creates an instance of RecoveryPlanProperties class. */ + public RecoveryPlanProperties() { + } + + /** + * Get the friendlyName property: The friendly name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name. + * + * @param friendlyName the friendlyName value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the primaryFabricId property: The primary fabric Id. + * + * @return the primaryFabricId value. + */ + public String primaryFabricId() { + return this.primaryFabricId; + } + + /** + * Set the primaryFabricId property: The primary fabric Id. + * + * @param primaryFabricId the primaryFabricId value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withPrimaryFabricId(String primaryFabricId) { + this.primaryFabricId = primaryFabricId; + return this; + } + + /** + * Get the primaryFabricFriendlyName property: The primary fabric friendly name. + * + * @return the primaryFabricFriendlyName value. + */ + public String primaryFabricFriendlyName() { + return this.primaryFabricFriendlyName; + } + + /** + * Set the primaryFabricFriendlyName property: The primary fabric friendly name. + * + * @param primaryFabricFriendlyName the primaryFabricFriendlyName value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withPrimaryFabricFriendlyName(String primaryFabricFriendlyName) { + this.primaryFabricFriendlyName = primaryFabricFriendlyName; + return this; + } + + /** + * Get the recoveryFabricId property: The recovery fabric Id. + * + * @return the recoveryFabricId value. + */ + public String recoveryFabricId() { + return this.recoveryFabricId; + } + + /** + * Set the recoveryFabricId property: The recovery fabric Id. + * + * @param recoveryFabricId the recoveryFabricId value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withRecoveryFabricId(String recoveryFabricId) { + this.recoveryFabricId = recoveryFabricId; + return this; + } + + /** + * Get the recoveryFabricFriendlyName property: The recovery fabric friendly name. + * + * @return the recoveryFabricFriendlyName value. + */ + public String recoveryFabricFriendlyName() { + return this.recoveryFabricFriendlyName; + } + + /** + * Set the recoveryFabricFriendlyName property: The recovery fabric friendly name. + * + * @param recoveryFabricFriendlyName the recoveryFabricFriendlyName value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withRecoveryFabricFriendlyName(String recoveryFabricFriendlyName) { + this.recoveryFabricFriendlyName = recoveryFabricFriendlyName; + return this; + } + + /** + * Get the failoverDeploymentModel property: The failover deployment model. + * + * @return the failoverDeploymentModel value. + */ + public String failoverDeploymentModel() { + return this.failoverDeploymentModel; + } + + /** + * Set the failoverDeploymentModel property: The failover deployment model. + * + * @param failoverDeploymentModel the failoverDeploymentModel value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withFailoverDeploymentModel(String failoverDeploymentModel) { + this.failoverDeploymentModel = failoverDeploymentModel; + return this; + } + + /** + * Get the replicationProviders property: The list of replication providers. + * + * @return the replicationProviders value. + */ + public List replicationProviders() { + return this.replicationProviders; + } + + /** + * Set the replicationProviders property: The list of replication providers. + * + * @param replicationProviders the replicationProviders value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withReplicationProviders(List replicationProviders) { + this.replicationProviders = replicationProviders; + return this; + } + + /** + * Get the allowedOperations property: The list of allowed operations. + * + * @return the allowedOperations value. + */ + public List allowedOperations() { + return this.allowedOperations; + } + + /** + * Set the allowedOperations property: The list of allowed operations. + * + * @param allowedOperations the allowedOperations value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withAllowedOperations(List allowedOperations) { + this.allowedOperations = allowedOperations; + return this; + } + + /** + * Get the lastPlannedFailoverTime property: The start time of the last planned failover. + * + * @return the lastPlannedFailoverTime value. + */ + public OffsetDateTime lastPlannedFailoverTime() { + return this.lastPlannedFailoverTime; + } + + /** + * Set the lastPlannedFailoverTime property: The start time of the last planned failover. + * + * @param lastPlannedFailoverTime the lastPlannedFailoverTime value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withLastPlannedFailoverTime(OffsetDateTime lastPlannedFailoverTime) { + this.lastPlannedFailoverTime = lastPlannedFailoverTime; + return this; + } + + /** + * Get the lastUnplannedFailoverTime property: The start time of the last unplanned failover. + * + * @return the lastUnplannedFailoverTime value. + */ + public OffsetDateTime lastUnplannedFailoverTime() { + return this.lastUnplannedFailoverTime; + } + + /** + * Set the lastUnplannedFailoverTime property: The start time of the last unplanned failover. + * + * @param lastUnplannedFailoverTime the lastUnplannedFailoverTime value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withLastUnplannedFailoverTime(OffsetDateTime lastUnplannedFailoverTime) { + this.lastUnplannedFailoverTime = lastUnplannedFailoverTime; + return this; + } + + /** + * Get the lastTestFailoverTime property: The start time of the last test failover. + * + * @return the lastTestFailoverTime value. + */ + public OffsetDateTime lastTestFailoverTime() { + return this.lastTestFailoverTime; + } + + /** + * Set the lastTestFailoverTime property: The start time of the last test failover. + * + * @param lastTestFailoverTime the lastTestFailoverTime value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withLastTestFailoverTime(OffsetDateTime lastTestFailoverTime) { + this.lastTestFailoverTime = lastTestFailoverTime; + return this; + } + + /** + * Get the currentScenario property: The current scenario details. + * + * @return the currentScenario value. + */ + public CurrentScenarioDetails currentScenario() { + return this.currentScenario; + } + + /** + * Set the currentScenario property: The current scenario details. + * + * @param currentScenario the currentScenario value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withCurrentScenario(CurrentScenarioDetails currentScenario) { + this.currentScenario = currentScenario; + return this; + } + + /** + * Get the currentScenarioStatus property: The recovery plan status. + * + * @return the currentScenarioStatus value. + */ + public String currentScenarioStatus() { + return this.currentScenarioStatus; + } + + /** + * Set the currentScenarioStatus property: The recovery plan status. + * + * @param currentScenarioStatus the currentScenarioStatus value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withCurrentScenarioStatus(String currentScenarioStatus) { + this.currentScenarioStatus = currentScenarioStatus; + return this; + } + + /** + * Get the currentScenarioStatusDescription property: The recovery plan status description. + * + * @return the currentScenarioStatusDescription value. + */ + public String currentScenarioStatusDescription() { + return this.currentScenarioStatusDescription; + } + + /** + * Set the currentScenarioStatusDescription property: The recovery plan status description. + * + * @param currentScenarioStatusDescription the currentScenarioStatusDescription value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withCurrentScenarioStatusDescription(String currentScenarioStatusDescription) { + this.currentScenarioStatusDescription = currentScenarioStatusDescription; + return this; + } + + /** + * Get the groups property: The recovery plan groups. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The recovery plan groups. + * + * @param groups the groups value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider id and provider specific details. + * + * @return the providerSpecificDetails value. + */ + public List providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider id and provider specific details. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the RecoveryPlanProperties object itself. + */ + public RecoveryPlanProperties withProviderSpecificDetails( + List providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (currentScenario() != null) { + currentScenario().validate(); + } + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + if (providerSpecificDetails() != null) { + providerSpecificDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProtectedItem.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProtectedItem.java new file mode 100644 index 000000000000..32137531d0d6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProtectedItem.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan protected item. */ +@Fluent +public final class RecoveryPlanProtectedItem { + /* + * The ARM Id of the recovery plan protected item. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The virtual machine Id. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /** Creates an instance of RecoveryPlanProtectedItem class. */ + public RecoveryPlanProtectedItem() { + } + + /** + * Get the id property: The ARM Id of the recovery plan protected item. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM Id of the recovery plan protected item. + * + * @param id the id value to set. + * @return the RecoveryPlanProtectedItem object itself. + */ + public RecoveryPlanProtectedItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the virtualMachineId property: The virtual machine Id. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set the virtualMachineId property: The virtual machine Id. + * + * @param virtualMachineId the virtualMachineId value to set. + * @return the RecoveryPlanProtectedItem object itself. + */ + public RecoveryPlanProtectedItem withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificDetails.java new file mode 100644 index 000000000000..5007cb33a84e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificDetails.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.recoveryservicessiterecovery.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 plan provider specific details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = RecoveryPlanProviderSpecificDetails.class) +@JsonTypeName("RecoveryPlanProviderSpecificDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "A2A", value = RecoveryPlanA2ADetails.class)}) +@Immutable +public class RecoveryPlanProviderSpecificDetails { + /** Creates an instance of RecoveryPlanProviderSpecificDetails class. */ + public RecoveryPlanProviderSpecificDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificFailoverInput.java new file mode 100644 index 000000000000..7895390a3609 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificFailoverInput.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 plan provider specific failover input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = RecoveryPlanProviderSpecificFailoverInput.class) +@JsonTypeName("RecoveryPlanProviderSpecificFailoverInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = RecoveryPlanA2AFailoverInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzureFailback", value = RecoveryPlanHyperVReplicaAzureFailbackInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = RecoveryPlanHyperVReplicaAzureFailoverInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = RecoveryPlanInMageAzureV2FailoverInput.class), + @JsonSubTypes.Type(name = "InMage", value = RecoveryPlanInMageFailoverInput.class), + @JsonSubTypes.Type(name = "InMageRcmFailback", value = RecoveryPlanInMageRcmFailbackFailoverInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = RecoveryPlanInMageRcmFailoverInput.class) +}) +@Immutable +public class RecoveryPlanProviderSpecificFailoverInput { + /** Creates an instance of RecoveryPlanProviderSpecificFailoverInput class. */ + public RecoveryPlanProviderSpecificFailoverInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificInput.java new file mode 100644 index 000000000000..605e293562d9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificInput.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.recoveryservicessiterecovery.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 plan provider specific input base class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = RecoveryPlanProviderSpecificInput.class) +@JsonTypeName("RecoveryPlanProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "A2A", value = RecoveryPlanA2AInput.class)}) +@Immutable +public class RecoveryPlanProviderSpecificInput { + /** Creates an instance of RecoveryPlanProviderSpecificInput class. */ + public RecoveryPlanProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanScriptActionDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanScriptActionDetails.java new file mode 100644 index 000000000000..8514a94f4fe5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanScriptActionDetails.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** Recovery plan script action details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("ScriptActionDetails") +@Fluent +public final class RecoveryPlanScriptActionDetails extends RecoveryPlanActionDetails { + /* + * The script path. + */ + @JsonProperty(value = "path", required = true) + private String path; + + /* + * The script timeout. + */ + @JsonProperty(value = "timeout") + private String timeout; + + /* + * The fabric location. + */ + @JsonProperty(value = "fabricLocation", required = true) + private RecoveryPlanActionLocation fabricLocation; + + /** Creates an instance of RecoveryPlanScriptActionDetails class. */ + public RecoveryPlanScriptActionDetails() { + } + + /** + * Get the path property: The script path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The script path. + * + * @param path the path value to set. + * @return the RecoveryPlanScriptActionDetails object itself. + */ + public RecoveryPlanScriptActionDetails withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the timeout property: The script timeout. + * + * @return the timeout value. + */ + public String timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The script timeout. + * + * @param timeout the timeout value to set. + * @return the RecoveryPlanScriptActionDetails object itself. + */ + public RecoveryPlanScriptActionDetails withTimeout(String timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the fabricLocation property: The fabric location. + * + * @return the fabricLocation value. + */ + public RecoveryPlanActionLocation fabricLocation() { + return this.fabricLocation; + } + + /** + * Set the fabricLocation property: The fabric location. + * + * @param fabricLocation the fabricLocation value to set. + * @return the RecoveryPlanScriptActionDetails object itself. + */ + public RecoveryPlanScriptActionDetails withFabricLocation(RecoveryPlanActionLocation fabricLocation) { + this.fabricLocation = fabricLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (path() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property path in model RecoveryPlanScriptActionDetails")); + } + if (fabricLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fabricLocation in model RecoveryPlanScriptActionDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanScriptActionDetails.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanShutdownGroupTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanShutdownGroupTaskDetails.java new file mode 100644 index 000000000000..41e64c0e061c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanShutdownGroupTaskDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** This class represents the recovery plan shutdown group task details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("RecoveryPlanShutdownGroupTaskDetails") +@Fluent +public final class RecoveryPlanShutdownGroupTaskDetails extends RecoveryPlanGroupTaskDetails { + /** Creates an instance of RecoveryPlanShutdownGroupTaskDetails class. */ + public RecoveryPlanShutdownGroupTaskDetails() { + } + + /** {@inheritDoc} */ + @Override + public RecoveryPlanShutdownGroupTaskDetails withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPlanShutdownGroupTaskDetails withGroupId(String groupId) { + super.withGroupId(groupId); + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPlanShutdownGroupTaskDetails withRpGroupType(String rpGroupType) { + super.withRpGroupType(rpGroupType); + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPlanShutdownGroupTaskDetails withChildTasks(List childTasks) { + super.withChildTasks(childTasks); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInput.java new file mode 100644 index 000000000000..1984f150cf05 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan test failover cleanup input. */ +@Fluent +public final class RecoveryPlanTestFailoverCleanupInput { + /* + * The recovery plan test failover cleanup input properties. + */ + @JsonProperty(value = "properties", required = true) + private RecoveryPlanTestFailoverCleanupInputProperties properties; + + /** Creates an instance of RecoveryPlanTestFailoverCleanupInput class. */ + public RecoveryPlanTestFailoverCleanupInput() { + } + + /** + * Get the properties property: The recovery plan test failover cleanup input properties. + * + * @return the properties value. + */ + public RecoveryPlanTestFailoverCleanupInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The recovery plan test failover cleanup input properties. + * + * @param properties the properties value to set. + * @return the RecoveryPlanTestFailoverCleanupInput object itself. + */ + public RecoveryPlanTestFailoverCleanupInput withProperties( + RecoveryPlanTestFailoverCleanupInputProperties 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 RecoveryPlanTestFailoverCleanupInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanTestFailoverCleanupInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInputProperties.java new file mode 100644 index 000000000000..7a48e3ebcafd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan test failover cleanup input properties. */ +@Fluent +public final class RecoveryPlanTestFailoverCleanupInputProperties { + /* + * The test failover cleanup comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /** Creates an instance of RecoveryPlanTestFailoverCleanupInputProperties class. */ + public RecoveryPlanTestFailoverCleanupInputProperties() { + } + + /** + * Get the comments property: The test failover cleanup comments. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Set the comments property: The test failover cleanup comments. + * + * @param comments the comments value to set. + * @return the RecoveryPlanTestFailoverCleanupInputProperties object itself. + */ + public RecoveryPlanTestFailoverCleanupInputProperties withComments(String comments) { + this.comments = comments; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInput.java new file mode 100644 index 000000000000..39e6db566511 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan test failover input. */ +@Fluent +public final class RecoveryPlanTestFailoverInput { + /* + * The recovery plan test failover input properties. + */ + @JsonProperty(value = "properties", required = true) + private RecoveryPlanTestFailoverInputProperties properties; + + /** Creates an instance of RecoveryPlanTestFailoverInput class. */ + public RecoveryPlanTestFailoverInput() { + } + + /** + * Get the properties property: The recovery plan test failover input properties. + * + * @return the properties value. + */ + public RecoveryPlanTestFailoverInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The recovery plan test failover input properties. + * + * @param properties the properties value to set. + * @return the RecoveryPlanTestFailoverInput object itself. + */ + public RecoveryPlanTestFailoverInput withProperties(RecoveryPlanTestFailoverInputProperties 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 RecoveryPlanTestFailoverInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanTestFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInputProperties.java new file mode 100644 index 000000000000..7e3cb8f20f68 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInputProperties.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan test failover input properties. */ +@Fluent +public final class RecoveryPlanTestFailoverInputProperties { + /* + * The failover direction. + */ + @JsonProperty(value = "failoverDirection", required = true) + private PossibleOperationsDirections failoverDirection; + + /* + * The network type to be used for test failover. + */ + @JsonProperty(value = "networkType", required = true) + private String networkType; + + /* + * The Id of the network to be used for test failover. + */ + @JsonProperty(value = "networkId") + private String networkId; + + /* + * The provider specific properties. + */ + @JsonProperty(value = "providerSpecificDetails") + private List providerSpecificDetails; + + /** Creates an instance of RecoveryPlanTestFailoverInputProperties class. */ + public RecoveryPlanTestFailoverInputProperties() { + } + + /** + * Get the failoverDirection property: The failover direction. + * + * @return the failoverDirection value. + */ + public PossibleOperationsDirections failoverDirection() { + return this.failoverDirection; + } + + /** + * Set the failoverDirection property: The failover direction. + * + * @param failoverDirection the failoverDirection value to set. + * @return the RecoveryPlanTestFailoverInputProperties object itself. + */ + public RecoveryPlanTestFailoverInputProperties withFailoverDirection( + PossibleOperationsDirections failoverDirection) { + this.failoverDirection = failoverDirection; + return this; + } + + /** + * Get the networkType property: The network type to be used for test failover. + * + * @return the networkType value. + */ + public String networkType() { + return this.networkType; + } + + /** + * Set the networkType property: The network type to be used for test failover. + * + * @param networkType the networkType value to set. + * @return the RecoveryPlanTestFailoverInputProperties object itself. + */ + public RecoveryPlanTestFailoverInputProperties withNetworkType(String networkType) { + this.networkType = networkType; + return this; + } + + /** + * Get the networkId property: The Id of the network to be used for test failover. + * + * @return the networkId value. + */ + public String networkId() { + return this.networkId; + } + + /** + * Set the networkId property: The Id of the network to be used for test failover. + * + * @param networkId the networkId value to set. + * @return the RecoveryPlanTestFailoverInputProperties object itself. + */ + public RecoveryPlanTestFailoverInputProperties withNetworkId(String networkId) { + this.networkId = networkId; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider specific properties. + * + * @return the providerSpecificDetails value. + */ + public List providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific properties. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the RecoveryPlanTestFailoverInputProperties object itself. + */ + public RecoveryPlanTestFailoverInputProperties withProviderSpecificDetails( + List providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (failoverDirection() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property failoverDirection in model" + + " RecoveryPlanTestFailoverInputProperties")); + } + if (networkType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkType in model RecoveryPlanTestFailoverInputProperties")); + } + if (providerSpecificDetails() != null) { + providerSpecificDetails().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanTestFailoverInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInput.java new file mode 100644 index 000000000000..a92b6bcba429 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan unplanned failover input. */ +@Fluent +public final class RecoveryPlanUnplannedFailoverInput { + /* + * The recovery plan unplanned failover input properties. + */ + @JsonProperty(value = "properties", required = true) + private RecoveryPlanUnplannedFailoverInputProperties properties; + + /** Creates an instance of RecoveryPlanUnplannedFailoverInput class. */ + public RecoveryPlanUnplannedFailoverInput() { + } + + /** + * Get the properties property: The recovery plan unplanned failover input properties. + * + * @return the properties value. + */ + public RecoveryPlanUnplannedFailoverInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The recovery plan unplanned failover input properties. + * + * @param properties the properties value to set. + * @return the RecoveryPlanUnplannedFailoverInput object itself. + */ + public RecoveryPlanUnplannedFailoverInput withProperties(RecoveryPlanUnplannedFailoverInputProperties 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 RecoveryPlanUnplannedFailoverInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanUnplannedFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInputProperties.java new file mode 100644 index 000000000000..3600bf735ce9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan unplanned failover input properties. */ +@Fluent +public final class RecoveryPlanUnplannedFailoverInputProperties { + /* + * The failover direction. + */ + @JsonProperty(value = "failoverDirection", required = true) + private PossibleOperationsDirections failoverDirection; + + /* + * A value indicating whether source site operations are required. + */ + @JsonProperty(value = "sourceSiteOperations", required = true) + private SourceSiteOperations sourceSiteOperations; + + /* + * The provider specific properties. + */ + @JsonProperty(value = "providerSpecificDetails") + private List providerSpecificDetails; + + /** Creates an instance of RecoveryPlanUnplannedFailoverInputProperties class. */ + public RecoveryPlanUnplannedFailoverInputProperties() { + } + + /** + * Get the failoverDirection property: The failover direction. + * + * @return the failoverDirection value. + */ + public PossibleOperationsDirections failoverDirection() { + return this.failoverDirection; + } + + /** + * Set the failoverDirection property: The failover direction. + * + * @param failoverDirection the failoverDirection value to set. + * @return the RecoveryPlanUnplannedFailoverInputProperties object itself. + */ + public RecoveryPlanUnplannedFailoverInputProperties withFailoverDirection( + PossibleOperationsDirections failoverDirection) { + this.failoverDirection = failoverDirection; + return this; + } + + /** + * Get the sourceSiteOperations property: A value indicating whether source site operations are required. + * + * @return the sourceSiteOperations value. + */ + public SourceSiteOperations sourceSiteOperations() { + return this.sourceSiteOperations; + } + + /** + * Set the sourceSiteOperations property: A value indicating whether source site operations are required. + * + * @param sourceSiteOperations the sourceSiteOperations value to set. + * @return the RecoveryPlanUnplannedFailoverInputProperties object itself. + */ + public RecoveryPlanUnplannedFailoverInputProperties withSourceSiteOperations( + SourceSiteOperations sourceSiteOperations) { + this.sourceSiteOperations = sourceSiteOperations; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider specific properties. + * + * @return the providerSpecificDetails value. + */ + public List providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific properties. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the RecoveryPlanUnplannedFailoverInputProperties object itself. + */ + public RecoveryPlanUnplannedFailoverInputProperties withProviderSpecificDetails( + List providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (failoverDirection() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property failoverDirection in model" + + " RecoveryPlanUnplannedFailoverInputProperties")); + } + if (sourceSiteOperations() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceSiteOperations in model" + + " RecoveryPlanUnplannedFailoverInputProperties")); + } + if (providerSpecificDetails() != null) { + providerSpecificDetails().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanUnplannedFailoverInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPoint.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPoint.java new file mode 100644 index 000000000000..1dc1a13247d8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPoint.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPointInner; + +/** An immutable client-side representation of RecoveryPoint. */ +public interface RecoveryPoint { + /** + * 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: The recovery point properties. + * + * @return the properties value. + */ + RecoveryPointProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPointInner object. + * + * @return the inner object. + */ + RecoveryPointInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointCollection.java new file mode 100644 index 000000000000..c95b90e3c7f9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPointInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of recovery point details. */ +@Fluent +public final class RecoveryPointCollection { + /* + * The recovery point details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RecoveryPointCollection class. */ + public RecoveryPointCollection() { + } + + /** + * Get the value property: The recovery point details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The recovery point details. + * + * @param value the value value to set. + * @return the RecoveryPointCollection object itself. + */ + public RecoveryPointCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the RecoveryPointCollection object itself. + */ + public RecoveryPointCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointProperties.java new file mode 100644 index 000000000000..0f9ab6734bde --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointProperties.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Recovery point properties. */ +@Fluent +public final class RecoveryPointProperties { + /* + * The recovery point time. + */ + @JsonProperty(value = "recoveryPointTime") + private OffsetDateTime recoveryPointTime; + + /* + * The recovery point type: ApplicationConsistent, CrashConsistent. + */ + @JsonProperty(value = "recoveryPointType") + private String recoveryPointType; + + /* + * The provider specific details for the recovery point. + */ + @JsonProperty(value = "providerSpecificDetails") + private ProviderSpecificRecoveryPointDetails providerSpecificDetails; + + /** Creates an instance of RecoveryPointProperties class. */ + public RecoveryPointProperties() { + } + + /** + * Get the recoveryPointTime property: The recovery point time. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the recoveryPointTime property: The recovery point time. + * + * @param recoveryPointTime the recoveryPointTime value to set. + * @return the RecoveryPointProperties object itself. + */ + public RecoveryPointProperties withRecoveryPointTime(OffsetDateTime recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Get the recoveryPointType property: The recovery point type: ApplicationConsistent, CrashConsistent. + * + * @return the recoveryPointType value. + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: The recovery point type: ApplicationConsistent, CrashConsistent. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the RecoveryPointProperties object itself. + */ + public RecoveryPointProperties withRecoveryPointType(String recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider specific details for the recovery point. + * + * @return the providerSpecificDetails value. + */ + public ProviderSpecificRecoveryPointDetails providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific details for the recovery point. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the RecoveryPointProperties object itself. + */ + public RecoveryPointProperties withProviderSpecificDetails( + ProviderSpecificRecoveryPointDetails providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointSyncType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointSyncType.java new file mode 100644 index 000000000000..354082aa9163 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointSyncType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A value indicating whether the recovery point is multi VM consistent. */ +public final class RecoveryPointSyncType extends ExpandableStringEnum { + /** Static value MultiVmSyncRecoveryPoint for RecoveryPointSyncType. */ + public static final RecoveryPointSyncType MULTI_VM_SYNC_RECOVERY_POINT = fromString("MultiVmSyncRecoveryPoint"); + + /** Static value PerVmRecoveryPoint for RecoveryPointSyncType. */ + public static final RecoveryPointSyncType PER_VM_RECOVERY_POINT = fromString("PerVmRecoveryPoint"); + + /** + * Creates or finds a RecoveryPointSyncType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryPointSyncType. + */ + @JsonCreator + public static RecoveryPointSyncType fromString(String name) { + return fromString(name, RecoveryPointSyncType.class); + } + + /** + * Gets known RecoveryPointSyncType values. + * + * @return known RecoveryPointSyncType values. + */ + public static Collection values() { + return values(RecoveryPointSyncType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointType.java new file mode 100644 index 000000000000..729ec29e7a96 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointType.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point + * provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. + */ +public final class RecoveryPointType extends ExpandableStringEnum { + /** Static value LatestTime for RecoveryPointType. */ + public static final RecoveryPointType LATEST_TIME = fromString("LatestTime"); + + /** Static value LatestTag for RecoveryPointType. */ + public static final RecoveryPointType LATEST_TAG = fromString("LatestTag"); + + /** Static value Custom for RecoveryPointType. */ + public static final RecoveryPointType CUSTOM = fromString("Custom"); + + /** + * 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPoints.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPoints.java new file mode 100644 index 000000000000..e403786e650b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPoints.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Gets the list of recovery points for a replication protected item. + * + *

Lists the available recovery points for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 collection of recovery point details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Gets a recovery point. + * + *

Get the details of specified recovery point. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 specified recovery point along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName, + Context context); + + /** + * Gets a recovery point. + * + *

Get the details of specified recovery point. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replication 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 specified recovery point. + */ + RecoveryPoint get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryProximityPlacementGroupCustomDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryProximityPlacementGroupCustomDetails.java new file mode 100644 index 000000000000..2087f8d04342 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryProximityPlacementGroupCustomDetails.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.recoveryservicessiterecovery.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 Proximity placement group custom input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resourceType", + defaultImpl = RecoveryProximityPlacementGroupCustomDetails.class) +@JsonTypeName("RecoveryProximityPlacementGroupCustomDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "Existing", value = ExistingRecoveryProximityPlacementGroup.class)}) +@Immutable +public class RecoveryProximityPlacementGroupCustomDetails { + /** Creates an instance of RecoveryProximityPlacementGroupCustomDetails class. */ + public RecoveryProximityPlacementGroupCustomDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryResourceGroupCustomDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryResourceGroupCustomDetails.java new file mode 100644 index 000000000000..0dfa2e9b0b09 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryResourceGroupCustomDetails.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.recoveryservicessiterecovery.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 Resource Group custom input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resourceType", + defaultImpl = RecoveryResourceGroupCustomDetails.class) +@JsonTypeName("RecoveryResourceGroupCustomDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "Existing", value = ExistingRecoveryResourceGroup.class)}) +@Immutable +public class RecoveryResourceGroupCustomDetails { + /** Creates an instance of RecoveryResourceGroupCustomDetails class. */ + public RecoveryResourceGroupCustomDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProvider.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProvider.java new file mode 100644 index 000000000000..722126ee3605 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProvider.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.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner; + +/** An immutable client-side representation of RecoveryServicesProvider. */ +public interface RecoveryServicesProvider { + /** + * 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: Provider properties. + * + * @return the properties value. + */ + RecoveryServicesProviderProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner + * object. + * + * @return the inner object. + */ + RecoveryServicesProviderInner innerModel(); + + /** The entirety of the RecoveryServicesProvider definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The RecoveryServicesProvider definition stages. */ + interface DefinitionStages { + /** The first stage of the RecoveryServicesProvider definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the RecoveryServicesProvider definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName, fabricName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @return the next definition stage. + */ + WithProperties withExistingReplicationFabric( + String resourceName, String resourceGroupName, String fabricName); + } + /** The stage of the RecoveryServicesProvider definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of an add provider request.. + * + * @param properties The properties of an add provider request. + * @return the next definition stage. + */ + WithCreate withProperties(AddRecoveryServicesProviderInputProperties properties); + } + /** + * The stage of the RecoveryServicesProvider 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. + */ + RecoveryServicesProvider create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RecoveryServicesProvider create(Context context); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RecoveryServicesProvider refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RecoveryServicesProvider refresh(Context context); + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details. + */ + RecoveryServicesProvider refreshProvider(); + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider details. + */ + RecoveryServicesProvider refreshProvider(Context context); + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @throws com.azure.core.management.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(); + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @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(Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProviderCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProviderCollection.java new file mode 100644 index 000000000000..90fb844615b1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProviderCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of providers. */ +@Fluent +public final class RecoveryServicesProviderCollection { + /* + * The Servers details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RecoveryServicesProviderCollection class. */ + public RecoveryServicesProviderCollection() { + } + + /** + * Get the value property: The Servers details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Servers details. + * + * @param value the value value to set. + * @return the RecoveryServicesProviderCollection object itself. + */ + public RecoveryServicesProviderCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the RecoveryServicesProviderCollection object itself. + */ + public RecoveryServicesProviderCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProviderProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProviderProperties.java new file mode 100644 index 000000000000..ffa832cebed0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProviderProperties.java @@ -0,0 +1,564 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Recovery services provider properties. */ +@Fluent +public final class RecoveryServicesProviderProperties { + /* + * Type of the site. + */ + @JsonProperty(value = "fabricType") + private String fabricType; + + /* + * Friendly name of the DRA. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The provider version. + */ + @JsonProperty(value = "providerVersion") + private String providerVersion; + + /* + * The fabric provider. + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /* + * DRA version status. + */ + @JsonProperty(value = "providerVersionState") + private String providerVersionState; + + /* + * Expiry date of the version. + */ + @JsonProperty(value = "providerVersionExpiryDate") + private OffsetDateTime providerVersionExpiryDate; + + /* + * The fabric friendly name. + */ + @JsonProperty(value = "fabricFriendlyName") + private String fabricFriendlyName; + + /* + * Time when last heartbeat was sent by the DRA. + */ + @JsonProperty(value = "lastHeartBeat") + private OffsetDateTime lastHeartBeat; + + /* + * A value indicating whether DRA is responsive. + */ + @JsonProperty(value = "connectionStatus") + private String connectionStatus; + + /* + * Number of protected VMs currently managed by the DRA. + */ + @JsonProperty(value = "protectedItemCount") + private Integer protectedItemCount; + + /* + * The scenarios allowed on this provider. + */ + @JsonProperty(value = "allowedScenarios") + private List allowedScenarios; + + /* + * The recovery services provider health error details. + */ + @JsonProperty(value = "healthErrorDetails") + private List healthErrorDetails; + + /* + * The DRA Id. + */ + @JsonProperty(value = "draIdentifier") + private String draIdentifier; + + /* + * The machine Id. + */ + @JsonProperty(value = "machineId") + private String machineId; + + /* + * The machine name. + */ + @JsonProperty(value = "machineName") + private String machineName; + + /* + * The Bios Id. + */ + @JsonProperty(value = "biosId") + private String biosId; + + /* + * The authentication identity details. + */ + @JsonProperty(value = "authenticationIdentityDetails") + private IdentityProviderDetails authenticationIdentityDetails; + + /* + * The resource access identity details. + */ + @JsonProperty(value = "resourceAccessIdentityDetails") + private IdentityProviderDetails resourceAccessIdentityDetails; + + /* + * The data plane authentication identity details. + */ + @JsonProperty(value = "dataPlaneAuthenticationIdentityDetails") + private IdentityProviderDetails dataPlaneAuthenticationIdentityDetails; + + /* + * The provider version details. + */ + @JsonProperty(value = "providerVersionDetails") + private VersionDetails providerVersionDetails; + + /** Creates an instance of RecoveryServicesProviderProperties class. */ + public RecoveryServicesProviderProperties() { + } + + /** + * Get the fabricType property: Type of the site. + * + * @return the fabricType value. + */ + public String fabricType() { + return this.fabricType; + } + + /** + * Set the fabricType property: Type of the site. + * + * @param fabricType the fabricType value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withFabricType(String fabricType) { + this.fabricType = fabricType; + return this; + } + + /** + * Get the friendlyName property: Friendly name of the DRA. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the DRA. + * + * @param friendlyName the friendlyName value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the providerVersion property: The provider version. + * + * @return the providerVersion value. + */ + public String providerVersion() { + return this.providerVersion; + } + + /** + * Set the providerVersion property: The provider version. + * + * @param providerVersion the providerVersion value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withProviderVersion(String providerVersion) { + this.providerVersion = providerVersion; + return this; + } + + /** + * Get the serverVersion property: The fabric provider. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: The fabric provider. + * + * @param serverVersion the serverVersion value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get the providerVersionState property: DRA version status. + * + * @return the providerVersionState value. + */ + public String providerVersionState() { + return this.providerVersionState; + } + + /** + * Set the providerVersionState property: DRA version status. + * + * @param providerVersionState the providerVersionState value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withProviderVersionState(String providerVersionState) { + this.providerVersionState = providerVersionState; + return this; + } + + /** + * Get the providerVersionExpiryDate property: Expiry date of the version. + * + * @return the providerVersionExpiryDate value. + */ + public OffsetDateTime providerVersionExpiryDate() { + return this.providerVersionExpiryDate; + } + + /** + * Set the providerVersionExpiryDate property: Expiry date of the version. + * + * @param providerVersionExpiryDate the providerVersionExpiryDate value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withProviderVersionExpiryDate(OffsetDateTime providerVersionExpiryDate) { + this.providerVersionExpiryDate = providerVersionExpiryDate; + return this; + } + + /** + * Get the fabricFriendlyName property: The fabric friendly name. + * + * @return the fabricFriendlyName value. + */ + public String fabricFriendlyName() { + return this.fabricFriendlyName; + } + + /** + * Set the fabricFriendlyName property: The fabric friendly name. + * + * @param fabricFriendlyName the fabricFriendlyName value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withFabricFriendlyName(String fabricFriendlyName) { + this.fabricFriendlyName = fabricFriendlyName; + return this; + } + + /** + * Get the lastHeartBeat property: Time when last heartbeat was sent by the DRA. + * + * @return the lastHeartBeat value. + */ + public OffsetDateTime lastHeartBeat() { + return this.lastHeartBeat; + } + + /** + * Set the lastHeartBeat property: Time when last heartbeat was sent by the DRA. + * + * @param lastHeartBeat the lastHeartBeat value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withLastHeartBeat(OffsetDateTime lastHeartBeat) { + this.lastHeartBeat = lastHeartBeat; + return this; + } + + /** + * Get the connectionStatus property: A value indicating whether DRA is responsive. + * + * @return the connectionStatus value. + */ + public String connectionStatus() { + return this.connectionStatus; + } + + /** + * Set the connectionStatus property: A value indicating whether DRA is responsive. + * + * @param connectionStatus the connectionStatus value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withConnectionStatus(String connectionStatus) { + this.connectionStatus = connectionStatus; + return this; + } + + /** + * Get the protectedItemCount property: Number of protected VMs currently managed by the DRA. + * + * @return the protectedItemCount value. + */ + public Integer protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set the protectedItemCount property: Number of protected VMs currently managed by the DRA. + * + * @param protectedItemCount the protectedItemCount value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withProtectedItemCount(Integer protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + + /** + * Get the allowedScenarios property: The scenarios allowed on this provider. + * + * @return the allowedScenarios value. + */ + public List allowedScenarios() { + return this.allowedScenarios; + } + + /** + * Set the allowedScenarios property: The scenarios allowed on this provider. + * + * @param allowedScenarios the allowedScenarios value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withAllowedScenarios(List allowedScenarios) { + this.allowedScenarios = allowedScenarios; + return this; + } + + /** + * Get the healthErrorDetails property: The recovery services provider health error details. + * + * @return the healthErrorDetails value. + */ + public List healthErrorDetails() { + return this.healthErrorDetails; + } + + /** + * Set the healthErrorDetails property: The recovery services provider health error details. + * + * @param healthErrorDetails the healthErrorDetails value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withHealthErrorDetails(List healthErrorDetails) { + this.healthErrorDetails = healthErrorDetails; + return this; + } + + /** + * Get the draIdentifier property: The DRA Id. + * + * @return the draIdentifier value. + */ + public String draIdentifier() { + return this.draIdentifier; + } + + /** + * Set the draIdentifier property: The DRA Id. + * + * @param draIdentifier the draIdentifier value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withDraIdentifier(String draIdentifier) { + this.draIdentifier = draIdentifier; + return this; + } + + /** + * Get the machineId property: The machine Id. + * + * @return the machineId value. + */ + public String machineId() { + return this.machineId; + } + + /** + * Set the machineId property: The machine Id. + * + * @param machineId the machineId value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withMachineId(String machineId) { + this.machineId = machineId; + return this; + } + + /** + * Get the machineName property: The machine name. + * + * @return the machineName value. + */ + public String machineName() { + return this.machineName; + } + + /** + * Set the machineName property: The machine name. + * + * @param machineName the machineName value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withMachineName(String machineName) { + this.machineName = machineName; + return this; + } + + /** + * Get the biosId property: The Bios Id. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Set the biosId property: The Bios Id. + * + * @param biosId the biosId value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withBiosId(String biosId) { + this.biosId = biosId; + return this; + } + + /** + * Get the authenticationIdentityDetails property: The authentication identity details. + * + * @return the authenticationIdentityDetails value. + */ + public IdentityProviderDetails authenticationIdentityDetails() { + return this.authenticationIdentityDetails; + } + + /** + * Set the authenticationIdentityDetails property: The authentication identity details. + * + * @param authenticationIdentityDetails the authenticationIdentityDetails value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withAuthenticationIdentityDetails( + IdentityProviderDetails authenticationIdentityDetails) { + this.authenticationIdentityDetails = authenticationIdentityDetails; + return this; + } + + /** + * Get the resourceAccessIdentityDetails property: The resource access identity details. + * + * @return the resourceAccessIdentityDetails value. + */ + public IdentityProviderDetails resourceAccessIdentityDetails() { + return this.resourceAccessIdentityDetails; + } + + /** + * Set the resourceAccessIdentityDetails property: The resource access identity details. + * + * @param resourceAccessIdentityDetails the resourceAccessIdentityDetails value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withResourceAccessIdentityDetails( + IdentityProviderDetails resourceAccessIdentityDetails) { + this.resourceAccessIdentityDetails = resourceAccessIdentityDetails; + return this; + } + + /** + * Get the dataPlaneAuthenticationIdentityDetails property: The data plane authentication identity details. + * + * @return the dataPlaneAuthenticationIdentityDetails value. + */ + public IdentityProviderDetails dataPlaneAuthenticationIdentityDetails() { + return this.dataPlaneAuthenticationIdentityDetails; + } + + /** + * Set the dataPlaneAuthenticationIdentityDetails property: The data plane authentication identity details. + * + * @param dataPlaneAuthenticationIdentityDetails the dataPlaneAuthenticationIdentityDetails value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withDataPlaneAuthenticationIdentityDetails( + IdentityProviderDetails dataPlaneAuthenticationIdentityDetails) { + this.dataPlaneAuthenticationIdentityDetails = dataPlaneAuthenticationIdentityDetails; + return this; + } + + /** + * Get the providerVersionDetails property: The provider version details. + * + * @return the providerVersionDetails value. + */ + public VersionDetails providerVersionDetails() { + return this.providerVersionDetails; + } + + /** + * Set the providerVersionDetails property: The provider version details. + * + * @param providerVersionDetails the providerVersionDetails value to set. + * @return the RecoveryServicesProviderProperties object itself. + */ + public RecoveryServicesProviderProperties withProviderVersionDetails(VersionDetails providerVersionDetails) { + this.providerVersionDetails = providerVersionDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrorDetails() != null) { + healthErrorDetails().forEach(e -> e.validate()); + } + if (authenticationIdentityDetails() != null) { + authenticationIdentityDetails().validate(); + } + if (resourceAccessIdentityDetails() != null) { + resourceAccessIdentityDetails().validate(); + } + if (dataPlaneAuthenticationIdentityDetails() != null) { + dataPlaneAuthenticationIdentityDetails().validate(); + } + if (providerVersionDetails() != null) { + providerVersionDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryVirtualNetworkCustomDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryVirtualNetworkCustomDetails.java new file mode 100644 index 000000000000..896b649dd227 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryVirtualNetworkCustomDetails.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.recoveryservicessiterecovery.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 Virtual network custom input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resourceType", + defaultImpl = RecoveryVirtualNetworkCustomDetails.class) +@JsonTypeName("RecoveryVirtualNetworkCustomDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Existing", value = ExistingRecoveryVirtualNetwork.class), + @JsonSubTypes.Type(name = "New", value = NewRecoveryVirtualNetwork.class) +}) +@Immutable +public class RecoveryVirtualNetworkCustomDetails { + /** Creates an instance of RecoveryVirtualNetworkCustomDetails class. */ + public RecoveryVirtualNetworkCustomDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksInput.java new file mode 100644 index 000000000000..f70bc10360df --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for remove disk(s) operation. */ +@Fluent +public final class RemoveDisksInput { + /* + * Remove disk input properties. + */ + @JsonProperty(value = "properties") + private RemoveDisksInputProperties properties; + + /** Creates an instance of RemoveDisksInput class. */ + public RemoveDisksInput() { + } + + /** + * Get the properties property: Remove disk input properties. + * + * @return the properties value. + */ + public RemoveDisksInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Remove disk input properties. + * + * @param properties the properties value to set. + * @return the RemoveDisksInput object itself. + */ + public RemoveDisksInput withProperties(RemoveDisksInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksInputProperties.java new file mode 100644 index 000000000000..a3698e517198 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Remove Disk input properties. */ +@Fluent +public final class RemoveDisksInputProperties { + /* + * The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For + * San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + */ + @JsonProperty(value = "providerSpecificDetails") + private RemoveDisksProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of RemoveDisksInputProperties class. */ + public RemoveDisksInputProperties() { + } + + /** + * Get the providerSpecificDetails property: The ReplicationProviderInput. For HyperVReplicaAzure provider, it will + * be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For + * HyperVReplicaAzure provider, it can be null. + * + * @return the providerSpecificDetails value. + */ + public RemoveDisksProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The ReplicationProviderInput. For HyperVReplicaAzure provider, it will + * be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For + * HyperVReplicaAzure provider, it can be null. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the RemoveDisksInputProperties object itself. + */ + public RemoveDisksInputProperties withProviderSpecificDetails( + RemoveDisksProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksProviderSpecificInput.java new file mode 100644 index 000000000000..cb8320c04be6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Remove Disk provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = RemoveDisksProviderSpecificInput.class) +@JsonTypeName("RemoveDisksProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "A2A", value = A2ARemoveDisksInput.class)}) +@Immutable +public class RemoveDisksProviderSpecificInput { + /** Creates an instance of RemoveDisksProviderSpecificInput class. */ + public RemoveDisksProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveProtectionContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveProtectionContainerMappingInput.java new file mode 100644 index 000000000000..d8a23606491b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveProtectionContainerMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container unpairing input. */ +@Fluent +public final class RemoveProtectionContainerMappingInput { + /* + * Configure protection input properties. + */ + @JsonProperty(value = "properties") + private RemoveProtectionContainerMappingInputProperties properties; + + /** Creates an instance of RemoveProtectionContainerMappingInput class. */ + public RemoveProtectionContainerMappingInput() { + } + + /** + * Get the properties property: Configure protection input properties. + * + * @return the properties value. + */ + public RemoveProtectionContainerMappingInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Configure protection input properties. + * + * @param properties the properties value to set. + * @return the RemoveProtectionContainerMappingInput object itself. + */ + public RemoveProtectionContainerMappingInput withProperties( + RemoveProtectionContainerMappingInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveProtectionContainerMappingInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveProtectionContainerMappingInputProperties.java new file mode 100644 index 000000000000..90bd91b705fd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveProtectionContainerMappingInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Unpairing input properties. */ +@Fluent +public final class RemoveProtectionContainerMappingInputProperties { + /* + * Provider specific input for unpairing. + */ + @JsonProperty(value = "providerSpecificInput") + private ReplicationProviderContainerUnmappingInput providerSpecificInput; + + /** Creates an instance of RemoveProtectionContainerMappingInputProperties class. */ + public RemoveProtectionContainerMappingInputProperties() { + } + + /** + * Get the providerSpecificInput property: Provider specific input for unpairing. + * + * @return the providerSpecificInput value. + */ + public ReplicationProviderContainerUnmappingInput providerSpecificInput() { + return this.providerSpecificInput; + } + + /** + * Set the providerSpecificInput property: Provider specific input for unpairing. + * + * @param providerSpecificInput the providerSpecificInput value to set. + * @return the RemoveProtectionContainerMappingInputProperties object itself. + */ + public RemoveProtectionContainerMappingInputProperties withProviderSpecificInput( + ReplicationProviderContainerUnmappingInput providerSpecificInput) { + this.providerSpecificInput = providerSpecificInput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificInput() != null) { + providerSpecificInput().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RenewCertificateInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RenewCertificateInput.java new file mode 100644 index 000000000000..0c48ed38d25f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RenewCertificateInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Certificate renewal input. */ +@Fluent +public final class RenewCertificateInput { + /* + * Renew certificate input properties. + */ + @JsonProperty(value = "properties") + private RenewCertificateInputProperties properties; + + /** Creates an instance of RenewCertificateInput class. */ + public RenewCertificateInput() { + } + + /** + * Get the properties property: Renew certificate input properties. + * + * @return the properties value. + */ + public RenewCertificateInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Renew certificate input properties. + * + * @param properties the properties value to set. + * @return the RenewCertificateInput object itself. + */ + public RenewCertificateInput withProperties(RenewCertificateInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RenewCertificateInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RenewCertificateInputProperties.java new file mode 100644 index 000000000000..c1d67c6cfe54 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RenewCertificateInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Renew Certificate input properties. */ +@Fluent +public final class RenewCertificateInputProperties { + /* + * Renew certificate type. + */ + @JsonProperty(value = "renewCertificateType") + private String renewCertificateType; + + /** Creates an instance of RenewCertificateInputProperties class. */ + public RenewCertificateInputProperties() { + } + + /** + * Get the renewCertificateType property: Renew certificate type. + * + * @return the renewCertificateType value. + */ + public String renewCertificateType() { + return this.renewCertificateType; + } + + /** + * Set the renewCertificateType property: Renew certificate type. + * + * @param renewCertificateType the renewCertificateType value to set. + * @return the RenewCertificateInputProperties object itself. + */ + public RenewCertificateInputProperties withRenewCertificateType(String renewCertificateType) { + this.renewCertificateType = renewCertificateType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAgentDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAgentDetails.java new file mode 100644 index 000000000000..e7a22e19c6a0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAgentDetails.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Replication agent details. */ +@Immutable +public final class ReplicationAgentDetails { + /* + * The replication agent Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The replication agent name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The replication agent Bios Id. + */ + @JsonProperty(value = "biosId", access = JsonProperty.Access.WRITE_ONLY) + private String biosId; + + /* + * The fabric object Id. + */ + @JsonProperty(value = "fabricObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricObjectId; + + /* + * The replication agent Fqdn. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The last heartbeat received from the replication agent. + */ + @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeatUtc; + + /* + * The health of the replication agent. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth health; + + /* + * The health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /** Creates an instance of ReplicationAgentDetails class. */ + public ReplicationAgentDetails() { + } + + /** + * Get the id property: The replication agent Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The replication agent name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the biosId property: The replication agent Bios Id. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Get the fabricObjectId property: The fabric object Id. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Get the fqdn property: The replication agent Fqdn. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the lastHeartbeatUtc property: The last heartbeat received from the replication agent. + * + * @return the lastHeartbeatUtc value. + */ + public OffsetDateTime lastHeartbeatUtc() { + return this.lastHeartbeatUtc; + } + + /** + * Get the health property: The health of the replication agent. + * + * @return the health value. + */ + public ProtectionHealth health() { + return this.health; + } + + /** + * Get the healthErrors property: The health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAlertSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAlertSettings.java new file mode 100644 index 000000000000..763e97410bb8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAlertSettings.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.recoveryservicessiterecovery.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 ReplicationAlertSettings. */ +public interface ReplicationAlertSettings { + /** + * Gets the list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 email notification(alert) configurations for the vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of configured email notification(alert) configurations. + * + *

Gets the list of email notification(alert) configurations for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 email notification(alert) configurations for the vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets an email notification(alert) configuration. + * + *

Gets the details of the specified email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification configuration. + * @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 specified email notification(alert) configuration along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String alertSettingName, Context context); + + /** + * Gets an email notification(alert) configuration. + * + *

Gets the details of the specified email notification(alert) configuration. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param alertSettingName The name of the email notification configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 specified email notification(alert) configuration. + */ + Alert get(String resourceName, String resourceGroupName, String alertSettingName); + + /** + * Gets an email notification(alert) configuration. + * + *

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

Gets the details of the specified email notification(alert) configuration. + * + * @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 specified email notification(alert) configuration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Alert resource. + * + * @param name resource name. + * @return the first stage of the new Alert definition. + */ + Alert.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAppliance.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAppliance.java new file mode 100644 index 000000000000..5cd373082d48 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAppliance.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationApplianceInner; + +/** An immutable client-side representation of ReplicationAppliance. */ +public interface ReplicationAppliance { + /** + * Gets the properties property: Appliance related data. + * + * @return the properties value. + */ + ReplicationApplianceProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationApplianceInner + * object. + * + * @return the inner object. + */ + ReplicationApplianceInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationApplianceProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationApplianceProperties.java new file mode 100644 index 000000000000..f3ee92d6b27c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationApplianceProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication appliance properties. */ +@Fluent +public final class ReplicationApplianceProperties { + /* + * Provider specific settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private ApplianceSpecificDetails providerSpecificDetails; + + /** Creates an instance of ReplicationApplianceProperties class. */ + public ReplicationApplianceProperties() { + } + + /** + * Get the providerSpecificDetails property: Provider specific settings. + * + * @return the providerSpecificDetails value. + */ + public ApplianceSpecificDetails providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: Provider specific settings. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the ReplicationApplianceProperties object itself. + */ + public ReplicationApplianceProperties withProviderSpecificDetails( + ApplianceSpecificDetails providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAppliances.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAppliances.java new file mode 100644 index 000000000000..acfaaeb7c3c0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAppliances.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.recoveryservicessiterecovery.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationAppliances. */ +public interface ReplicationAppliances { + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Azure Site Recovery appliances for the vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of appliances. + * + *

Gets the list of Azure Site Recovery appliances for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery appliances for the vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceName, String resourceGroupName, String filter, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResults.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResults.java new file mode 100644 index 000000000000..2ab19fcdeef5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResults.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner; + +/** An immutable client-side representation of ReplicationEligibilityResults. */ +public interface ReplicationEligibilityResults { + /** + * Gets the name property: Gets the name of this object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Gets the object type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the id property: Gets Unique ARM identifier for this object. + * + * @return the id value. + */ + String id(); + + /** + * Gets the properties property: Gets properties model for replication eligibility results API. + * + * @return the properties value. + */ + ReplicationEligibilityResultsProperties properties(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsInner object. + * + * @return the inner object. + */ + ReplicationEligibilityResultsInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsCollection.java new file mode 100644 index 000000000000..1aef221dd614 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsCollection.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner; +import java.util.List; + +/** An immutable client-side representation of ReplicationEligibilityResultsCollection. */ +public interface ReplicationEligibilityResultsCollection { + /** + * Gets the value property: The replication eligibility results details. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationEligibilityResultsCollectionInner + * object. + * + * @return the inner object. + */ + ReplicationEligibilityResultsCollectionInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsErrorInfo.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsErrorInfo.java new file mode 100644 index 000000000000..4b7ac0ba98cf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsErrorInfo.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Error model that can be exposed to the user. */ +@Fluent +public final class ReplicationEligibilityResultsErrorInfo { + /* + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The possible causes. + */ + @JsonProperty(value = "possibleCauses") + private String possibleCauses; + + /* + * The recommended action. + */ + @JsonProperty(value = "recommendedAction") + private String recommendedAction; + + /* + * The error status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of ReplicationEligibilityResultsErrorInfo class. */ + public ReplicationEligibilityResultsErrorInfo() { + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The error code. + * + * @param code the code value to set. + * @return the ReplicationEligibilityResultsErrorInfo object itself. + */ + public ReplicationEligibilityResultsErrorInfo withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The error message. + * + * @param message the message value to set. + * @return the ReplicationEligibilityResultsErrorInfo object itself. + */ + public ReplicationEligibilityResultsErrorInfo withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the possibleCauses property: The possible causes. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Set the possibleCauses property: The possible causes. + * + * @param possibleCauses the possibleCauses value to set. + * @return the ReplicationEligibilityResultsErrorInfo object itself. + */ + public ReplicationEligibilityResultsErrorInfo withPossibleCauses(String possibleCauses) { + this.possibleCauses = possibleCauses; + return this; + } + + /** + * Get the recommendedAction property: The recommended action. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Set the recommendedAction property: The recommended action. + * + * @param recommendedAction the recommendedAction value to set. + * @return the ReplicationEligibilityResultsErrorInfo object itself. + */ + public ReplicationEligibilityResultsErrorInfo withRecommendedAction(String recommendedAction) { + this.recommendedAction = recommendedAction; + return this; + } + + /** + * Get the status property: The error status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsOperations.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsOperations.java new file mode 100644 index 000000000000..713e1b7dda68 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsOperations.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationEligibilityResultsOperations. */ +public interface ReplicationEligibilityResultsOperations { + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results collection response model along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results collection response model. + */ + ReplicationEligibilityResultsCollection list(String resourceGroupName, String virtualMachineName); + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 replication eligibility results response model along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * Gets the validation errors in case the VM is unsuitable for protection. + * + *

Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param virtualMachineName Virtual Machine 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 eligibility results response model. + */ + ReplicationEligibilityResults get(String resourceGroupName, String virtualMachineName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsProperties.java new file mode 100644 index 000000000000..32dd60e9beca --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties model for replication eligibility results API. */ +@Fluent +public final class ReplicationEligibilityResultsProperties { + /* + * The client request Id. + */ + @JsonProperty(value = "clientRequestId", access = JsonProperty.Access.WRITE_ONLY) + private String clientRequestId; + + /* + * The error details. + */ + @JsonProperty(value = "errors") + private List errors; + + /** Creates an instance of ReplicationEligibilityResultsProperties class. */ + public ReplicationEligibilityResultsProperties() { + } + + /** + * Get the clientRequestId property: The client request Id. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Get the errors property: The error details. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The error details. + * + * @param errors the errors value to set. + * @return the ReplicationEligibilityResultsProperties object itself. + */ + public ReplicationEligibilityResultsProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEvents.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEvents.java new file mode 100644 index 000000000000..e6ca886a4ed4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEvents.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationEvents. */ +public interface ReplicationEvents { + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Azure Site Recovery events for the vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of Azure Site Recovery events. + * + *

Gets the list of Azure Site Recovery events for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery events for the vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context); + + /** + * Get the details of an Azure Site recovery event. + * + *

The operation to get the details of an Azure Site recovery event. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param eventName The name of the Azure Site Recovery event. + * @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 implements the Event class along with {@link Response}. + */ + Response getWithResponse(String resourceName, String resourceGroupName, String eventName, Context context); + + /** + * Get the details of an Azure Site recovery event. + * + *

The operation to get the details of an Azure Site recovery event. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param eventName The name of the Azure Site Recovery event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return implements the Event class. + */ + Event get(String resourceName, String resourceGroupName, String eventName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationFabrics.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationFabrics.java new file mode 100644 index 000000000000..c09d880357f3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationFabrics.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.recoveryservicessiterecovery.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 ReplicationFabrics. */ +public interface ReplicationFabrics { + /** + * Gets the list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the Azure Site Recovery fabrics in the vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of ASR fabrics. + * + *

Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 a list of the Azure Site Recovery fabrics in the vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the details of an ASR fabric. + * + *

Gets the details of an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Azure Site Recovery fabric along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String filter, Context context); + + /** + * Gets the details of an ASR fabric. + * + *

Gets the details of an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 an Azure Site Recovery fabric. + */ + Fabric get(String resourceName, String resourceGroupName, String fabricName); + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 purge(String resourceName, String resourceGroupName, String fabricName); + + /** + * Purges the site. + * + *

The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to purge. + * @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 purge(String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 definition. + */ + Fabric checkConsistency(String resourceName, String resourceGroupName, String fabricName); + + /** + * Checks the consistency of the ASR fabric. + * + *

The operation to perform a consistency check on the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 fabric definition. + */ + Fabric checkConsistency(String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 migrateToAad(String resourceName, String resourceGroupName, String fabricName); + + /** + * Migrates the site to AAD. + * + *

The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to migrate. + * @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 migrateToAad(String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 definition. + */ + Fabric reassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest); + + /** + * Perform failover of the process server. + * + *

The operation to move replications from a process server to another process server. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the process server. + * @param failoverProcessServerRequest The input to the failover process server 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 fabric definition. + */ + Fabric reassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context); + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, String resourceGroupName, String fabricName); + + /** + * Deletes the site. + * + *

The operation to delete or remove an Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName ASR fabric to delete. + * @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 resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 definition. + */ + Fabric renewCertificate( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate); + + /** + * Renews certificate for the fabric. + * + *

Renews the connection certificate for the ASR replication fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName fabric name to renew certs for. + * @param renewCertificate Renew certificate input. + * @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 definition. + */ + Fabric renewCertificate( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context); + + /** + * Gets the details of an ASR fabric. + * + *

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

Gets the details of an Azure Site Recovery fabric. + * + * @param id the resource ID. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Azure Site Recovery fabric along with {@link Response}. + */ + Response getByIdWithResponse(String id, String filter, Context context); + + /** + * Begins definition for a new Fabric resource. + * + * @param name resource name. + * @return the first stage of the new Fabric definition. + */ + Fabric.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationGroupDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationGroupDetails.java new file mode 100644 index 000000000000..8202bf089237 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationGroupDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Replication group details. This will be used in case of San. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("ReplicationGroupDetails") +@Immutable +public final class ReplicationGroupDetails extends ConfigurationSettings { + /** Creates an instance of ReplicationGroupDetails class. */ + public ReplicationGroupDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationJobs.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationJobs.java new file mode 100644 index 000000000000..584590e516a8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationJobs.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.recoveryservicessiterecovery.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 ReplicationJobs. */ +public interface ReplicationJobs { + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Azure Site Recovery Jobs for the vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of jobs. + * + *

Gets the list of Azure Site Recovery Jobs for the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Azure Site Recovery Jobs for the vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context); + + /** + * Gets the job details. + * + *

Get the details of an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @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 an Azure Site Recovery job along with {@link Response}. + */ + Response getWithResponse(String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * Gets the job details. + * + *

Get the details of an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 an Azure Site Recovery job. + */ + Job get(String resourceName, String resourceGroupName, String jobName); + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + Job cancel(String resourceName, String resourceGroupName, String jobName); + + /** + * Cancels the specified job. + * + *

The operation to cancel an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + Job cancel(String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + Job restart(String resourceName, String resourceGroupName, String jobName); + + /** + * Restarts the specified job. + * + *

The operation to restart an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + Job restart(String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + Job resume(String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams); + + /** + * Resumes the specified job. + * + *

The operation to resume an Azure Site Recovery job. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job identifier. + * @param resumeJobParams Resume rob comments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + Job resume( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context); + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + Job export(String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter); + + /** + * Exports the details of the Azure Site Recovery jobs of the vault. + * + *

The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobQueryParameter job query filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job details. + */ + Job export(String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationLogicalNetworks.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationLogicalNetworks.java new file mode 100644 index 000000000000..fea53eb7f39f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationLogicalNetworks.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationLogicalNetworks. */ +public interface ReplicationLogicalNetworks { + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server 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 list of logical networks as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of logical networks under a fabric. + * + *

Lists all the logical networks of the Azure Site Recovery fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server 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 list of logical networks as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets a logical network with specified server id and logical network name. + * + *

Gets the details of a logical network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param logicalNetworkName Logical network 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 a logical network along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName, Context context); + + /** + * Gets a logical network with specified server id and logical network name. + * + *

Gets the details of a logical network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param logicalNetworkName Logical network 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 a logical network. + */ + LogicalNetwork get(String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationMigrationItems.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationMigrationItems.java new file mode 100644 index 000000000000..bee5326ae35f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationMigrationItems.java @@ -0,0 +1,538 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationMigrationItems. */ +public interface ReplicationMigrationItems { + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR migration items in the protection container as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Gets the list of migration items in the protection container. + * + *

Gets the list of ASR migration items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR migration items in the protection container as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String skipToken, + String takeToken, + String filter, + Context context); + + /** + * Gets the details of a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 a migration item along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context); + + /** + * Gets the details of a migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 a migration item. + */ + MigrationItem get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName); + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName); + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param deleteOption The delete option. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context); + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem migrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput); + + /** + * Migrate item. + * + *

The operation to initiate migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param migrateInput Migrate input. + * @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 migration item. + */ + MigrationItem migrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context); + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem pauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput); + + /** + * Pause replication. + * + *

The operation to initiate pause replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @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 migration item. + */ + MigrationItem pauseReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + PauseReplicationInput pauseReplicationInput, + Context context); + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem resumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput); + + /** + * Resume replication. + * + *

The operation to initiate resume replication of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @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 migration item. + */ + MigrationItem resumeReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResumeReplicationInput resumeReplicationInput, + Context context); + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem resync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input); + + /** + * Resynchronizes replication. + * + *

The operation to resynchronize replication of an ASR migration item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param input Resync input. + * @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 migration item. + */ + MigrationItem resync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + ResyncInput input, + Context context); + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem testMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput); + + /** + * Test migrate item. + * + *

The operation to initiate test migration of the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateInput Test migrate input. + * @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 migration item. + */ + MigrationItem testMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context); + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item. + */ + MigrationItem testMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput); + + /** + * Test migrate cleanup. + * + *

The operation to initiate test migrate cleanup. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param testMigrateCleanupInput Test migrate cleanup input. + * @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 migration item. + */ + MigrationItem testMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context); + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 migration items in the vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of migration items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of migration items in the vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceName, + String resourceGroupName, + String skipToken, + String takeToken, + String filter, + Context context); + + /** + * Gets the details of a migration 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 a migration item along with {@link Response}. + */ + MigrationItem getById(String id); + + /** + * Gets the details of a migration 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 a migration item along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration 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); + + /** + * Delete the migration item. + * + *

The operation to delete an ASR migration item. + * + * @param id the resource ID. + * @param deleteOption The delete option. + * @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, String deleteOption, Context context); + + /** + * Begins definition for a new MigrationItem resource. + * + * @param name resource name. + * @return the first stage of the new MigrationItem definition. + */ + MigrationItem.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworkMappings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworkMappings.java new file mode 100644 index 000000000000..ee103a20d457 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworkMappings.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationNetworkMappings. */ +public interface ReplicationNetworkMappings { + /** + * Gets all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName); + + /** + * Gets all the network mappings under a network. + * + *

Lists all ASR network mappings for the specified network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network 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 list of network mappings as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context); + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping 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 an ASR network mapping along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context); + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName Network mapping 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 an ASR network mapping. + */ + NetworkMapping get( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName); + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName); + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Primary fabric name. + * @param networkName Primary network name. + * @param networkMappingName ARM Resource Name for network mapping. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context); + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network mappings as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets all the network mappings under a vault. + * + *

Lists all ASR network mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 list of network mappings as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets network mapping by name. + * + *

Gets the details of an ASR network mapping. + * + * @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 an ASR network mapping along with {@link Response}. + */ + NetworkMapping getById(String id); + + /** + * Gets network mapping by name. + * + *

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

The operation to delete a network mapping. + * + * @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); + + /** + * Delete network mapping. + * + *

The operation to delete a network mapping. + * + * @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 NetworkMapping resource. + * + * @param name resource name. + * @return the first stage of the new NetworkMapping definition. + */ + NetworkMapping.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworks.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworks.java new file mode 100644 index 000000000000..83ef4bd0ec97 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworks.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationNetworks. */ +public interface ReplicationNetworks { + /** + * Gets the list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics(String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of networks under a fabric. + * + *

Lists the networks available for a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 list of networks as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets a network with specified server id and network name. + * + *

Gets the details of a network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param networkName Primary network 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 a network along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context); + + /** + * Gets a network with specified server id and network name. + * + *

Gets the details of a network. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Server Id. + * @param networkName Primary network 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 a network. + */ + Network get(String resourceName, String resourceGroupName, String fabricName, String networkName); + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of networks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of networks. View-only API. + * + *

Lists the networks available in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 list of networks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationPolicies.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationPolicies.java new file mode 100644 index 000000000000..e753348f3e13 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationPolicies.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationPolicies. */ +public interface ReplicationPolicies { + /** + * Gets the list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Profile Collection details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of replication policies. + * + *

Lists the replication policies for a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 protection Profile Collection details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the requested policy. + * + *

Gets the details of a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 a replication policy along with {@link Response}. + */ + Response getWithResponse(String resourceName, String resourceGroupName, String policyName, Context context); + + /** + * Gets the requested policy. + * + *

Gets the details of a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 a replication policy. + */ + Policy get(String resourceName, String resourceGroupName, String policyName); + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName); + + /** + * Delete the policy. + * + *

The operation to delete a replication policy. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Replication 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 resourceName, String resourceGroupName, String policyName, Context context); + + /** + * Gets the requested policy. + * + *

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

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

The operation to delete a replication 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); + + /** + * Delete the policy. + * + *

The operation to delete a replication 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 Policy resource. + * + * @param name resource name. + * @return the first stage of the new Policy definition. + */ + Policy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectableItems.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectableItems.java new file mode 100644 index 000000000000..3ce1a5059351 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectableItems.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationProtectableItems. */ +public interface ReplicationProtectableItems { + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protectable item collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Gets the list of protectable items. + * + *

Lists the protectable items in a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param filter OData filter options. + * @param take take OData query parameter. + * @param skipToken skipToken OData query parameter. + * @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 protectable item collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + String take, + String skipToken, + Context context); + + /** + * Gets the details of a protectable item. + * + *

The operation to get the details of a protectable item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param protectableItemName Protectable 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 replication protected item along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName, + Context context); + + /** + * Gets the details of a protectable item. + * + *

The operation to get the details of a protectable item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param protectableItemName Protectable 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 replication protected item. + */ + ProtectableItem get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItem.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItem.java new file mode 100644 index 000000000000..bd59bcf829ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItem.java @@ -0,0 +1,609 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner; + +/** An immutable client-side representation of ReplicationProtectedItem. */ +public interface ReplicationProtectedItem { + /** + * 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: The custom data. + * + * @return the properties value. + */ + ReplicationProtectedItemProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * 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.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner + * object. + * + * @return the inner object. + */ + ReplicationProtectedItemInner innerModel(); + + /** The entirety of the ReplicationProtectedItem definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ReplicationProtectedItem definition stages. */ + interface DefinitionStages { + /** The first stage of the ReplicationProtectedItem definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ReplicationProtectedItem definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName, fabricName, protectionContainerName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric. + * @param protectionContainerName Protection container name. + * @return the next definition stage. + */ + WithCreate withExistingReplicationProtectionContainer( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + } + /** + * The stage of the ReplicationProtectedItem 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ReplicationProtectedItem create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ReplicationProtectedItem create(Context context); + } + /** The stage of the ReplicationProtectedItem definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Enable protection input properties.. + * + * @param properties Enable protection input properties. + * @return the next definition stage. + */ + WithCreate withProperties(EnableProtectionInputProperties properties); + } + } + /** + * Begins update for the ReplicationProtectedItem resource. + * + * @return the stage of resource update. + */ + ReplicationProtectedItem.Update update(); + + /** The template for ReplicationProtectedItem update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ReplicationProtectedItem apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ReplicationProtectedItem apply(Context context); + } + /** The ReplicationProtectedItem update stages. */ + interface UpdateStages { + /** The stage of the ReplicationProtectedItem update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Update replication protected item properties.. + * + * @param properties Update replication protected item properties. + * @return the next definition stage. + */ + Update withProperties(UpdateReplicationProtectedItemInputProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ReplicationProtectedItem refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ReplicationProtectedItem refresh(Context context); + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param addDisksInput Add disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem addDisks(AddDisksInput addDisksInput); + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param addDisksInput Add disks input. + * @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 protected item. + */ + ReplicationProtectedItem addDisks(AddDisksInput addDisksInput, Context context); + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem applyRecoveryPoint(ApplyRecoveryPointInput applyRecoveryPointInput); + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @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 protected item. + */ + ReplicationProtectedItem applyRecoveryPoint(ApplyRecoveryPointInput applyRecoveryPointInput, Context context); + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication 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 replication protected item. + */ + ReplicationProtectedItem failoverCancel(); + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @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 protected item. + */ + ReplicationProtectedItem failoverCancel(Context context); + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication 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 replication protected item. + */ + ReplicationProtectedItem failoverCommit(); + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @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 protected item. + */ + ReplicationProtectedItem failoverCommit(Context context); + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param failoverInput Planned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem plannedFailover(PlannedFailoverInput failoverInput); + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param failoverInput Planned failover input. + * @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 protected item. + */ + ReplicationProtectedItem plannedFailover(PlannedFailoverInput failoverInput, Context context); + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param disableProtectionInput Disable protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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(DisableProtectionInput disableProtectionInput); + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param disableProtectionInput Disable protection input. + * @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(DisableProtectionInput disableProtectionInput, Context context); + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param removeDisksInput Remove disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem removeDisks(RemoveDisksInput removeDisksInput); + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param removeDisksInput Remove disks input. + * @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 protected item. + */ + ReplicationProtectedItem removeDisks(RemoveDisksInput removeDisksInput, Context context); + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem repairReplication(); + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @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 protected item. + */ + ReplicationProtectedItem repairReplication(Context context); + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param reprotectInput Reverse replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem reprotect(ReverseReplicationInput reprotectInput); + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param reprotectInput Reverse replication input. + * @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 protected item. + */ + ReplicationProtectedItem reprotect(ReverseReplicationInput reprotectInput, Context context); + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resolveHealthInput Health issue input object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem resolveHealthErrors(ResolveHealthInput resolveHealthInput); + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resolveHealthInput Health issue input object. + * @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 protected item. + */ + ReplicationProtectedItem resolveHealthErrors(ResolveHealthInput resolveHealthInput, Context context); + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param switchProviderInput Switch provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem switchProvider(SwitchProviderInput switchProviderInput); + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param switchProviderInput Switch provider input. + * @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 protected item. + */ + ReplicationProtectedItem switchProvider(SwitchProviderInput switchProviderInput, Context context); + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param testfailoverInput Test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem testFailover(TestFailoverInput testfailoverInput); + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param testfailoverInput Test failover input. + * @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 protected item. + */ + ReplicationProtectedItem testFailover(TestFailoverInput testfailoverInput, Context context); + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param cleanupInput Test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem testFailoverCleanup(TestFailoverCleanupInput cleanupInput); + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param cleanupInput Test failover cleanup input. + * @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 protected item. + */ + ReplicationProtectedItem testFailoverCleanup(TestFailoverCleanupInput cleanupInput, Context context); + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param failoverInput Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem unplannedFailover(UnplannedFailoverInput failoverInput); + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param failoverInput Failover input. + * @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 protected item. + */ + ReplicationProtectedItem unplannedFailover(UnplannedFailoverInput failoverInput, Context context); + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param applianceUpdateInput Appliance update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem updateAppliance(UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput); + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param applianceUpdateInput Appliance update protection input. + * @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 protected item. + */ + ReplicationProtectedItem updateAppliance( + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, Context context); + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem updateMobilityService(UpdateMobilityServiceRequest updateMobilityServiceRequest); + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @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 protected item. + */ + ReplicationProtectedItem updateMobilityService( + UpdateMobilityServiceRequest updateMobilityServiceRequest, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemCollection.java new file mode 100644 index 000000000000..d0723a6ead71 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication protected item collection. */ +@Fluent +public final class ReplicationProtectedItemCollection { + /* + * The Replication protected item details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ReplicationProtectedItemCollection class. */ + public ReplicationProtectedItemCollection() { + } + + /** + * Get the value property: The Replication protected item details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Replication protected item details. + * + * @param value the value value to set. + * @return the ReplicationProtectedItemCollection object itself. + */ + public ReplicationProtectedItemCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the ReplicationProtectedItemCollection object itself. + */ + public ReplicationProtectedItemCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemOperation.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemOperation.java new file mode 100644 index 000000000000..95ccf3ea2d76 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemOperation.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReplicationProtectedItemOperation. */ +public final class ReplicationProtectedItemOperation extends ExpandableStringEnum { + /** Static value ReverseReplicate for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation REVERSE_REPLICATE = fromString("ReverseReplicate"); + + /** Static value Commit for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation COMMIT = fromString("Commit"); + + /** Static value PlannedFailover for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation PLANNED_FAILOVER = fromString("PlannedFailover"); + + /** Static value UnplannedFailover for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation UNPLANNED_FAILOVER = fromString("UnplannedFailover"); + + /** Static value DisableProtection for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation DISABLE_PROTECTION = fromString("DisableProtection"); + + /** Static value TestFailover for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation TEST_FAILOVER = fromString("TestFailover"); + + /** Static value TestFailoverCleanup for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation TEST_FAILOVER_CLEANUP = fromString("TestFailoverCleanup"); + + /** Static value Failback for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation FAILBACK = fromString("Failback"); + + /** Static value FinalizeFailback for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation FINALIZE_FAILBACK = fromString("FinalizeFailback"); + + /** Static value CancelFailover for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation CANCEL_FAILOVER = fromString("CancelFailover"); + + /** Static value ChangePit for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation CHANGE_PIT = fromString("ChangePit"); + + /** Static value RepairReplication for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation REPAIR_REPLICATION = fromString("RepairReplication"); + + /** Static value SwitchProtection for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation SWITCH_PROTECTION = fromString("SwitchProtection"); + + /** Static value CompleteMigration for ReplicationProtectedItemOperation. */ + public static final ReplicationProtectedItemOperation COMPLETE_MIGRATION = fromString("CompleteMigration"); + + /** + * Creates or finds a ReplicationProtectedItemOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationProtectedItemOperation. + */ + @JsonCreator + public static ReplicationProtectedItemOperation fromString(String name) { + return fromString(name, ReplicationProtectedItemOperation.class); + } + + /** + * Gets known ReplicationProtectedItemOperation values. + * + * @return known ReplicationProtectedItemOperation values. + */ + public static Collection values() { + return values(ReplicationProtectedItemOperation.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemProperties.java new file mode 100644 index 000000000000..e9f6b47e0910 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemProperties.java @@ -0,0 +1,827 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Replication protected item custom data details. */ +@Fluent +public final class ReplicationProtectedItemProperties { + /* + * The name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The type of protected item type. + */ + @JsonProperty(value = "protectedItemType") + private String protectedItemType; + + /* + * The protected item ARM Id. + */ + @JsonProperty(value = "protectableItemId") + private String protectableItemId; + + /* + * The recovery provider ARM Id. + */ + @JsonProperty(value = "recoveryServicesProviderId") + private String recoveryServicesProviderId; + + /* + * The friendly name of the primary fabric. + */ + @JsonProperty(value = "primaryFabricFriendlyName") + private String primaryFabricFriendlyName; + + /* + * The fabric provider of the primary fabric. + */ + @JsonProperty(value = "primaryFabricProvider") + private String primaryFabricProvider; + + /* + * The friendly name of recovery fabric. + */ + @JsonProperty(value = "recoveryFabricFriendlyName") + private String recoveryFabricFriendlyName; + + /* + * The Arm Id of recovery fabric. + */ + @JsonProperty(value = "recoveryFabricId") + private String recoveryFabricId; + + /* + * The name of primary protection container friendly name. + */ + @JsonProperty(value = "primaryProtectionContainerFriendlyName") + private String primaryProtectionContainerFriendlyName; + + /* + * The name of recovery container friendly name. + */ + @JsonProperty(value = "recoveryProtectionContainerFriendlyName") + private String recoveryProtectionContainerFriendlyName; + + /* + * The protection status. + */ + @JsonProperty(value = "protectionState") + private String protectionState; + + /* + * The protection state description. + */ + @JsonProperty(value = "protectionStateDescription") + private String protectionStateDescription; + + /* + * The Current active location of the PE. + */ + @JsonProperty(value = "activeLocation") + private String activeLocation; + + /* + * The Test failover state. + */ + @JsonProperty(value = "testFailoverState") + private String testFailoverState; + + /* + * The Test failover state description. + */ + @JsonProperty(value = "testFailoverStateDescription") + private String testFailoverStateDescription; + + /* + * The switch provider state. + */ + @JsonProperty(value = "switchProviderState") + private String switchProviderState; + + /* + * The switch provider state description. + */ + @JsonProperty(value = "switchProviderStateDescription") + private String switchProviderStateDescription; + + /* + * The allowed operations on the Replication protected item. + */ + @JsonProperty(value = "allowedOperations") + private List allowedOperations; + + /* + * The consolidated protection health for the VM taking any issues with SRS as well as all the replication units + * associated with the VM's replication group into account. This is a string representation of the ProtectionHealth + * enumeration. + */ + @JsonProperty(value = "replicationHealth") + private String replicationHealth; + + /* + * The consolidated failover health for the VM. + */ + @JsonProperty(value = "failoverHealth") + private String failoverHealth; + + /* + * List of health errors. + */ + @JsonProperty(value = "healthErrors") + private List healthErrors; + + /* + * The ID of Policy governing this PE. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * The name of Policy governing this PE. + */ + @JsonProperty(value = "policyFriendlyName") + private String policyFriendlyName; + + /* + * The Last successful failover time. + */ + @JsonProperty(value = "lastSuccessfulFailoverTime") + private OffsetDateTime lastSuccessfulFailoverTime; + + /* + * The Last successful test failover time. + */ + @JsonProperty(value = "lastSuccessfulTestFailoverTime") + private OffsetDateTime lastSuccessfulTestFailoverTime; + + /* + * The current scenario. + */ + @JsonProperty(value = "currentScenario") + private CurrentScenarioDetails currentScenario; + + /* + * The recovery point ARM Id to which the Vm was failed over. + */ + @JsonProperty(value = "failoverRecoveryPointId") + private String failoverRecoveryPointId; + + /* + * The Replication provider custom settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private ReplicationProviderSpecificSettings providerSpecificDetails; + + /* + * The recovery container Id. + */ + @JsonProperty(value = "recoveryContainerId") + private String recoveryContainerId; + + /* + * The correlation Id for events associated with this protected item. + */ + @JsonProperty(value = "eventCorrelationId") + private String eventCorrelationId; + + /** Creates an instance of ReplicationProtectedItemProperties class. */ + public ReplicationProtectedItemProperties() { + } + + /** + * Get the friendlyName property: The name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The name. + * + * @param friendlyName the friendlyName value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the protectedItemType property: The type of protected item type. + * + * @return the protectedItemType value. + */ + public String protectedItemType() { + return this.protectedItemType; + } + + /** + * Set the protectedItemType property: The type of protected item type. + * + * @param protectedItemType the protectedItemType value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withProtectedItemType(String protectedItemType) { + this.protectedItemType = protectedItemType; + return this; + } + + /** + * Get the protectableItemId property: The protected item ARM Id. + * + * @return the protectableItemId value. + */ + public String protectableItemId() { + return this.protectableItemId; + } + + /** + * Set the protectableItemId property: The protected item ARM Id. + * + * @param protectableItemId the protectableItemId value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withProtectableItemId(String protectableItemId) { + this.protectableItemId = protectableItemId; + return this; + } + + /** + * Get the recoveryServicesProviderId property: The recovery provider ARM Id. + * + * @return the recoveryServicesProviderId value. + */ + public String recoveryServicesProviderId() { + return this.recoveryServicesProviderId; + } + + /** + * Set the recoveryServicesProviderId property: The recovery provider ARM Id. + * + * @param recoveryServicesProviderId the recoveryServicesProviderId value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withRecoveryServicesProviderId(String recoveryServicesProviderId) { + this.recoveryServicesProviderId = recoveryServicesProviderId; + return this; + } + + /** + * Get the primaryFabricFriendlyName property: The friendly name of the primary fabric. + * + * @return the primaryFabricFriendlyName value. + */ + public String primaryFabricFriendlyName() { + return this.primaryFabricFriendlyName; + } + + /** + * Set the primaryFabricFriendlyName property: The friendly name of the primary fabric. + * + * @param primaryFabricFriendlyName the primaryFabricFriendlyName value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withPrimaryFabricFriendlyName(String primaryFabricFriendlyName) { + this.primaryFabricFriendlyName = primaryFabricFriendlyName; + return this; + } + + /** + * Get the primaryFabricProvider property: The fabric provider of the primary fabric. + * + * @return the primaryFabricProvider value. + */ + public String primaryFabricProvider() { + return this.primaryFabricProvider; + } + + /** + * Set the primaryFabricProvider property: The fabric provider of the primary fabric. + * + * @param primaryFabricProvider the primaryFabricProvider value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withPrimaryFabricProvider(String primaryFabricProvider) { + this.primaryFabricProvider = primaryFabricProvider; + return this; + } + + /** + * Get the recoveryFabricFriendlyName property: The friendly name of recovery fabric. + * + * @return the recoveryFabricFriendlyName value. + */ + public String recoveryFabricFriendlyName() { + return this.recoveryFabricFriendlyName; + } + + /** + * Set the recoveryFabricFriendlyName property: The friendly name of recovery fabric. + * + * @param recoveryFabricFriendlyName the recoveryFabricFriendlyName value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withRecoveryFabricFriendlyName(String recoveryFabricFriendlyName) { + this.recoveryFabricFriendlyName = recoveryFabricFriendlyName; + return this; + } + + /** + * Get the recoveryFabricId property: The Arm Id of recovery fabric. + * + * @return the recoveryFabricId value. + */ + public String recoveryFabricId() { + return this.recoveryFabricId; + } + + /** + * Set the recoveryFabricId property: The Arm Id of recovery fabric. + * + * @param recoveryFabricId the recoveryFabricId value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withRecoveryFabricId(String recoveryFabricId) { + this.recoveryFabricId = recoveryFabricId; + return this; + } + + /** + * Get the primaryProtectionContainerFriendlyName property: The name of primary protection container friendly name. + * + * @return the primaryProtectionContainerFriendlyName value. + */ + public String primaryProtectionContainerFriendlyName() { + return this.primaryProtectionContainerFriendlyName; + } + + /** + * Set the primaryProtectionContainerFriendlyName property: The name of primary protection container friendly name. + * + * @param primaryProtectionContainerFriendlyName the primaryProtectionContainerFriendlyName value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withPrimaryProtectionContainerFriendlyName( + String primaryProtectionContainerFriendlyName) { + this.primaryProtectionContainerFriendlyName = primaryProtectionContainerFriendlyName; + return this; + } + + /** + * Get the recoveryProtectionContainerFriendlyName property: The name of recovery container friendly name. + * + * @return the recoveryProtectionContainerFriendlyName value. + */ + public String recoveryProtectionContainerFriendlyName() { + return this.recoveryProtectionContainerFriendlyName; + } + + /** + * Set the recoveryProtectionContainerFriendlyName property: The name of recovery container friendly name. + * + * @param recoveryProtectionContainerFriendlyName the recoveryProtectionContainerFriendlyName value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withRecoveryProtectionContainerFriendlyName( + String recoveryProtectionContainerFriendlyName) { + this.recoveryProtectionContainerFriendlyName = recoveryProtectionContainerFriendlyName; + return this; + } + + /** + * Get the protectionState property: The protection status. + * + * @return the protectionState value. + */ + public String protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: The protection status. + * + * @param protectionState the protectionState value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withProtectionState(String protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the protectionStateDescription property: The protection state description. + * + * @return the protectionStateDescription value. + */ + public String protectionStateDescription() { + return this.protectionStateDescription; + } + + /** + * Set the protectionStateDescription property: The protection state description. + * + * @param protectionStateDescription the protectionStateDescription value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withProtectionStateDescription(String protectionStateDescription) { + this.protectionStateDescription = protectionStateDescription; + return this; + } + + /** + * Get the activeLocation property: The Current active location of the PE. + * + * @return the activeLocation value. + */ + public String activeLocation() { + return this.activeLocation; + } + + /** + * Set the activeLocation property: The Current active location of the PE. + * + * @param activeLocation the activeLocation value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withActiveLocation(String activeLocation) { + this.activeLocation = activeLocation; + return this; + } + + /** + * Get the testFailoverState property: The Test failover state. + * + * @return the testFailoverState value. + */ + public String testFailoverState() { + return this.testFailoverState; + } + + /** + * Set the testFailoverState property: The Test failover state. + * + * @param testFailoverState the testFailoverState value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withTestFailoverState(String testFailoverState) { + this.testFailoverState = testFailoverState; + return this; + } + + /** + * Get the testFailoverStateDescription property: The Test failover state description. + * + * @return the testFailoverStateDescription value. + */ + public String testFailoverStateDescription() { + return this.testFailoverStateDescription; + } + + /** + * Set the testFailoverStateDescription property: The Test failover state description. + * + * @param testFailoverStateDescription the testFailoverStateDescription value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withTestFailoverStateDescription(String testFailoverStateDescription) { + this.testFailoverStateDescription = testFailoverStateDescription; + return this; + } + + /** + * Get the switchProviderState property: The switch provider state. + * + * @return the switchProviderState value. + */ + public String switchProviderState() { + return this.switchProviderState; + } + + /** + * Set the switchProviderState property: The switch provider state. + * + * @param switchProviderState the switchProviderState value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withSwitchProviderState(String switchProviderState) { + this.switchProviderState = switchProviderState; + return this; + } + + /** + * Get the switchProviderStateDescription property: The switch provider state description. + * + * @return the switchProviderStateDescription value. + */ + public String switchProviderStateDescription() { + return this.switchProviderStateDescription; + } + + /** + * Set the switchProviderStateDescription property: The switch provider state description. + * + * @param switchProviderStateDescription the switchProviderStateDescription value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withSwitchProviderStateDescription( + String switchProviderStateDescription) { + this.switchProviderStateDescription = switchProviderStateDescription; + return this; + } + + /** + * Get the allowedOperations property: The allowed operations on the Replication protected item. + * + * @return the allowedOperations value. + */ + public List allowedOperations() { + return this.allowedOperations; + } + + /** + * Set the allowedOperations property: The allowed operations on the Replication protected item. + * + * @param allowedOperations the allowedOperations value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withAllowedOperations(List allowedOperations) { + this.allowedOperations = allowedOperations; + return this; + } + + /** + * Get the replicationHealth property: The consolidated protection health for the VM taking any issues with SRS as + * well as all the replication units associated with the VM's replication group into account. This is a string + * representation of the ProtectionHealth enumeration. + * + * @return the replicationHealth value. + */ + public String replicationHealth() { + return this.replicationHealth; + } + + /** + * Set the replicationHealth property: The consolidated protection health for the VM taking any issues with SRS as + * well as all the replication units associated with the VM's replication group into account. This is a string + * representation of the ProtectionHealth enumeration. + * + * @param replicationHealth the replicationHealth value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withReplicationHealth(String replicationHealth) { + this.replicationHealth = replicationHealth; + return this; + } + + /** + * Get the failoverHealth property: The consolidated failover health for the VM. + * + * @return the failoverHealth value. + */ + public String failoverHealth() { + return this.failoverHealth; + } + + /** + * Set the failoverHealth property: The consolidated failover health for the VM. + * + * @param failoverHealth the failoverHealth value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withFailoverHealth(String failoverHealth) { + this.failoverHealth = failoverHealth; + return this; + } + + /** + * Get the healthErrors property: List of health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Set the healthErrors property: List of health errors. + * + * @param healthErrors the healthErrors value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withHealthErrors(List healthErrors) { + this.healthErrors = healthErrors; + return this; + } + + /** + * Get the policyId property: The ID of Policy governing this PE. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: The ID of Policy governing this PE. + * + * @param policyId the policyId value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the policyFriendlyName property: The name of Policy governing this PE. + * + * @return the policyFriendlyName value. + */ + public String policyFriendlyName() { + return this.policyFriendlyName; + } + + /** + * Set the policyFriendlyName property: The name of Policy governing this PE. + * + * @param policyFriendlyName the policyFriendlyName value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withPolicyFriendlyName(String policyFriendlyName) { + this.policyFriendlyName = policyFriendlyName; + return this; + } + + /** + * Get the lastSuccessfulFailoverTime property: The Last successful failover time. + * + * @return the lastSuccessfulFailoverTime value. + */ + public OffsetDateTime lastSuccessfulFailoverTime() { + return this.lastSuccessfulFailoverTime; + } + + /** + * Set the lastSuccessfulFailoverTime property: The Last successful failover time. + * + * @param lastSuccessfulFailoverTime the lastSuccessfulFailoverTime value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withLastSuccessfulFailoverTime( + OffsetDateTime lastSuccessfulFailoverTime) { + this.lastSuccessfulFailoverTime = lastSuccessfulFailoverTime; + return this; + } + + /** + * Get the lastSuccessfulTestFailoverTime property: The Last successful test failover time. + * + * @return the lastSuccessfulTestFailoverTime value. + */ + public OffsetDateTime lastSuccessfulTestFailoverTime() { + return this.lastSuccessfulTestFailoverTime; + } + + /** + * Set the lastSuccessfulTestFailoverTime property: The Last successful test failover time. + * + * @param lastSuccessfulTestFailoverTime the lastSuccessfulTestFailoverTime value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withLastSuccessfulTestFailoverTime( + OffsetDateTime lastSuccessfulTestFailoverTime) { + this.lastSuccessfulTestFailoverTime = lastSuccessfulTestFailoverTime; + return this; + } + + /** + * Get the currentScenario property: The current scenario. + * + * @return the currentScenario value. + */ + public CurrentScenarioDetails currentScenario() { + return this.currentScenario; + } + + /** + * Set the currentScenario property: The current scenario. + * + * @param currentScenario the currentScenario value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withCurrentScenario(CurrentScenarioDetails currentScenario) { + this.currentScenario = currentScenario; + return this; + } + + /** + * Get the failoverRecoveryPointId property: The recovery point ARM Id to which the Vm was failed over. + * + * @return the failoverRecoveryPointId value. + */ + public String failoverRecoveryPointId() { + return this.failoverRecoveryPointId; + } + + /** + * Set the failoverRecoveryPointId property: The recovery point ARM Id to which the Vm was failed over. + * + * @param failoverRecoveryPointId the failoverRecoveryPointId value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withFailoverRecoveryPointId(String failoverRecoveryPointId) { + this.failoverRecoveryPointId = failoverRecoveryPointId; + return this; + } + + /** + * Get the providerSpecificDetails property: The Replication provider custom settings. + * + * @return the providerSpecificDetails value. + */ + public ReplicationProviderSpecificSettings providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The Replication provider custom settings. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withProviderSpecificDetails( + ReplicationProviderSpecificSettings providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Get the recoveryContainerId property: The recovery container Id. + * + * @return the recoveryContainerId value. + */ + public String recoveryContainerId() { + return this.recoveryContainerId; + } + + /** + * Set the recoveryContainerId property: The recovery container Id. + * + * @param recoveryContainerId the recoveryContainerId value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withRecoveryContainerId(String recoveryContainerId) { + this.recoveryContainerId = recoveryContainerId; + return this; + } + + /** + * Get the eventCorrelationId property: The correlation Id for events associated with this protected item. + * + * @return the eventCorrelationId value. + */ + public String eventCorrelationId() { + return this.eventCorrelationId; + } + + /** + * Set the eventCorrelationId property: The correlation Id for events associated with this protected item. + * + * @param eventCorrelationId the eventCorrelationId value to set. + * @return the ReplicationProtectedItemProperties object itself. + */ + public ReplicationProtectedItemProperties withEventCorrelationId(String eventCorrelationId) { + this.eventCorrelationId = eventCorrelationId; + 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 (currentScenario() != null) { + currentScenario().validate(); + } + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItems.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItems.java new file mode 100644 index 000000000000..f34728340907 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItems.java @@ -0,0 +1,1006 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationProtectedItems. */ +public interface ReplicationProtectedItems { + /** + * Gets the list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Gets the list of Replication protected items. + * + *

Gets the list of ASR replication protected items in the protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 ASR replication protected items in the protection container as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * Gets the details of a Replication protected item. + * + *

Gets the details of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 an ASR replication protected item along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Gets the details of a Replication protected item. + * + *

Gets the details of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric unique name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 an ASR replication protected item. + */ + ReplicationProtectedItem get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Purges protection. + * + *

The operation to delete or purge a replication protected item. This operation will force delete the + * replication protected item. Use the remove operation on replication protected item to perform a clean disable + * replication for the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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. + */ + void purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem addDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput); + + /** + * Add disk(s) for protection. + * + *

Operation to add disks(s) to the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param addDisksInput Add disks input. + * @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 protected item. + */ + ReplicationProtectedItem addDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context); + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem applyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput); + + /** + * Change or apply recovery point. + * + *

The operation to change the recovery point of a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The ARM fabric name. + * @param protectionContainerName The protection container name. + * @param replicatedProtectedItemName The replicated protected item name. + * @param applyRecoveryPointInput The ApplyRecoveryPointInput. + * @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 protected item. + */ + ReplicationProtectedItem applyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context); + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + ReplicationProtectedItem failoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Execute cancel failover. + * + *

Operation to cancel the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + ReplicationProtectedItem failoverCancel( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + ReplicationProtectedItem failoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Execute commit failover. + * + *

Operation to commit the failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication 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 replication protected item. + */ + ReplicationProtectedItem failoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput); + + /** + * Execute planned failover. + * + *

Operation to initiate a planned failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Planned failover input. + * @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 protected item. + */ + ReplicationProtectedItem plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context); + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput); + + /** + * Disables protection. + * + *

The operation to disable replication on a replication protected item. This will also remove the item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param disableProtectionInput Disable protection input. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context); + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem removeDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput); + + /** + * Removes disk(s). + * + *

Operation to remove disk(s) from the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param removeDisksInput Remove disks input. + * @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 protected item. + */ + ReplicationProtectedItem removeDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context); + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem repairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Resynchronize or repair replication. + * + *

The operation to start resynchronize/repair replication for a replication protected item requiring + * resynchronization. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the container. + * @param replicatedProtectedItemName The name of the replication protected item. + * @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 protected item. + */ + ReplicationProtectedItem repairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput); + + /** + * Execute Reverse Replication\Reprotect. + * + *

Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param reprotectInput Reverse replication input. + * @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 protected item. + */ + ReplicationProtectedItem reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput reprotectInput, + Context context); + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem resolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput); + + /** + * Resolve health errors. + * + *

Operation to resolve health issues of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param resolveHealthInput Health issue input object. + * @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 protected item. + */ + ReplicationProtectedItem resolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context); + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem switchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput); + + /** + * Execute switch provider. + * + *

Operation to initiate a switch provider of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param switchProviderInput Switch provider input. + * @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 protected item. + */ + ReplicationProtectedItem switchProvider( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + SwitchProviderInput switchProviderInput, + Context context); + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem testFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput); + + /** + * Execute test failover. + * + *

Operation to perform a test failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param testfailoverInput Test failover input. + * @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 protected item. + */ + ReplicationProtectedItem testFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput testfailoverInput, + Context context); + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem testFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput); + + /** + * Execute test failover cleanup. + * + *

Operation to clean up the test failover of a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param cleanupInput Test failover cleanup input. + * @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 protected item. + */ + ReplicationProtectedItem testFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context); + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput); + + /** + * Execute unplanned failover. + * + *

Operation to initiate a failover of the replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param failoverInput Failover input. + * @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 protected item. + */ + ReplicationProtectedItem unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context); + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem updateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput); + + /** + * Updates appliance for replication protected Item. + * + *

The operation to update appliance of an ASR replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param replicatedProtectedItemName Replication protected item name. + * @param applianceUpdateInput Appliance update protection input. + * @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 protected item. + */ + ReplicationProtectedItem updateAppliance( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateApplianceForReplicationProtectedItemInput applianceUpdateInput, + Context context); + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 protected item. + */ + ReplicationProtectedItem updateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest); + + /** + * Update the mobility service on a protected item. + * + *

The operation to update(push update) the installed mobility service software on a replication protected item + * to the latest available version. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric containing the protected item. + * @param protectionContainerName The name of the container containing the protected item. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be updated. + * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. + * @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 protected item. + */ + ReplicationProtectedItem updateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context); + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ASR replication protected items in the vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of replication protected items. + * + *

Gets the list of ASR replication protected items in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of ASR replication protected items in the vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, String filter, Context context); + + /** + * Gets the details of a Replication protected item. + * + *

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

Gets the details of an ASR replication 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 an ASR replication protected item along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ReplicationProtectedItem resource. + * + * @param name resource name. + * @return the first stage of the new ReplicationProtectedItem definition. + */ + ReplicationProtectedItem.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainerMappings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainerMappings.java new file mode 100644 index 000000000000..9223eda030b1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainerMappings.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationProtectionContainerMappings. */ +public interface ReplicationProtectionContainerMappings { + /** + * Gets the list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Gets the list of protection container mappings for a protection container. + * + *

Lists the protection container mappings for a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * Gets a protection container mapping. + * + *

Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping 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 a protection container mapping along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context); + + /** + * Gets a protection container mapping. + * + *

Gets the details of a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection Container mapping 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 a protection container mapping. + */ + ProtectionContainerMapping get( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName); + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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 purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName); + + /** + * Purge protection container mapping. + * + *

The operation to purge(force delete) a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping 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 purge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context); + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput); + + /** + * Remove protection container mapping. + * + *

The operation to delete or remove a protection container mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param mappingName Protection container mapping name. + * @param removalInput Removal input. + * @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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context); + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of all protection container mappings in a vault. + * + *

Lists the protection container mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 protection container mapping collection class as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets a protection container mapping. + * + *

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

Gets the details of a protection container mapping. + * + * @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 a protection container mapping along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProtectionContainerMapping resource. + * + * @param name resource name. + * @return the first stage of the new ProtectionContainerMapping definition. + */ + ProtectionContainerMapping.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainers.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainers.java new file mode 100644 index 000000000000..f863d32da590 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainers.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationProtectionContainers. */ +public interface ReplicationProtectionContainers { + /** + * Gets the list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of protection container for a fabric. + * + *

Lists the protection containers in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 protection Container collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets the protection container details. + * + *

Gets the details of a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 a protection container along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * Gets the protection container details. + * + *

Gets the details of a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container 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 a protection container. + */ + ProtectionContainer get( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + ProtectionContainer discoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest); + + /** + * Adds a protectable item to the replication protection container. + * + *

The operation to a add a protectable item to a protection container(Add physical server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The name of the fabric. + * @param protectionContainerName The name of the protection container. + * @param discoverProtectableItemRequest The request object to add a protectable item. + * @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 protection container details. + */ + ProtectionContainer discoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context); + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * Removes a protection container. + * + *

Operation to remove a protection container. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric ARM name. + * @param protectionContainerName Unique protection container ARM 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 resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container details. + */ + ProtectionContainer switchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput); + + /** + * Switches protection from one container to another or one replication provider to another. + * + *

Operation to switch protection from one container to another or one replication provider to another. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Unique fabric name. + * @param protectionContainerName Protection container name. + * @param switchInput Switch protection input. + * @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 protection container details. + */ + ProtectionContainer switchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context); + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Container collection as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of all protection containers in a vault. + * + *

Lists the protection containers in a vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 protection Container collection as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the protection container details. + * + *

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

Gets the details of a protection container. + * + * @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 a protection container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProtectionContainer resource. + * + * @param name resource name. + * @return the first stage of the new ProtectionContainer definition. + */ + ProtectionContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntent.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntent.java new file mode 100644 index 000000000000..67c5009a7193 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntent.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner; + +/** An immutable client-side representation of ReplicationProtectionIntent. */ +public interface ReplicationProtectionIntent { + /** + * 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: The custom data. + * + * @return the properties value. + */ + ReplicationProtectionIntentProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner object. + * + * @return the inner object. + */ + ReplicationProtectionIntentInner innerModel(); + + /** The entirety of the ReplicationProtectionIntent definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ReplicationProtectionIntent definition stages. */ + interface DefinitionStages { + /** The first stage of the ReplicationProtectionIntent definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ReplicationProtectionIntent definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @return the next definition stage. + */ + WithCreate withExistingVault(String resourceName, String resourceGroupName); + } + /** + * The stage of the ReplicationProtectionIntent 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ReplicationProtectionIntent create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ReplicationProtectionIntent create(Context context); + } + /** The stage of the ReplicationProtectionIntent definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Create protection intent input properties.. + * + * @param properties Create protection intent input properties. + * @return the next definition stage. + */ + WithCreate withProperties(CreateProtectionIntentProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ReplicationProtectionIntent refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ReplicationProtectionIntent refresh(Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentCollection.java new file mode 100644 index 000000000000..725237687e88 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication protection intent objects collection. */ +@Fluent +public final class ReplicationProtectionIntentCollection { + /* + * The Replication protection intent details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ReplicationProtectionIntentCollection class. */ + public ReplicationProtectionIntentCollection() { + } + + /** + * Get the value property: The Replication protection intent details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Replication protection intent details. + * + * @param value the value value to set. + * @return the ReplicationProtectionIntentCollection object itself. + */ + public ReplicationProtectionIntentCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the ReplicationProtectionIntentCollection object itself. + */ + public ReplicationProtectionIntentCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentProperties.java new file mode 100644 index 000000000000..8bf80383ff9a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication protection intent custom data details. */ +@Fluent +public final class ReplicationProtectionIntentProperties { + /* + * The name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The job Id. + */ + @JsonProperty(value = "jobId", access = JsonProperty.Access.WRITE_ONLY) + private String jobId; + + /* + * The job state. + */ + @JsonProperty(value = "jobState", access = JsonProperty.Access.WRITE_ONLY) + private String jobState; + + /* + * A value indicating whether the intent object is active. + */ + @JsonProperty(value = "isActive", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isActive; + + /* + * The creation time in UTC. + */ + @JsonProperty(value = "creationTimeUTC", access = JsonProperty.Access.WRITE_ONLY) + private String creationTimeUtc; + + /* + * The Replication provider custom settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private ReplicationProtectionIntentProviderSpecificSettings providerSpecificDetails; + + /** Creates an instance of ReplicationProtectionIntentProperties class. */ + public ReplicationProtectionIntentProperties() { + } + + /** + * Get the friendlyName property: The name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The name. + * + * @param friendlyName the friendlyName value to set. + * @return the ReplicationProtectionIntentProperties object itself. + */ + public ReplicationProtectionIntentProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the jobId property: The job Id. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Get the jobState property: The job state. + * + * @return the jobState value. + */ + public String jobState() { + return this.jobState; + } + + /** + * Get the isActive property: A value indicating whether the intent object is active. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Get the creationTimeUtc property: The creation time in UTC. + * + * @return the creationTimeUtc value. + */ + public String creationTimeUtc() { + return this.creationTimeUtc; + } + + /** + * Get the providerSpecificDetails property: The Replication provider custom settings. + * + * @return the providerSpecificDetails value. + */ + public ReplicationProtectionIntentProviderSpecificSettings providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The Replication provider custom settings. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the ReplicationProtectionIntentProperties object itself. + */ + public ReplicationProtectionIntentProperties withProviderSpecificDetails( + ReplicationProtectionIntentProviderSpecificSettings providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentProviderSpecificSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentProviderSpecificSettings.java new file mode 100644 index 000000000000..5d90e7d34243 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentProviderSpecificSettings.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.recoveryservicessiterecovery.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 provider specific settings. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ReplicationProtectionIntentProviderSpecificSettings.class) +@JsonTypeName("ReplicationProtectionIntentProviderSpecificSettings") +@JsonSubTypes({@JsonSubTypes.Type(name = "A2A", value = A2AReplicationIntentDetails.class)}) +@Immutable +public class ReplicationProtectionIntentProviderSpecificSettings { + /** Creates an instance of ReplicationProtectionIntentProviderSpecificSettings class. */ + public ReplicationProtectionIntentProviderSpecificSettings() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntents.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntents.java new file mode 100644 index 000000000000..bbe954d9e130 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntents.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationProtectionIntents. */ +public interface ReplicationProtectionIntents { + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 ASR replication protection intent objects in the vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of replication protection intent objects. + * + *

Gets the list of ASR replication protection intent objects in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param skipToken The pagination token. + * @param takeToken The page size. + * @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 ASR replication protection intent objects in the vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, String takeToken, Context context); + + /** + * Gets the details of a Replication protection intent item. + * + *

Gets the details of an ASR replication protection intent. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName Replication protection intent 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 an ASR replication protection intent along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String intentObjectName, Context context); + + /** + * Gets the details of a Replication protection intent item. + * + *

Gets the details of an ASR replication protection intent. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param intentObjectName Replication protection intent 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 an ASR replication protection intent. + */ + ReplicationProtectionIntent get(String resourceName, String resourceGroupName, String intentObjectName); + + /** + * Gets the details of a Replication protection intent item. + * + *

Gets the details of an ASR replication protection intent. + * + * @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 an ASR replication protection intent along with {@link Response}. + */ + ReplicationProtectionIntent getById(String id); + + /** + * Gets the details of a Replication protection intent item. + * + *

Gets the details of an ASR replication protection intent. + * + * @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 an ASR replication protection intent along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ReplicationProtectionIntent resource. + * + * @param name resource name. + * @return the first stage of the new ReplicationProtectionIntent definition. + */ + ReplicationProtectionIntent.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderContainerUnmappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderContainerUnmappingInput.java new file mode 100644 index 000000000000..2969610fa3ad --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderContainerUnmappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Provider specific input for unpairing operations. */ +@Fluent +public final class ReplicationProviderContainerUnmappingInput { + /* + * The class type. + */ + @JsonProperty(value = "instanceType") + private String instanceType; + + /** Creates an instance of ReplicationProviderContainerUnmappingInput class. */ + public ReplicationProviderContainerUnmappingInput() { + } + + /** + * Get the instanceType property: The class type. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: The class type. + * + * @param instanceType the instanceType value to set. + * @return the ReplicationProviderContainerUnmappingInput object itself. + */ + public ReplicationProviderContainerUnmappingInput withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificContainerCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificContainerCreationInput.java new file mode 100644 index 000000000000..112bb9558102 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificContainerCreationInput.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.recoveryservicessiterecovery.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; + +/** Provider specific input for container creation operation. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ReplicationProviderSpecificContainerCreationInput.class) +@JsonTypeName("ReplicationProviderSpecificContainerCreationInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AContainerCreationInput.class), + @JsonSubTypes.Type(name = "A2ACrossClusterMigration", value = A2ACrossClusterMigrationContainerCreationInput.class), + @JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtContainerCreationInput.class) +}) +@Immutable +public class ReplicationProviderSpecificContainerCreationInput { + /** Creates an instance of ReplicationProviderSpecificContainerCreationInput class. */ + public ReplicationProviderSpecificContainerCreationInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificContainerMappingInput.java new file mode 100644 index 000000000000..a7f3dc9cad71 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificContainerMappingInput.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.recoveryservicessiterecovery.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; + +/** Provider specific input for pairing operations. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ReplicationProviderSpecificContainerMappingInput.class) +@JsonTypeName("ReplicationProviderSpecificContainerMappingInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AContainerMappingInput.class), + @JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtContainerMappingInput.class) +}) +@Immutable +public class ReplicationProviderSpecificContainerMappingInput { + /** Creates an instance of ReplicationProviderSpecificContainerMappingInput class. */ + public ReplicationProviderSpecificContainerMappingInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificSettings.java new file mode 100644 index 000000000000..e28bc3d731d7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificSettings.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.recoveryservicessiterecovery.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 provider specific settings. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ReplicationProviderSpecificSettings.class) +@JsonTypeName("ReplicationProviderSpecificSettings") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2ACrossClusterMigration", value = A2ACrossClusterMigrationReplicationDetails.class), + @JsonSubTypes.Type(name = "A2A", value = A2AReplicationDetails.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzureReplicationDetails.class), + @JsonSubTypes.Type(name = "HyperVReplicaBaseReplicationDetails", value = HyperVReplicaBaseReplicationDetails.class), + @JsonSubTypes.Type(name = "HyperVReplica2012R2", value = HyperVReplicaBlueReplicationDetails.class), + @JsonSubTypes.Type(name = "HyperVReplica2012", value = HyperVReplicaReplicationDetails.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2ReplicationDetails.class), + @JsonSubTypes.Type(name = "InMageRcmFailback", value = InMageRcmFailbackReplicationDetails.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmReplicationDetails.class), + @JsonSubTypes.Type(name = "InMage", value = InMageReplicationDetails.class) +}) +@Immutable +public class ReplicationProviderSpecificSettings { + /** Creates an instance of ReplicationProviderSpecificSettings class. */ + public ReplicationProviderSpecificSettings() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.java new file mode 100644 index 000000000000..ca55323b4793 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.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.recoveryservicessiterecovery.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; + +/** Provider specific input for update pairing operations. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ReplicationProviderSpecificUpdateContainerMappingInput.class) +@JsonTypeName("ReplicationProviderSpecificUpdateContainerMappingInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AUpdateContainerMappingInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmUpdateContainerMappingInput.class) +}) +@Immutable +public class ReplicationProviderSpecificUpdateContainerMappingInput { + /** Creates an instance of ReplicationProviderSpecificUpdateContainerMappingInput class. */ + public ReplicationProviderSpecificUpdateContainerMappingInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryPlans.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryPlans.java new file mode 100644 index 000000000000..c66dc2105782 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryPlans.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationRecoveryPlans. */ +public interface ReplicationRecoveryPlans { + /** + * Gets the list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan collection details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of recovery plans. + * + *

Lists the recovery plans in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 recovery plan collection details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the requested recovery plan. + * + *

Gets the details of the recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Name of the recovery plan. + * @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 plan along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Gets the requested recovery plan. + * + *

Gets the details of the recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Name of the recovery plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 plan. + */ + RecoveryPlan get(String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Deletes the specified recovery plan. + * + *

Delete a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + RecoveryPlan failoverCancel(String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Execute cancel failover of the recovery plan. + * + *

The operation to cancel the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + RecoveryPlan failoverCancel( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + RecoveryPlan failoverCommit(String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Execute commit failover of the recovery plan. + * + *

The operation to commit the failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + RecoveryPlan failoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan plannedFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanPlannedFailoverInput input); + + /** + * Execute planned failover of the recovery plan. + * + *

The operation to start the planned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Failover input. + * @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 recovery plan details. + */ + RecoveryPlan plannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context); + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + RecoveryPlan reprotect(String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * Execute reprotect of the recovery plan. + * + *

The operation to reprotect(reverse replicate) a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan 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 recovery plan details. + */ + RecoveryPlan reprotect(String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan testFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input); + + /** + * Execute test failover of the recovery plan. + * + *

The operation to start the test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover input. + * @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 recovery plan details. + */ + RecoveryPlan testFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context); + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan testFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input); + + /** + * Execute test failover cleanup of the recovery plan. + * + *

The operation to cleanup test failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan test failover cleanup input. + * @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 recovery plan details. + */ + RecoveryPlan testFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context); + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 plan details. + */ + RecoveryPlan unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input); + + /** + * Execute unplanned failover of the recovery plan. + * + *

The operation to start the unplanned failover of a recovery plan. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param recoveryPlanName Recovery plan name. + * @param input Recovery plan unplanned failover input. + * @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 recovery plan details. + */ + RecoveryPlan unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context); + + /** + * Gets the requested recovery plan. + * + *

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

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

Delete a recovery plan. + * + * @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 specified recovery plan. + * + *

Delete a recovery plan. + * + * @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 RecoveryPlan resource. + * + * @param name resource name. + * @return the first stage of the new RecoveryPlan definition. + */ + RecoveryPlan.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryServicesProviders.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryServicesProviders.java new file mode 100644 index 000000000000..07b1bb551505 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryServicesProviders.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.recoveryservicessiterecovery.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 ReplicationRecoveryServicesProviders. */ +public interface ReplicationRecoveryServicesProviders { + /** + * Gets the list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of registered recovery services providers for the fabric. + * + *

Lists the registered recovery services providers for the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of providers as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets the details of a recovery services provider. + * + *

Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 registered recovery services provider along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Gets the details of a recovery services provider. + * + *

Gets the details of registered recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 registered recovery services provider. + */ + RecoveryServicesProvider get(String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purge(String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Purges recovery service provider from fabric. + * + *

The operation to purge(force delete) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 purge(String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + RecoveryServicesProvider refreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Refresh details from the recovery services provider. + * + *

The operation to refresh the information from the recovery services provider. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 provider details. + */ + RecoveryServicesProvider refreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To + * maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty + * we assume that it is old client and continue the old behavior). + * + *

The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param providerName Recovery services provider 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 resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of registered recovery services providers in the vault. This is a view only api. + * + *

Lists the registered recovery services providers in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of providers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the details of a recovery services provider. + * + *

Gets the details of registered recovery services provider. + * + * @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 registered recovery services provider along with {@link Response}. + */ + RecoveryServicesProvider getById(String id); + + /** + * Gets the details of a recovery services provider. + * + *

Gets the details of registered recovery services provider. + * + * @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 registered recovery services provider along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RecoveryServicesProvider resource. + * + * @param name resource name. + * @return the first stage of the new RecoveryServicesProvider definition. + */ + RecoveryServicesProvider.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassificationMappings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassificationMappings.java new file mode 100644 index 000000000000..8438ff3b06f8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassificationMappings.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationStorageClassificationMappings. */ +public interface ReplicationStorageClassificationMappings { + /** + * Gets the list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationStorageClassifications( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName); + + /** + * Gets the list of storage classification mappings objects under a storage. + * + *

Lists the storage classification mappings for the fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationStorageClassifications( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context); + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 specified storage classification mapping along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context); + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 specified storage classification mapping. + */ + StorageClassificationMapping get( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName); + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName); + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @param storageClassificationMappingName Storage classification mapping 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 resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context); + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of storage classification mappings objects under a vault. + * + *

Lists the storage classification mappings in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of storage mapping details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the details of a storage classification mapping. + * + *

Gets the details of the specified storage classification mapping. + * + * @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 specified storage classification mapping along with {@link Response}. + */ + StorageClassificationMapping getById(String id); + + /** + * Gets the details of a storage classification mapping. + * + *

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

The operation to delete a storage classification mapping. + * + * @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); + + /** + * Delete a storage classification mapping. + * + *

The operation to delete a storage classification mapping. + * + * @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 StorageClassificationMapping resource. + * + * @param name resource name. + * @return the first stage of the new StorageClassificationMapping definition. + */ + StorageClassificationMapping.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassifications.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassifications.java new file mode 100644 index 000000000000..5b47a239b3e6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassifications.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationStorageClassifications. */ +public interface ReplicationStorageClassifications { + /** + * Gets the list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of storage classification objects under a fabric. + * + *

Lists the storage classifications available in the specified fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Site name of interest. + * @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 collection of storage details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets the details of a storage classification. + * + *

Gets the details of the specified storage classification. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 specified storage classification along with {@link Response}. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context); + + /** + * Gets the details of a storage classification. + * + *

Gets the details of the specified storage classification. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification 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 specified storage classification. + */ + StorageClassification get( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName); + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of storage classification objects under a vault. + * + *

Lists the storage classifications in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of storage details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultHealths.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultHealths.java new file mode 100644 index 000000000000..a66a71a70600 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultHealths.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.recoveryservicessiterecovery.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationVaultHealths. */ +public interface ReplicationVaultHealths { + /** + * Gets the health summary for the vault. + * + *

Gets the health details of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 health details of the vault along with {@link Response}. + */ + Response getWithResponse(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the health summary for the vault. + * + *

Gets the health details of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the health details of the vault. + */ + VaultHealthDetails get(String resourceName, String resourceGroupName); + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 health details definition. + */ + VaultHealthDetails refresh(String resourceName, String resourceGroupName); + + /** + * Refreshes health summary of the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 health details definition. + */ + VaultHealthDetails refresh(String resourceName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultSettings.java new file mode 100644 index 000000000000..4cd071ea07e7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultSettings.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 ReplicationVaultSettings. */ +public interface ReplicationVaultSettings { + /** + * Gets the list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 vault setting as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of vault setting. + * + *

Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 vault setting as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting 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 vault setting along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String vaultSettingName, Context context); + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultSettingName Vault setting 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 vault setting. + */ + VaultSetting get(String resourceName, String resourceGroupName, String vaultSettingName); + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @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 vault setting along with {@link Response}. + */ + VaultSetting getById(String id); + + /** + * Gets the vault setting. + * + *

Gets the vault setting. This includes the Migration Hub connection settings. + * + * @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 vault setting along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VaultSetting resource. + * + * @param name resource name. + * @return the first stage of the new VaultSetting definition. + */ + VaultSetting.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationvCenters.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationvCenters.java new file mode 100644 index 000000000000..1665235d770a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationvCenters.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.recoveryservicessiterecovery.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 ReplicationvCenters. */ +public interface ReplicationvCenters { + /** + * Gets the list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics(String resourceName, String resourceGroupName, String fabricName); + + /** + * Gets the list of vCenter registered under a fabric. + * + *

Lists the vCenter servers registered in a fabric. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName 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 collection of vCenter details as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * Gets the details of a vCenter. + * + *

Gets the details of a registered vCenter server(Add vCenter server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 a registered vCenter server(Add vCenter server) along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context); + + /** + * Gets the details of a vCenter. + * + *

Gets the details of a registered vCenter server(Add vCenter server). + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 a registered vCenter server(Add vCenter server). + */ + VCenter get(String resourceName, String resourceGroupName, String fabricName, String vcenterName); + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName); + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param vcenterName vcenter 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 resourceName, String resourceGroupName, String fabricName, String vcenterName, Context context); + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of vCenter details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * Gets the list of vCenter registered under the vault. + * + *

Lists the vCenter servers registered in the vault. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 collection of vCenter details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * Gets the details of a vCenter. + * + *

Gets the details of a registered vCenter server(Add vCenter server). + * + * @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 a registered vCenter server(Add vCenter server) along with {@link Response}. + */ + VCenter getById(String id); + + /** + * Gets the details of a vCenter. + * + *

Gets the details of a registered vCenter server(Add vCenter server). + * + * @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 a registered vCenter server(Add vCenter server) along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from 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); + + /** + * Remove vcenter operation. + * + *

The operation to remove(unregister) a registered vCenter server from 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 VCenter resource. + * + * @param name resource name. + * @return the first stage of the new VCenter definition. + */ + VCenter.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReprotectAgentDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReprotectAgentDetails.java new file mode 100644 index 000000000000..c75bd3f1d767 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReprotectAgentDetails.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Reprotect agent details. */ +@Immutable +public final class ReprotectAgentDetails { + /* + * The reprotect agent Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The reprotect agent name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The reprotect agent Bios Id. + */ + @JsonProperty(value = "biosId", access = JsonProperty.Access.WRITE_ONLY) + private String biosId; + + /* + * The fabric object Id. + */ + @JsonProperty(value = "fabricObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricObjectId; + + /* + * The reprotect agent Fqdn. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The last heartbeat received from the reprotect agent. + */ + @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeatUtc; + + /* + * The health of the reprotect agent. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionHealth health; + + /* + * The health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /* + * The protected item count. + */ + @JsonProperty(value = "protectedItemCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer protectedItemCount; + + /* + * The list of accessible datastores fetched from discovery. + */ + @JsonProperty(value = "accessibleDatastores", access = JsonProperty.Access.WRITE_ONLY) + private List accessibleDatastores; + + /* + * The Vcenter Id. + */ + @JsonProperty(value = "vcenterId", access = JsonProperty.Access.WRITE_ONLY) + private String vcenterId; + + /* + * The last time when SDS information discovered in SRS. + */ + @JsonProperty(value = "lastDiscoveryInUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastDiscoveryInUtc; + + /** Creates an instance of ReprotectAgentDetails class. */ + public ReprotectAgentDetails() { + } + + /** + * Get the id property: The reprotect agent Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The reprotect agent name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the biosId property: The reprotect agent Bios Id. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Get the fabricObjectId property: The fabric object Id. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Get the fqdn property: The reprotect agent Fqdn. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the lastHeartbeatUtc property: The last heartbeat received from the reprotect agent. + * + * @return the lastHeartbeatUtc value. + */ + public OffsetDateTime lastHeartbeatUtc() { + return this.lastHeartbeatUtc; + } + + /** + * Get the health property: The health of the reprotect agent. + * + * @return the health value. + */ + public ProtectionHealth health() { + return this.health; + } + + /** + * Get the healthErrors property: The health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Get the protectedItemCount property: The protected item count. + * + * @return the protectedItemCount value. + */ + public Integer protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Get the accessibleDatastores property: The list of accessible datastores fetched from discovery. + * + * @return the accessibleDatastores value. + */ + public List accessibleDatastores() { + return this.accessibleDatastores; + } + + /** + * Get the vcenterId property: The Vcenter Id. + * + * @return the vcenterId value. + */ + public String vcenterId() { + return this.vcenterId; + } + + /** + * Get the lastDiscoveryInUtc property: The last time when SDS information discovered in SRS. + * + * @return the lastDiscoveryInUtc value. + */ + public OffsetDateTime lastDiscoveryInUtc() { + return this.lastDiscoveryInUtc; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthError.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthError.java new file mode 100644 index 000000000000..79f5bcd7c53c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthError.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resolve health errors input properties. */ +@Fluent +public final class ResolveHealthError { + /* + * Health error id. + */ + @JsonProperty(value = "healthErrorId") + private String healthErrorId; + + /** Creates an instance of ResolveHealthError class. */ + public ResolveHealthError() { + } + + /** + * Get the healthErrorId property: Health error id. + * + * @return the healthErrorId value. + */ + public String healthErrorId() { + return this.healthErrorId; + } + + /** + * Set the healthErrorId property: Health error id. + * + * @param healthErrorId the healthErrorId value to set. + * @return the ResolveHealthError object itself. + */ + public ResolveHealthError withHealthErrorId(String healthErrorId) { + this.healthErrorId = healthErrorId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthInput.java new file mode 100644 index 000000000000..b591618e5e46 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resolve health input. */ +@Fluent +public final class ResolveHealthInput { + /* + * Disable resolve health input properties. + */ + @JsonProperty(value = "properties") + private ResolveHealthInputProperties properties; + + /** Creates an instance of ResolveHealthInput class. */ + public ResolveHealthInput() { + } + + /** + * Get the properties property: Disable resolve health input properties. + * + * @return the properties value. + */ + public ResolveHealthInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Disable resolve health input properties. + * + * @param properties the properties value to set. + * @return the ResolveHealthInput object itself. + */ + public ResolveHealthInput withProperties(ResolveHealthInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthInputProperties.java new file mode 100644 index 000000000000..a31d04a313ca --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResolveHealthInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Resolve health input properties. */ +@Fluent +public final class ResolveHealthInputProperties { + /* + * Health errors. + */ + @JsonProperty(value = "healthErrors") + private List healthErrors; + + /** Creates an instance of ResolveHealthInputProperties class. */ + public ResolveHealthInputProperties() { + } + + /** + * Get the healthErrors property: Health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Set the healthErrors property: Health errors. + * + * @param healthErrors the healthErrors value to set. + * @return the ResolveHealthInputProperties object itself. + */ + public ResolveHealthInputProperties withHealthErrors(List healthErrors) { + this.healthErrors = healthErrors; + 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()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResourceHealthSummary.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResourceHealthSummary.java new file mode 100644 index 000000000000..c21820319053 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResourceHealthSummary.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Base class to define the health summary of the resources contained under an Arm resource. */ +@Fluent +public final class ResourceHealthSummary { + /* + * The count of total resources under the container. + */ + @JsonProperty(value = "resourceCount") + private Integer resourceCount; + + /* + * The list of summary of health errors across the resources under the container. + */ + @JsonProperty(value = "issues") + private List issues; + + /* + * The categorized resource counts. + */ + @JsonProperty(value = "categorizedResourceCounts") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map categorizedResourceCounts; + + /** Creates an instance of ResourceHealthSummary class. */ + public ResourceHealthSummary() { + } + + /** + * Get the resourceCount property: The count of total resources under the container. + * + * @return the resourceCount value. + */ + public Integer resourceCount() { + return this.resourceCount; + } + + /** + * Set the resourceCount property: The count of total resources under the container. + * + * @param resourceCount the resourceCount value to set. + * @return the ResourceHealthSummary object itself. + */ + public ResourceHealthSummary withResourceCount(Integer resourceCount) { + this.resourceCount = resourceCount; + return this; + } + + /** + * Get the issues property: The list of summary of health errors across the resources under the container. + * + * @return the issues value. + */ + public List issues() { + return this.issues; + } + + /** + * Set the issues property: The list of summary of health errors across the resources under the container. + * + * @param issues the issues value to set. + * @return the ResourceHealthSummary object itself. + */ + public ResourceHealthSummary withIssues(List issues) { + this.issues = issues; + return this; + } + + /** + * Get the categorizedResourceCounts property: The categorized resource counts. + * + * @return the categorizedResourceCounts value. + */ + public Map categorizedResourceCounts() { + return this.categorizedResourceCounts; + } + + /** + * Set the categorizedResourceCounts property: The categorized resource counts. + * + * @param categorizedResourceCounts the categorizedResourceCounts value to set. + * @return the ResourceHealthSummary object itself. + */ + public ResourceHealthSummary withCategorizedResourceCounts(Map categorizedResourceCounts) { + this.categorizedResourceCounts = categorizedResourceCounts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (issues() != null) { + issues().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeJobParams.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeJobParams.java new file mode 100644 index 000000000000..20a29d9ce30c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeJobParams.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resume job params. */ +@Fluent +public final class ResumeJobParams { + /* + * Resume job properties. + */ + @JsonProperty(value = "properties") + private ResumeJobParamsProperties properties; + + /** Creates an instance of ResumeJobParams class. */ + public ResumeJobParams() { + } + + /** + * Get the properties property: Resume job properties. + * + * @return the properties value. + */ + public ResumeJobParamsProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Resume job properties. + * + * @param properties the properties value to set. + * @return the ResumeJobParams object itself. + */ + public ResumeJobParams withProperties(ResumeJobParamsProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeJobParamsProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeJobParamsProperties.java new file mode 100644 index 000000000000..3798138816bd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeJobParamsProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resume job properties. */ +@Fluent +public final class ResumeJobParamsProperties { + /* + * Resume job comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /** Creates an instance of ResumeJobParamsProperties class. */ + public ResumeJobParamsProperties() { + } + + /** + * Get the comments property: Resume job comments. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Set the comments property: Resume job comments. + * + * @param comments the comments value to set. + * @return the ResumeJobParamsProperties object itself. + */ + public ResumeJobParamsProperties withComments(String comments) { + this.comments = comments; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationInput.java new file mode 100644 index 000000000000..f47872156b67 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resume replication input. */ +@Fluent +public final class ResumeReplicationInput { + /* + * Resume replication input properties. + */ + @JsonProperty(value = "properties", required = true) + private ResumeReplicationInputProperties properties; + + /** Creates an instance of ResumeReplicationInput class. */ + public ResumeReplicationInput() { + } + + /** + * Get the properties property: Resume replication input properties. + * + * @return the properties value. + */ + public ResumeReplicationInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Resume replication input properties. + * + * @param properties the properties value to set. + * @return the ResumeReplicationInput object itself. + */ + public ResumeReplicationInput withProperties(ResumeReplicationInputProperties 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 ResumeReplicationInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResumeReplicationInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationInputProperties.java new file mode 100644 index 000000000000..67b22eefd72e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resume replication input properties. */ +@Fluent +public final class ResumeReplicationInputProperties { + /* + * The provider specific input for resume replication. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private ResumeReplicationProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of ResumeReplicationInputProperties class. */ + public ResumeReplicationInputProperties() { + } + + /** + * Get the providerSpecificDetails property: The provider specific input for resume replication. + * + * @return the providerSpecificDetails value. + */ + public ResumeReplicationProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific input for resume replication. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the ResumeReplicationInputProperties object itself. + */ + public ResumeReplicationInputProperties withProviderSpecificDetails( + ResumeReplicationProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerSpecificDetails in model ResumeReplicationInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResumeReplicationInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationProviderSpecificInput.java new file mode 100644 index 000000000000..04940b604232 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResumeReplicationProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Resume replication provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ResumeReplicationProviderSpecificInput.class) +@JsonTypeName("ResumeReplicationProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtResumeReplicationInput.class)}) +@Immutable +public class ResumeReplicationProviderSpecificInput { + /** Creates an instance of ResumeReplicationProviderSpecificInput class. */ + public ResumeReplicationProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncInput.java new file mode 100644 index 000000000000..231da00cb4f1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncInput.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resync input. */ +@Fluent +public final class ResyncInput { + /* + * Resync input properties. + */ + @JsonProperty(value = "properties", required = true) + private ResyncInputProperties properties; + + /** Creates an instance of ResyncInput class. */ + public ResyncInput() { + } + + /** + * Get the properties property: Resync input properties. + * + * @return the properties value. + */ + public ResyncInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Resync input properties. + * + * @param properties the properties value to set. + * @return the ResyncInput object itself. + */ + public ResyncInput withProperties(ResyncInputProperties 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 ResyncInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResyncInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncInputProperties.java new file mode 100644 index 000000000000..b9892658be53 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resync input properties. */ +@Fluent +public final class ResyncInputProperties { + /* + * The provider specific details. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private ResyncProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of ResyncInputProperties class. */ + public ResyncInputProperties() { + } + + /** + * Get the providerSpecificDetails property: The provider specific details. + * + * @return the providerSpecificDetails value. + */ + public ResyncProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific details. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the ResyncInputProperties object itself. + */ + public ResyncInputProperties withProviderSpecificDetails(ResyncProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerSpecificDetails in model ResyncInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResyncInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncProviderSpecificInput.java new file mode 100644 index 000000000000..16a2e28f39bc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Resync provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ResyncProviderSpecificInput.class) +@JsonTypeName("ResyncProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtResyncInput.class)}) +@Immutable +public class ResyncProviderSpecificInput { + /** Creates an instance of ResyncProviderSpecificInput class. */ + public ResyncProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncState.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncState.java new file mode 100644 index 000000000000..91b62183170b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The resync state. */ +public final class ResyncState extends ExpandableStringEnum { + /** Static value None for ResyncState. */ + public static final ResyncState NONE = fromString("None"); + + /** Static value PreparedForResynchronization for ResyncState. */ + public static final ResyncState PREPARED_FOR_RESYNCHRONIZATION = fromString("PreparedForResynchronization"); + + /** Static value StartedResynchronization for ResyncState. */ + public static final ResyncState STARTED_RESYNCHRONIZATION = fromString("StartedResynchronization"); + + /** + * Creates or finds a ResyncState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResyncState. + */ + @JsonCreator + public static ResyncState fromString(String name) { + return fromString(name, ResyncState.class); + } + + /** + * Gets known ResyncState values. + * + * @return known ResyncState values. + */ + public static Collection values() { + return values(ResyncState.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RetentionVolume.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RetentionVolume.java new file mode 100644 index 000000000000..f5df44b9226a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RetentionVolume.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The retention details of the MT. */ +@Fluent +public final class RetentionVolume { + /* + * The volume name. + */ + @JsonProperty(value = "volumeName") + private String volumeName; + + /* + * The volume capacity. + */ + @JsonProperty(value = "capacityInBytes") + private Long capacityInBytes; + + /* + * The free space available in this volume. + */ + @JsonProperty(value = "freeSpaceInBytes") + private Long freeSpaceInBytes; + + /* + * The threshold percentage. + */ + @JsonProperty(value = "thresholdPercentage") + private Integer thresholdPercentage; + + /** Creates an instance of RetentionVolume class. */ + public RetentionVolume() { + } + + /** + * Get the volumeName property: The volume name. + * + * @return the volumeName value. + */ + public String volumeName() { + return this.volumeName; + } + + /** + * Set the volumeName property: The volume name. + * + * @param volumeName the volumeName value to set. + * @return the RetentionVolume object itself. + */ + public RetentionVolume withVolumeName(String volumeName) { + this.volumeName = volumeName; + return this; + } + + /** + * Get the capacityInBytes property: The volume capacity. + * + * @return the capacityInBytes value. + */ + public Long capacityInBytes() { + return this.capacityInBytes; + } + + /** + * Set the capacityInBytes property: The volume capacity. + * + * @param capacityInBytes the capacityInBytes value to set. + * @return the RetentionVolume object itself. + */ + public RetentionVolume withCapacityInBytes(Long capacityInBytes) { + this.capacityInBytes = capacityInBytes; + return this; + } + + /** + * Get the freeSpaceInBytes property: The free space available in this volume. + * + * @return the freeSpaceInBytes value. + */ + public Long freeSpaceInBytes() { + return this.freeSpaceInBytes; + } + + /** + * Set the freeSpaceInBytes property: The free space available in this volume. + * + * @param freeSpaceInBytes the freeSpaceInBytes value to set. + * @return the RetentionVolume object itself. + */ + public RetentionVolume withFreeSpaceInBytes(Long freeSpaceInBytes) { + this.freeSpaceInBytes = freeSpaceInBytes; + return this; + } + + /** + * Get the thresholdPercentage property: The threshold percentage. + * + * @return the thresholdPercentage value. + */ + public Integer thresholdPercentage() { + return this.thresholdPercentage; + } + + /** + * Set the thresholdPercentage property: The threshold percentage. + * + * @param thresholdPercentage the thresholdPercentage value to set. + * @return the RetentionVolume object itself. + */ + public RetentionVolume withThresholdPercentage(Integer thresholdPercentage) { + this.thresholdPercentage = thresholdPercentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationInput.java new file mode 100644 index 000000000000..215381ec3d2d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reverse replication input. */ +@Fluent +public final class ReverseReplicationInput { + /* + * Reverse replication properties. + */ + @JsonProperty(value = "properties") + private ReverseReplicationInputProperties properties; + + /** Creates an instance of ReverseReplicationInput class. */ + public ReverseReplicationInput() { + } + + /** + * Get the properties property: Reverse replication properties. + * + * @return the properties value. + */ + public ReverseReplicationInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Reverse replication properties. + * + * @param properties the properties value to set. + * @return the ReverseReplicationInput object itself. + */ + public ReverseReplicationInput withProperties(ReverseReplicationInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationInputProperties.java new file mode 100644 index 000000000000..ce5c69762cea --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reverse replication input properties. */ +@Fluent +public final class ReverseReplicationInputProperties { + /* + * Failover direction. + */ + @JsonProperty(value = "failoverDirection") + private String failoverDirection; + + /* + * Provider specific reverse replication input. + */ + @JsonProperty(value = "providerSpecificDetails") + private ReverseReplicationProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of ReverseReplicationInputProperties class. */ + public ReverseReplicationInputProperties() { + } + + /** + * Get the failoverDirection property: Failover direction. + * + * @return the failoverDirection value. + */ + public String failoverDirection() { + return this.failoverDirection; + } + + /** + * Set the failoverDirection property: Failover direction. + * + * @param failoverDirection the failoverDirection value to set. + * @return the ReverseReplicationInputProperties object itself. + */ + public ReverseReplicationInputProperties withFailoverDirection(String failoverDirection) { + this.failoverDirection = failoverDirection; + return this; + } + + /** + * Get the providerSpecificDetails property: Provider specific reverse replication input. + * + * @return the providerSpecificDetails value. + */ + public ReverseReplicationProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: Provider specific reverse replication input. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the ReverseReplicationInputProperties object itself. + */ + public ReverseReplicationInputProperties withProviderSpecificDetails( + ReverseReplicationProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationProviderSpecificInput.java new file mode 100644 index 000000000000..d7915309034d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Provider specific reverse replication input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ReverseReplicationProviderSpecificInput.class) +@JsonTypeName("ReverseReplicationProviderSpecificInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AReprotectInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzureReprotectInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2ReprotectInput.class), + @JsonSubTypes.Type(name = "InMageRcmFailback", value = InMageRcmFailbackReprotectInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmReprotectInput.class), + @JsonSubTypes.Type(name = "InMage", value = InMageReprotectInput.class) +}) +@Immutable +public class ReverseReplicationProviderSpecificInput { + /** Creates an instance of ReverseReplicationProviderSpecificInput class. */ + public ReverseReplicationProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RpInMageRecoveryPointType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RpInMageRecoveryPointType.java new file mode 100644 index 000000000000..ba92c7a55f50 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RpInMageRecoveryPointType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recovery point type. */ +public final class RpInMageRecoveryPointType extends ExpandableStringEnum { + /** Static value LatestTime for RpInMageRecoveryPointType. */ + public static final RpInMageRecoveryPointType LATEST_TIME = fromString("LatestTime"); + + /** Static value LatestTag for RpInMageRecoveryPointType. */ + public static final RpInMageRecoveryPointType LATEST_TAG = fromString("LatestTag"); + + /** Static value Custom for RpInMageRecoveryPointType. */ + public static final RpInMageRecoveryPointType CUSTOM = fromString("Custom"); + + /** + * Creates or finds a RpInMageRecoveryPointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RpInMageRecoveryPointType. + */ + @JsonCreator + public static RpInMageRecoveryPointType fromString(String name) { + return fromString(name, RpInMageRecoveryPointType.class); + } + + /** + * Gets known RpInMageRecoveryPointType values. + * + * @return known RpInMageRecoveryPointType values. + */ + public static Collection values() { + return values(RpInMageRecoveryPointType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RunAsAccount.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RunAsAccount.java new file mode 100644 index 000000000000..453ee003edd8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RunAsAccount.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** CS Accounts Details. */ +@Fluent +public final class RunAsAccount { + /* + * The CS RunAs account Id. + */ + @JsonProperty(value = "accountId") + private String accountId; + + /* + * The CS RunAs account name. + */ + @JsonProperty(value = "accountName") + private String accountName; + + /** Creates an instance of RunAsAccount class. */ + public RunAsAccount() { + } + + /** + * Get the accountId property: The CS RunAs account Id. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId property: The CS RunAs account Id. + * + * @param accountId the accountId value to set. + * @return the RunAsAccount object itself. + */ + public RunAsAccount withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get the accountName property: The CS RunAs account name. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: The CS RunAs account name. + * + * @param accountName the accountName value to set. + * @return the RunAsAccount object itself. + */ + public RunAsAccount withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ScriptActionTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ScriptActionTaskDetails.java new file mode 100644 index 000000000000..2e594fb616ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ScriptActionTaskDetails.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** This class represents the script action task details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("ScriptActionTaskDetails") +@Fluent +public final class ScriptActionTaskDetails extends TaskTypeDetails { + /* + * The name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The path. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The output. + */ + @JsonProperty(value = "output") + private String output; + + /* + * A value indicating whether it is a primary side script or not. + */ + @JsonProperty(value = "isPrimarySideScript") + private Boolean isPrimarySideScript; + + /** Creates an instance of ScriptActionTaskDetails class. */ + public ScriptActionTaskDetails() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name. + * + * @param name the name value to set. + * @return the ScriptActionTaskDetails object itself. + */ + public ScriptActionTaskDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the path property: The path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path. + * + * @param path the path value to set. + * @return the ScriptActionTaskDetails object itself. + */ + public ScriptActionTaskDetails withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the output property: The output. + * + * @return the output value. + */ + public String output() { + return this.output; + } + + /** + * Set the output property: The output. + * + * @param output the output value to set. + * @return the ScriptActionTaskDetails object itself. + */ + public ScriptActionTaskDetails withOutput(String output) { + this.output = output; + return this; + } + + /** + * Get the isPrimarySideScript property: A value indicating whether it is a primary side script or not. + * + * @return the isPrimarySideScript value. + */ + public Boolean isPrimarySideScript() { + return this.isPrimarySideScript; + } + + /** + * Set the isPrimarySideScript property: A value indicating whether it is a primary side script or not. + * + * @param isPrimarySideScript the isPrimarySideScript value to set. + * @return the ScriptActionTaskDetails object itself. + */ + public ScriptActionTaskDetails withIsPrimarySideScript(Boolean isPrimarySideScript) { + this.isPrimarySideScript = isPrimarySideScript; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ServiceError.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ServiceError.java new file mode 100644 index 000000000000..3ec138fd6afb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ServiceError.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ASR error model. */ +@Fluent +public final class ServiceError { + /* + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Error message. + */ + @JsonProperty(value = "message") + private String message; + + /* + * Possible causes of error. + */ + @JsonProperty(value = "possibleCauses") + private String possibleCauses; + + /* + * Recommended action to resolve error. + */ + @JsonProperty(value = "recommendedAction") + private String recommendedAction; + + /* + * Activity Id. + */ + @JsonProperty(value = "activityId") + private String activityId; + + /** Creates an instance of ServiceError class. */ + public ServiceError() { + } + + /** + * Get the code property: Error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Error code. + * + * @param code the code value to set. + * @return the ServiceError object itself. + */ + public ServiceError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Error message. + * + * @param message the message value to set. + * @return the ServiceError object itself. + */ + public ServiceError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the possibleCauses property: Possible causes of error. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Set the possibleCauses property: Possible causes of error. + * + * @param possibleCauses the possibleCauses value to set. + * @return the ServiceError object itself. + */ + public ServiceError withPossibleCauses(String possibleCauses) { + this.possibleCauses = possibleCauses; + return this; + } + + /** + * Get the recommendedAction property: Recommended action to resolve error. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Set the recommendedAction property: Recommended action to resolve error. + * + * @param recommendedAction the recommendedAction value to set. + * @return the ServiceError object itself. + */ + public ServiceError withRecommendedAction(String recommendedAction) { + this.recommendedAction = recommendedAction; + return this; + } + + /** + * Get the activityId property: Activity Id. + * + * @return the activityId value. + */ + public String activityId() { + return this.activityId; + } + + /** + * Set the activityId property: Activity Id. + * + * @param activityId the activityId value to set. + * @return the ServiceError object itself. + */ + public ServiceError withActivityId(String activityId) { + this.activityId = activityId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SetMultiVmSyncStatus.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SetMultiVmSyncStatus.java new file mode 100644 index 000000000000..3a6a7dbdbac4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SetMultiVmSyncStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. */ +public final class SetMultiVmSyncStatus extends ExpandableStringEnum { + /** Static value Enable for SetMultiVmSyncStatus. */ + public static final SetMultiVmSyncStatus ENABLE = fromString("Enable"); + + /** Static value Disable for SetMultiVmSyncStatus. */ + public static final SetMultiVmSyncStatus DISABLE = fromString("Disable"); + + /** + * Creates or finds a SetMultiVmSyncStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SetMultiVmSyncStatus. + */ + @JsonCreator + public static SetMultiVmSyncStatus fromString(String name) { + return fromString(name, SetMultiVmSyncStatus.class); + } + + /** + * Gets known SetMultiVmSyncStatus values. + * + * @return known SetMultiVmSyncStatus values. + */ + public static Collection values() { + return values(SetMultiVmSyncStatus.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Severity.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Severity.java new file mode 100644 index 000000000000..d3f5b9ef5236 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Severity.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Severity of error. */ +public final class Severity extends ExpandableStringEnum { + /** Static value NONE for Severity. */ + public static final Severity NONE = fromString("NONE"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** Static value Error for Severity. */ + public static final Severity ERROR = fromString("Error"); + + /** Static value Info for Severity. */ + public static final Severity INFO = fromString("Info"); + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @return known Severity values. + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SourceSiteOperations.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SourceSiteOperations.java new file mode 100644 index 000000000000..43a1b16cd559 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SourceSiteOperations.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A value indicating whether source site operations are required. */ +public final class SourceSiteOperations extends ExpandableStringEnum { + /** Static value Required for SourceSiteOperations. */ + public static final SourceSiteOperations REQUIRED = fromString("Required"); + + /** Static value NotRequired for SourceSiteOperations. */ + public static final SourceSiteOperations NOT_REQUIRED = fromString("NotRequired"); + + /** + * Creates or finds a SourceSiteOperations from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceSiteOperations. + */ + @JsonCreator + public static SourceSiteOperations fromString(String name) { + return fromString(name, SourceSiteOperations.class); + } + + /** + * Gets known SourceSiteOperations values. + * + * @return known SourceSiteOperations values. + */ + public static Collection values() { + return values(SourceSiteOperations.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SqlServerLicenseType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SqlServerLicenseType.java new file mode 100644 index 000000000000..3e8c6ac6f1ef --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SqlServerLicenseType.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The SQL Server license type. */ +public final class SqlServerLicenseType extends ExpandableStringEnum { + /** Static value NotSpecified for SqlServerLicenseType. */ + public static final SqlServerLicenseType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value NoLicenseType for SqlServerLicenseType. */ + public static final SqlServerLicenseType NO_LICENSE_TYPE = fromString("NoLicenseType"); + + /** Static value PAYG for SqlServerLicenseType. */ + public static final SqlServerLicenseType PAYG = fromString("PAYG"); + + /** Static value AHUB for SqlServerLicenseType. */ + public static final SqlServerLicenseType AHUB = fromString("AHUB"); + + /** + * Creates or finds a SqlServerLicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SqlServerLicenseType. + */ + @JsonCreator + public static SqlServerLicenseType fromString(String name) { + return fromString(name, SqlServerLicenseType.class); + } + + /** + * Gets known SqlServerLicenseType values. + * + * @return known SqlServerLicenseType values. + */ + public static Collection values() { + return values(SqlServerLicenseType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageAccountCustomDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageAccountCustomDetails.java new file mode 100644 index 000000000000..eba9289e11ff --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageAccountCustomDetails.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.recoveryservicessiterecovery.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; + +/** Storage account custom input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resourceType", + defaultImpl = StorageAccountCustomDetails.class) +@JsonTypeName("StorageAccountCustomDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "Existing", value = ExistingStorageAccount.class)}) +@Immutable +public class StorageAccountCustomDetails { + /** Creates an instance of StorageAccountCustomDetails class. */ + public StorageAccountCustomDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassification.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassification.java new file mode 100644 index 000000000000..5a39d816f41f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassification.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationInner; + +/** An immutable client-side representation of StorageClassification. */ +public interface StorageClassification { + /** + * 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: Properties of the storage object. + * + * @return the properties value. + */ + StorageClassificationProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationInner + * object. + * + * @return the inner object. + */ + StorageClassificationInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationCollection.java new file mode 100644 index 000000000000..d99ed853ba09 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of storage details. */ +@Fluent +public final class StorageClassificationCollection { + /* + * The storage details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of StorageClassificationCollection class. */ + public StorageClassificationCollection() { + } + + /** + * Get the value property: The storage details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The storage details. + * + * @param value the value value to set. + * @return the StorageClassificationCollection object itself. + */ + public StorageClassificationCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the StorageClassificationCollection object itself. + */ + public StorageClassificationCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMapping.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMapping.java new file mode 100644 index 000000000000..ff4b9ac2b8a7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMapping.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner; + +/** An immutable client-side representation of StorageClassificationMapping. */ +public interface StorageClassificationMapping { + /** + * 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: Properties of the storage mapping object. + * + * @return the properties value. + */ + StorageClassificationMappingProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner object. + * + * @return the inner object. + */ + StorageClassificationMappingInner innerModel(); + + /** The entirety of the StorageClassificationMapping definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The StorageClassificationMapping definition stages. */ + interface DefinitionStages { + /** The first stage of the StorageClassificationMapping definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the StorageClassificationMapping definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName, fabricName, storageClassificationName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param storageClassificationName Storage classification name. + * @return the next definition stage. + */ + WithCreate withExistingReplicationStorageClassification( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName); + } + /** + * The stage of the StorageClassificationMapping 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageClassificationMapping create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageClassificationMapping create(Context context); + } + /** The stage of the StorageClassificationMapping definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Storage mapping input properties.. + * + * @param properties Storage mapping input properties. + * @return the next definition stage. + */ + WithCreate withProperties(StorageMappingInputProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageClassificationMapping refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageClassificationMapping refresh(Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingCollection.java new file mode 100644 index 000000000000..a2bd245f71e8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of storage mapping details. */ +@Fluent +public final class StorageClassificationMappingCollection { + /* + * The storage details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of StorageClassificationMappingCollection class. */ + public StorageClassificationMappingCollection() { + } + + /** + * Get the value property: The storage details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The storage details. + * + * @param value the value value to set. + * @return the StorageClassificationMappingCollection object itself. + */ + public StorageClassificationMappingCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the StorageClassificationMappingCollection object itself. + */ + public StorageClassificationMappingCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingInput.java new file mode 100644 index 000000000000..dbca7c651a7c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage mapping input. */ +@Fluent +public final class StorageClassificationMappingInput { + /* + * Storage mapping input properties. + */ + @JsonProperty(value = "properties") + private StorageMappingInputProperties properties; + + /** Creates an instance of StorageClassificationMappingInput class. */ + public StorageClassificationMappingInput() { + } + + /** + * Get the properties property: Storage mapping input properties. + * + * @return the properties value. + */ + public StorageMappingInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Storage mapping input properties. + * + * @param properties the properties value to set. + * @return the StorageClassificationMappingInput object itself. + */ + public StorageClassificationMappingInput withProperties(StorageMappingInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingProperties.java new file mode 100644 index 000000000000..d778543b861c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationMappingProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage mapping properties. */ +@Fluent +public final class StorageClassificationMappingProperties { + /* + * Target storage object Id. + */ + @JsonProperty(value = "targetStorageClassificationId") + private String targetStorageClassificationId; + + /** Creates an instance of StorageClassificationMappingProperties class. */ + public StorageClassificationMappingProperties() { + } + + /** + * Get the targetStorageClassificationId property: Target storage object Id. + * + * @return the targetStorageClassificationId value. + */ + public String targetStorageClassificationId() { + return this.targetStorageClassificationId; + } + + /** + * Set the targetStorageClassificationId property: Target storage object Id. + * + * @param targetStorageClassificationId the targetStorageClassificationId value to set. + * @return the StorageClassificationMappingProperties object itself. + */ + public StorageClassificationMappingProperties withTargetStorageClassificationId( + String targetStorageClassificationId) { + this.targetStorageClassificationId = targetStorageClassificationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationProperties.java new file mode 100644 index 000000000000..b97164ee15d0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageClassificationProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage object properties. */ +@Fluent +public final class StorageClassificationProperties { + /* + * Friendly name of the Storage classification. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** Creates an instance of StorageClassificationProperties class. */ + public StorageClassificationProperties() { + } + + /** + * Get the friendlyName property: Friendly name of the Storage classification. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the Storage classification. + * + * @param friendlyName the friendlyName value to set. + * @return the StorageClassificationProperties object itself. + */ + public StorageClassificationProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageMappingInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageMappingInputProperties.java new file mode 100644 index 000000000000..f1d90d8c1fa9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageMappingInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage mapping input properties. */ +@Fluent +public final class StorageMappingInputProperties { + /* + * The ID of the storage object. + */ + @JsonProperty(value = "targetStorageClassificationId") + private String targetStorageClassificationId; + + /** Creates an instance of StorageMappingInputProperties class. */ + public StorageMappingInputProperties() { + } + + /** + * Get the targetStorageClassificationId property: The ID of the storage object. + * + * @return the targetStorageClassificationId value. + */ + public String targetStorageClassificationId() { + return this.targetStorageClassificationId; + } + + /** + * Set the targetStorageClassificationId property: The ID of the storage object. + * + * @param targetStorageClassificationId the targetStorageClassificationId value to set. + * @return the StorageMappingInputProperties object itself. + */ + public StorageMappingInputProperties withTargetStorageClassificationId(String targetStorageClassificationId) { + this.targetStorageClassificationId = targetStorageClassificationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Subnet.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Subnet.java new file mode 100644 index 000000000000..78cdc27570e1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Subnet.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnets of the network. */ +@Fluent +public final class Subnet { + /* + * The subnet name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The subnet friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The list of addresses for the subnet. + */ + @JsonProperty(value = "addressList") + private List addressList; + + /** Creates an instance of Subnet class. */ + public Subnet() { + } + + /** + * Get the name property: The subnet name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The subnet name. + * + * @param name the name value to set. + * @return the Subnet object itself. + */ + public Subnet withName(String name) { + this.name = name; + return this; + } + + /** + * Get the friendlyName property: The subnet friendly name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The subnet friendly name. + * + * @param friendlyName the friendlyName value to set. + * @return the Subnet object itself. + */ + public Subnet withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the addressList property: The list of addresses for the subnet. + * + * @return the addressList value. + */ + public List addressList() { + return this.addressList; + } + + /** + * Set the addressList property: The list of addresses for the subnet. + * + * @param addressList the addressList value to set. + * @return the Subnet object itself. + */ + public Subnet withAddressList(List addressList) { + this.addressList = addressList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSDetails.java new file mode 100644 index 000000000000..6f4e4f6e907a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSDetails.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Supported operating system details. */ +@Fluent +public final class SupportedOSDetails { + /* + * The name. + */ + @JsonProperty(value = "osName") + private String osName; + + /* + * The type. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The list of version for operating system. + */ + @JsonProperty(value = "osVersions") + private List osVersions; + + /** Creates an instance of SupportedOSDetails class. */ + public SupportedOSDetails() { + } + + /** + * Get the osName property: The name. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Set the osName property: The name. + * + * @param osName the osName value to set. + * @return the SupportedOSDetails object itself. + */ + public SupportedOSDetails withOsName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get the osType property: The type. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The type. + * + * @param osType the osType value to set. + * @return the SupportedOSDetails object itself. + */ + public SupportedOSDetails withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the osVersions property: The list of version for operating system. + * + * @return the osVersions value. + */ + public List osVersions() { + return this.osVersions; + } + + /** + * Set the osVersions property: The list of version for operating system. + * + * @param osVersions the osVersions value to set. + * @return the SupportedOSDetails object itself. + */ + public SupportedOSDetails withOsVersions(List osVersions) { + this.osVersions = osVersions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osVersions() != null) { + osVersions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSProperties.java new file mode 100644 index 000000000000..346d4e6485ad --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Supported operating systems properties. */ +@Fluent +public final class SupportedOSProperties { + /* + * The supported operating systems property list. + */ + @JsonProperty(value = "supportedOsList") + private List supportedOsList; + + /** Creates an instance of SupportedOSProperties class. */ + public SupportedOSProperties() { + } + + /** + * Get the supportedOsList property: The supported operating systems property list. + * + * @return the supportedOsList value. + */ + public List supportedOsList() { + return this.supportedOsList; + } + + /** + * Set the supportedOsList property: The supported operating systems property list. + * + * @param supportedOsList the supportedOsList value to set. + * @return the SupportedOSProperties object itself. + */ + public SupportedOSProperties withSupportedOsList(List supportedOsList) { + this.supportedOsList = supportedOsList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedOsList() != null) { + supportedOsList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSProperty.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSProperty.java new file mode 100644 index 000000000000..3b2027b85478 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSProperty.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Supported operating systems property. */ +@Fluent +public final class SupportedOSProperty { + /* + * The replication provider type. + */ + @JsonProperty(value = "instanceType") + private String instanceType; + + /* + * The list of supported operating systems. + */ + @JsonProperty(value = "supportedOs") + private List supportedOs; + + /** Creates an instance of SupportedOSProperty class. */ + public SupportedOSProperty() { + } + + /** + * Get the instanceType property: The replication provider type. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: The replication provider type. + * + * @param instanceType the instanceType value to set. + * @return the SupportedOSProperty object itself. + */ + public SupportedOSProperty withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the supportedOs property: The list of supported operating systems. + * + * @return the supportedOs value. + */ + public List supportedOs() { + return this.supportedOs; + } + + /** + * Set the supportedOs property: The list of supported operating systems. + * + * @param supportedOs the supportedOs value to set. + * @return the SupportedOSProperty object itself. + */ + public SupportedOSProperty withSupportedOs(List supportedOs) { + this.supportedOs = supportedOs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedOs() != null) { + supportedOs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOperatingSystems.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOperatingSystems.java new file mode 100644 index 000000000000..da2c460fc21c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOperatingSystems.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner; + +/** An immutable client-side representation of SupportedOperatingSystems. */ +public interface SupportedOperatingSystems { + /** + * 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: The supported operating systems properties. + * + * @return the properties value. + */ + SupportedOSProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.SupportedOperatingSystemsInner object. + * + * @return the inner object. + */ + SupportedOperatingSystemsInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOperatingSystemsOperations.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOperatingSystemsOperations.java new file mode 100644 index 000000000000..a1f3068c3ff2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOperatingSystemsOperations.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SupportedOperatingSystemsOperations. */ +public interface SupportedOperatingSystemsOperations { + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param instanceType The instance type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS along with {@link Response}. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String instanceType, Context context); + + /** + * Gets the data of supported operating systems by SRS. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data of supported operating systems by SRS. + */ + SupportedOperatingSystems get(String resourceName, String resourceGroupName); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionInput.java new file mode 100644 index 000000000000..3a6d46d162aa --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Switch protection input. */ +@Fluent +public final class SwitchProtectionInput { + /* + * Switch protection properties. + */ + @JsonProperty(value = "properties") + private SwitchProtectionInputProperties properties; + + /** Creates an instance of SwitchProtectionInput class. */ + public SwitchProtectionInput() { + } + + /** + * Get the properties property: Switch protection properties. + * + * @return the properties value. + */ + public SwitchProtectionInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Switch protection properties. + * + * @param properties the properties value to set. + * @return the SwitchProtectionInput object itself. + */ + public SwitchProtectionInput withProperties(SwitchProtectionInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionInputProperties.java new file mode 100644 index 000000000000..ca4daa4bb645 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Switch protection input properties. */ +@Fluent +public final class SwitchProtectionInputProperties { + /* + * The unique replication protected item name. + */ + @JsonProperty(value = "replicationProtectedItemName") + private String replicationProtectedItemName; + + /* + * Provider specific switch protection input. + */ + @JsonProperty(value = "providerSpecificDetails") + private SwitchProtectionProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of SwitchProtectionInputProperties class. */ + public SwitchProtectionInputProperties() { + } + + /** + * Get the replicationProtectedItemName property: The unique replication protected item name. + * + * @return the replicationProtectedItemName value. + */ + public String replicationProtectedItemName() { + return this.replicationProtectedItemName; + } + + /** + * Set the replicationProtectedItemName property: The unique replication protected item name. + * + * @param replicationProtectedItemName the replicationProtectedItemName value to set. + * @return the SwitchProtectionInputProperties object itself. + */ + public SwitchProtectionInputProperties withReplicationProtectedItemName(String replicationProtectedItemName) { + this.replicationProtectedItemName = replicationProtectedItemName; + return this; + } + + /** + * Get the providerSpecificDetails property: Provider specific switch protection input. + * + * @return the providerSpecificDetails value. + */ + public SwitchProtectionProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: Provider specific switch protection input. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the SwitchProtectionInputProperties object itself. + */ + public SwitchProtectionInputProperties withProviderSpecificDetails( + SwitchProtectionProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionJobDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionJobDetails.java new file mode 100644 index 000000000000..061fb13eff4b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionJobDetails.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.Map; + +/** This class represents details for switch protection job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("SwitchProtectionJobDetails") +@Fluent +public final class SwitchProtectionJobDetails extends JobDetails { + /* + * ARM Id of the new replication protected item. + */ + @JsonProperty(value = "newReplicationProtectedItemId") + private String newReplicationProtectedItemId; + + /** Creates an instance of SwitchProtectionJobDetails class. */ + public SwitchProtectionJobDetails() { + } + + /** + * Get the newReplicationProtectedItemId property: ARM Id of the new replication protected item. + * + * @return the newReplicationProtectedItemId value. + */ + public String newReplicationProtectedItemId() { + return this.newReplicationProtectedItemId; + } + + /** + * Set the newReplicationProtectedItemId property: ARM Id of the new replication protected item. + * + * @param newReplicationProtectedItemId the newReplicationProtectedItemId value to set. + * @return the SwitchProtectionJobDetails object itself. + */ + public SwitchProtectionJobDetails withNewReplicationProtectedItemId(String newReplicationProtectedItemId) { + this.newReplicationProtectedItemId = newReplicationProtectedItemId; + return this; + } + + /** {@inheritDoc} */ + @Override + public SwitchProtectionJobDetails withAffectedObjectDetails(Map affectedObjectDetails) { + super.withAffectedObjectDetails(affectedObjectDetails); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionProviderSpecificInput.java new file mode 100644 index 000000000000..a546355abc0c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProtectionProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Provider specific switch protection input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = SwitchProtectionProviderSpecificInput.class) +@JsonTypeName("SwitchProtectionProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "A2A", value = A2ASwitchProtectionInput.class)}) +@Immutable +public class SwitchProtectionProviderSpecificInput { + /** Creates an instance of SwitchProtectionProviderSpecificInput class. */ + public SwitchProtectionProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderInput.java new file mode 100644 index 000000000000..d9d84bc2d554 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for switch provider. */ +@Fluent +public final class SwitchProviderInput { + /* + * Switch provider input properties. + */ + @JsonProperty(value = "properties") + private SwitchProviderInputProperties properties; + + /** Creates an instance of SwitchProviderInput class. */ + public SwitchProviderInput() { + } + + /** + * Get the properties property: Switch provider input properties. + * + * @return the properties value. + */ + public SwitchProviderInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Switch provider input properties. + * + * @param properties the properties value to set. + * @return the SwitchProviderInput object itself. + */ + public SwitchProviderInput withProperties(SwitchProviderInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderInputProperties.java new file mode 100644 index 000000000000..1eb4ea56ccd3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for switch provider input properties. */ +@Fluent +public final class SwitchProviderInputProperties { + /* + * Target provider type. + */ + @JsonProperty(value = "targetInstanceType") + private String targetInstanceType; + + /* + * Provider specific settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private SwitchProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of SwitchProviderInputProperties class. */ + public SwitchProviderInputProperties() { + } + + /** + * Get the targetInstanceType property: Target provider type. + * + * @return the targetInstanceType value. + */ + public String targetInstanceType() { + return this.targetInstanceType; + } + + /** + * Set the targetInstanceType property: Target provider type. + * + * @param targetInstanceType the targetInstanceType value to set. + * @return the SwitchProviderInputProperties object itself. + */ + public SwitchProviderInputProperties withTargetInstanceType(String targetInstanceType) { + this.targetInstanceType = targetInstanceType; + return this; + } + + /** + * Get the providerSpecificDetails property: Provider specific settings. + * + * @return the providerSpecificDetails value. + */ + public SwitchProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: Provider specific settings. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the SwitchProviderInputProperties object itself. + */ + public SwitchProviderInputProperties withProviderSpecificDetails( + SwitchProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderSpecificInput.java new file mode 100644 index 000000000000..bd4aa4421da7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SwitchProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Provider specific switch provider input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = SwitchProviderSpecificInput.class) +@JsonTypeName("SwitchProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2SwitchProviderInput.class)}) +@Immutable +public class SwitchProviderSpecificInput { + /** Creates an instance of SwitchProviderSpecificInput class. */ + public SwitchProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSize.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSize.java new file mode 100644 index 000000000000..3409ae9ac67b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSize.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner; + +/** An immutable client-side representation of TargetComputeSize. */ +public interface TargetComputeSize { + /** + * Gets the id property: The Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The Type of the object. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The custom data. + * + * @return the properties value. + */ + TargetComputeSizeProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner + * object. + * + * @return the inner object. + */ + TargetComputeSizeInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizeCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizeCollection.java new file mode 100644 index 000000000000..65fe516a9ea4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizeCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Target compute size collection. */ +@Fluent +public final class TargetComputeSizeCollection { + /* + * The list of target compute sizes. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of TargetComputeSizeCollection class. */ + public TargetComputeSizeCollection() { + } + + /** + * Get the value property: The list of target compute sizes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of target compute sizes. + * + * @param value the value value to set. + * @return the TargetComputeSizeCollection object itself. + */ + public TargetComputeSizeCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the TargetComputeSizeCollection object itself. + */ + public TargetComputeSizeCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizeProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizeProperties.java new file mode 100644 index 000000000000..f7b7aeb9fc85 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizeProperties.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents applicable recovery vm sizes properties. */ +@Fluent +public final class TargetComputeSizeProperties { + /* + * Target compute size name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Target compute size display name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The maximum cpu cores count supported by target compute size. + */ + @JsonProperty(value = "cpuCoresCount") + private Integer cpuCoresCount; + + /* + * The Available vCPUs supported by target compute size. + */ + @JsonProperty(value = "vCPUsAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Integer vCpusAvailable; + + /* + * The maximum memory in GB supported by target compute size. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /* + * The maximum data disks count supported by target compute size. + */ + @JsonProperty(value = "maxDataDiskCount") + private Integer maxDataDiskCount; + + /* + * The maximum Nics count supported by target compute size. + */ + @JsonProperty(value = "maxNicsCount") + private Integer maxNicsCount; + + /* + * The reasons why the target compute size is not applicable for the protected item. + */ + @JsonProperty(value = "errors") + private List errors; + + /* + * The value indicating whether the target compute size supports high Iops. + */ + @JsonProperty(value = "highIopsSupported") + private String highIopsSupported; + + /* + * The supported HyperV Generations. + */ + @JsonProperty(value = "hyperVGenerations") + private List hyperVGenerations; + + /** Creates an instance of TargetComputeSizeProperties class. */ + public TargetComputeSizeProperties() { + } + + /** + * Get the name property: Target compute size name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Target compute size name. + * + * @param name the name value to set. + * @return the TargetComputeSizeProperties object itself. + */ + public TargetComputeSizeProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the friendlyName property: Target compute size display name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Target compute size display name. + * + * @param friendlyName the friendlyName value to set. + * @return the TargetComputeSizeProperties object itself. + */ + public TargetComputeSizeProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the cpuCoresCount property: The maximum cpu cores count supported by target compute size. + * + * @return the cpuCoresCount value. + */ + public Integer cpuCoresCount() { + return this.cpuCoresCount; + } + + /** + * Set the cpuCoresCount property: The maximum cpu cores count supported by target compute size. + * + * @param cpuCoresCount the cpuCoresCount value to set. + * @return the TargetComputeSizeProperties object itself. + */ + public TargetComputeSizeProperties withCpuCoresCount(Integer cpuCoresCount) { + this.cpuCoresCount = cpuCoresCount; + return this; + } + + /** + * Get the vCpusAvailable property: The Available vCPUs supported by target compute size. + * + * @return the vCpusAvailable value. + */ + public Integer vCpusAvailable() { + return this.vCpusAvailable; + } + + /** + * Get the memoryInGB property: The maximum memory in GB supported by target compute size. + * + * @return the memoryInGB value. + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memoryInGB property: The maximum memory in GB supported by target compute size. + * + * @param memoryInGB the memoryInGB value to set. + * @return the TargetComputeSizeProperties object itself. + */ + public TargetComputeSizeProperties withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the maxDataDiskCount property: The maximum data disks count supported by target compute size. + * + * @return the maxDataDiskCount value. + */ + public Integer maxDataDiskCount() { + return this.maxDataDiskCount; + } + + /** + * Set the maxDataDiskCount property: The maximum data disks count supported by target compute size. + * + * @param maxDataDiskCount the maxDataDiskCount value to set. + * @return the TargetComputeSizeProperties object itself. + */ + public TargetComputeSizeProperties withMaxDataDiskCount(Integer maxDataDiskCount) { + this.maxDataDiskCount = maxDataDiskCount; + return this; + } + + /** + * Get the maxNicsCount property: The maximum Nics count supported by target compute size. + * + * @return the maxNicsCount value. + */ + public Integer maxNicsCount() { + return this.maxNicsCount; + } + + /** + * Set the maxNicsCount property: The maximum Nics count supported by target compute size. + * + * @param maxNicsCount the maxNicsCount value to set. + * @return the TargetComputeSizeProperties object itself. + */ + public TargetComputeSizeProperties withMaxNicsCount(Integer maxNicsCount) { + this.maxNicsCount = maxNicsCount; + return this; + } + + /** + * Get the errors property: The reasons why the target compute size is not applicable for the protected item. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The reasons why the target compute size is not applicable for the protected item. + * + * @param errors the errors value to set. + * @return the TargetComputeSizeProperties object itself. + */ + public TargetComputeSizeProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the highIopsSupported property: The value indicating whether the target compute size supports high Iops. + * + * @return the highIopsSupported value. + */ + public String highIopsSupported() { + return this.highIopsSupported; + } + + /** + * Set the highIopsSupported property: The value indicating whether the target compute size supports high Iops. + * + * @param highIopsSupported the highIopsSupported value to set. + * @return the TargetComputeSizeProperties object itself. + */ + public TargetComputeSizeProperties withHighIopsSupported(String highIopsSupported) { + this.highIopsSupported = highIopsSupported; + return this; + } + + /** + * Get the hyperVGenerations property: The supported HyperV Generations. + * + * @return the hyperVGenerations value. + */ + public List hyperVGenerations() { + return this.hyperVGenerations; + } + + /** + * Set the hyperVGenerations property: The supported HyperV Generations. + * + * @param hyperVGenerations the hyperVGenerations value to set. + * @return the TargetComputeSizeProperties object itself. + */ + public TargetComputeSizeProperties withHyperVGenerations(List hyperVGenerations) { + this.hyperVGenerations = hyperVGenerations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizes.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizes.java new file mode 100644 index 000000000000..5c57223754d5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizes.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of TargetComputeSizes. */ +public interface TargetComputeSizes { + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * Gets the list of target compute sizes for the replication protected item. + * + *

Lists the available target compute sizes for a replication protected item. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @param protectionContainerName protection container name. + * @param replicatedProtectedItemName Replication 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 target compute size collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TaskTypeDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TaskTypeDetails.java new file mode 100644 index 000000000000..14a0ed27608f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TaskTypeDetails.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.recoveryservicessiterecovery.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; + +/** Task details based on specific task type. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = TaskTypeDetails.class) +@JsonTypeName("TaskTypeDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AutomationRunbookTaskDetails", value = AutomationRunbookTaskDetails.class), + @JsonSubTypes.Type(name = "ConsistencyCheckTaskDetails", value = ConsistencyCheckTaskDetails.class), + @JsonSubTypes.Type(name = "JobTaskDetails", value = JobTaskDetails.class), + @JsonSubTypes.Type(name = "ManualActionTaskDetails", value = ManualActionTaskDetails.class), + @JsonSubTypes.Type(name = "ScriptActionTaskDetails", value = ScriptActionTaskDetails.class), + @JsonSubTypes.Type(name = "VmNicUpdatesTaskDetails", value = VmNicUpdatesTaskDetails.class) +}) +@Immutable +public class TaskTypeDetails { + /** Creates an instance of TaskTypeDetails class. */ + public TaskTypeDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverCleanupInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverCleanupInput.java new file mode 100644 index 000000000000..60db069f1f9f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverCleanupInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for test failover cleanup. */ +@Fluent +public final class TestFailoverCleanupInput { + /* + * Test failover cleanup input properties. + */ + @JsonProperty(value = "properties", required = true) + private TestFailoverCleanupInputProperties properties; + + /** Creates an instance of TestFailoverCleanupInput class. */ + public TestFailoverCleanupInput() { + } + + /** + * Get the properties property: Test failover cleanup input properties. + * + * @return the properties value. + */ + public TestFailoverCleanupInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Test failover cleanup input properties. + * + * @param properties the properties value to set. + * @return the TestFailoverCleanupInput object itself. + */ + public TestFailoverCleanupInput withProperties(TestFailoverCleanupInputProperties 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 TestFailoverCleanupInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TestFailoverCleanupInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverCleanupInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverCleanupInputProperties.java new file mode 100644 index 000000000000..e461e8986888 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverCleanupInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for test failover cleanup input properties. */ +@Fluent +public final class TestFailoverCleanupInputProperties { + /* + * Test failover cleanup comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /** Creates an instance of TestFailoverCleanupInputProperties class. */ + public TestFailoverCleanupInputProperties() { + } + + /** + * Get the comments property: Test failover cleanup comments. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Set the comments property: Test failover cleanup comments. + * + * @param comments the comments value to set. + * @return the TestFailoverCleanupInputProperties object itself. + */ + public TestFailoverCleanupInputProperties withComments(String comments) { + this.comments = comments; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInput.java new file mode 100644 index 000000000000..6a83c2e9f4cb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInput.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for test failover. */ +@Fluent +public final class TestFailoverInput { + /* + * Test failover input properties. + */ + @JsonProperty(value = "properties", required = true) + private TestFailoverInputProperties properties; + + /** Creates an instance of TestFailoverInput class. */ + public TestFailoverInput() { + } + + /** + * Get the properties property: Test failover input properties. + * + * @return the properties value. + */ + public TestFailoverInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Test failover input properties. + * + * @param properties the properties value to set. + * @return the TestFailoverInput object itself. + */ + public TestFailoverInput withProperties(TestFailoverInputProperties 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 TestFailoverInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TestFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInputProperties.java new file mode 100644 index 000000000000..4198678f9ee6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInputProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for test failover input properties. */ +@Fluent +public final class TestFailoverInputProperties { + /* + * Test failover direction. + */ + @JsonProperty(value = "failoverDirection") + private String failoverDirection; + + /* + * Network type to be used for test failover. + */ + @JsonProperty(value = "networkType") + private String networkType; + + /* + * The id of the network to be used for test failover. + */ + @JsonProperty(value = "networkId") + private String networkId; + + /* + * Provider specific settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private TestFailoverProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of TestFailoverInputProperties class. */ + public TestFailoverInputProperties() { + } + + /** + * Get the failoverDirection property: Test failover direction. + * + * @return the failoverDirection value. + */ + public String failoverDirection() { + return this.failoverDirection; + } + + /** + * Set the failoverDirection property: Test failover direction. + * + * @param failoverDirection the failoverDirection value to set. + * @return the TestFailoverInputProperties object itself. + */ + public TestFailoverInputProperties withFailoverDirection(String failoverDirection) { + this.failoverDirection = failoverDirection; + return this; + } + + /** + * Get the networkType property: Network type to be used for test failover. + * + * @return the networkType value. + */ + public String networkType() { + return this.networkType; + } + + /** + * Set the networkType property: Network type to be used for test failover. + * + * @param networkType the networkType value to set. + * @return the TestFailoverInputProperties object itself. + */ + public TestFailoverInputProperties withNetworkType(String networkType) { + this.networkType = networkType; + return this; + } + + /** + * Get the networkId property: The id of the network to be used for test failover. + * + * @return the networkId value. + */ + public String networkId() { + return this.networkId; + } + + /** + * Set the networkId property: The id of the network to be used for test failover. + * + * @param networkId the networkId value to set. + * @return the TestFailoverInputProperties object itself. + */ + public TestFailoverInputProperties withNetworkId(String networkId) { + this.networkId = networkId; + return this; + } + + /** + * Get the providerSpecificDetails property: Provider specific settings. + * + * @return the providerSpecificDetails value. + */ + public TestFailoverProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: Provider specific settings. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the TestFailoverInputProperties object itself. + */ + public TestFailoverInputProperties withProviderSpecificDetails( + TestFailoverProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverJobDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverJobDetails.java new file mode 100644 index 000000000000..1699a2ac43d2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverJobDetails.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; +import java.util.Map; + +/** This class represents the details for a test failover job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("TestFailoverJobDetails") +@Fluent +public final class TestFailoverJobDetails extends JobDetails { + /* + * The test failover status. + */ + @JsonProperty(value = "testFailoverStatus") + private String testFailoverStatus; + + /* + * The test failover comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /* + * The test network name. + */ + @JsonProperty(value = "networkName") + private String networkName; + + /* + * The test network friendly name. + */ + @JsonProperty(value = "networkFriendlyName") + private String networkFriendlyName; + + /* + * The test network type (see TestFailoverInput enum for possible values). + */ + @JsonProperty(value = "networkType") + private String networkType; + + /* + * The test VM details. + */ + @JsonProperty(value = "protectedItemDetails") + private List protectedItemDetails; + + /** Creates an instance of TestFailoverJobDetails class. */ + public TestFailoverJobDetails() { + } + + /** + * Get the testFailoverStatus property: The test failover status. + * + * @return the testFailoverStatus value. + */ + public String testFailoverStatus() { + return this.testFailoverStatus; + } + + /** + * Set the testFailoverStatus property: The test failover status. + * + * @param testFailoverStatus the testFailoverStatus value to set. + * @return the TestFailoverJobDetails object itself. + */ + public TestFailoverJobDetails withTestFailoverStatus(String testFailoverStatus) { + this.testFailoverStatus = testFailoverStatus; + return this; + } + + /** + * Get the comments property: The test failover comments. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Set the comments property: The test failover comments. + * + * @param comments the comments value to set. + * @return the TestFailoverJobDetails object itself. + */ + public TestFailoverJobDetails withComments(String comments) { + this.comments = comments; + return this; + } + + /** + * Get the networkName property: The test network name. + * + * @return the networkName value. + */ + public String networkName() { + return this.networkName; + } + + /** + * Set the networkName property: The test network name. + * + * @param networkName the networkName value to set. + * @return the TestFailoverJobDetails object itself. + */ + public TestFailoverJobDetails withNetworkName(String networkName) { + this.networkName = networkName; + return this; + } + + /** + * Get the networkFriendlyName property: The test network friendly name. + * + * @return the networkFriendlyName value. + */ + public String networkFriendlyName() { + return this.networkFriendlyName; + } + + /** + * Set the networkFriendlyName property: The test network friendly name. + * + * @param networkFriendlyName the networkFriendlyName value to set. + * @return the TestFailoverJobDetails object itself. + */ + public TestFailoverJobDetails withNetworkFriendlyName(String networkFriendlyName) { + this.networkFriendlyName = networkFriendlyName; + return this; + } + + /** + * Get the networkType property: The test network type (see TestFailoverInput enum for possible values). + * + * @return the networkType value. + */ + public String networkType() { + return this.networkType; + } + + /** + * Set the networkType property: The test network type (see TestFailoverInput enum for possible values). + * + * @param networkType the networkType value to set. + * @return the TestFailoverJobDetails object itself. + */ + public TestFailoverJobDetails withNetworkType(String networkType) { + this.networkType = networkType; + return this; + } + + /** + * Get the protectedItemDetails property: The test VM details. + * + * @return the protectedItemDetails value. + */ + public List protectedItemDetails() { + return this.protectedItemDetails; + } + + /** + * Set the protectedItemDetails property: The test VM details. + * + * @param protectedItemDetails the protectedItemDetails value to set. + * @return the TestFailoverJobDetails object itself. + */ + public TestFailoverJobDetails withProtectedItemDetails( + List protectedItemDetails) { + this.protectedItemDetails = protectedItemDetails; + return this; + } + + /** {@inheritDoc} */ + @Override + public TestFailoverJobDetails withAffectedObjectDetails(Map affectedObjectDetails) { + super.withAffectedObjectDetails(affectedObjectDetails); + return this; + } + + /** + * 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverProviderSpecificInput.java new file mode 100644 index 000000000000..b7f16936fc40 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Provider specific test failover input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = TestFailoverProviderSpecificInput.class) +@JsonTypeName("TestFailoverProviderSpecificInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2ATestFailoverInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzureTestFailoverInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2TestFailoverInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmTestFailoverInput.class), + @JsonSubTypes.Type(name = "InMage", value = InMageTestFailoverInput.class) +}) +@Immutable +public class TestFailoverProviderSpecificInput { + /** Creates an instance of TestFailoverProviderSpecificInput class. */ + public TestFailoverProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateCleanupInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateCleanupInput.java new file mode 100644 index 000000000000..8f59f431e47f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateCleanupInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for test migrate cleanup. */ +@Fluent +public final class TestMigrateCleanupInput { + /* + * Test migrate cleanup input properties. + */ + @JsonProperty(value = "properties", required = true) + private TestMigrateCleanupInputProperties properties; + + /** Creates an instance of TestMigrateCleanupInput class. */ + public TestMigrateCleanupInput() { + } + + /** + * Get the properties property: Test migrate cleanup input properties. + * + * @return the properties value. + */ + public TestMigrateCleanupInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Test migrate cleanup input properties. + * + * @param properties the properties value to set. + * @return the TestMigrateCleanupInput object itself. + */ + public TestMigrateCleanupInput withProperties(TestMigrateCleanupInputProperties 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 TestMigrateCleanupInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TestMigrateCleanupInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateCleanupInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateCleanupInputProperties.java new file mode 100644 index 000000000000..8ecdec15827c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateCleanupInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Test migrate cleanup input properties. */ +@Fluent +public final class TestMigrateCleanupInputProperties { + /* + * Test migrate cleanup comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /** Creates an instance of TestMigrateCleanupInputProperties class. */ + public TestMigrateCleanupInputProperties() { + } + + /** + * Get the comments property: Test migrate cleanup comments. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Set the comments property: Test migrate cleanup comments. + * + * @param comments the comments value to set. + * @return the TestMigrateCleanupInputProperties object itself. + */ + public TestMigrateCleanupInputProperties withComments(String comments) { + this.comments = comments; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInput.java new file mode 100644 index 000000000000..74b821f1fa62 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInput.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for test migrate. */ +@Fluent +public final class TestMigrateInput { + /* + * Test migrate input properties. + */ + @JsonProperty(value = "properties", required = true) + private TestMigrateInputProperties properties; + + /** Creates an instance of TestMigrateInput class. */ + public TestMigrateInput() { + } + + /** + * Get the properties property: Test migrate input properties. + * + * @return the properties value. + */ + public TestMigrateInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Test migrate input properties. + * + * @param properties the properties value to set. + * @return the TestMigrateInput object itself. + */ + public TestMigrateInput withProperties(TestMigrateInputProperties 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 TestMigrateInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TestMigrateInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInputProperties.java new file mode 100644 index 000000000000..e720a31fb3bf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Test migrate input properties. */ +@Fluent +public final class TestMigrateInputProperties { + /* + * The provider specific details. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private TestMigrateProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of TestMigrateInputProperties class. */ + public TestMigrateInputProperties() { + } + + /** + * Get the providerSpecificDetails property: The provider specific details. + * + * @return the providerSpecificDetails value. + */ + public TestMigrateProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific details. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the TestMigrateInputProperties object itself. + */ + public TestMigrateInputProperties withProviderSpecificDetails( + TestMigrateProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerSpecificDetails in model TestMigrateInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TestMigrateInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateProviderSpecificInput.java new file mode 100644 index 000000000000..e7aa163f3600 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Test migrate provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = TestMigrateProviderSpecificInput.class) +@JsonTypeName("TestMigrateProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtTestMigrateInput.class)}) +@Immutable +public class TestMigrateProviderSpecificInput { + /** Creates an instance of TestMigrateProviderSpecificInput class. */ + public TestMigrateProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrationState.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrationState.java new file mode 100644 index 000000000000..c533a7615932 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrationState.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The test migrate state. */ +public final class TestMigrationState extends ExpandableStringEnum { + /** Static value None for TestMigrationState. */ + public static final TestMigrationState NONE = fromString("None"); + + /** Static value TestMigrationInProgress for TestMigrationState. */ + public static final TestMigrationState TEST_MIGRATION_IN_PROGRESS = fromString("TestMigrationInProgress"); + + /** Static value TestMigrationSucceeded for TestMigrationState. */ + public static final TestMigrationState TEST_MIGRATION_SUCCEEDED = fromString("TestMigrationSucceeded"); + + /** Static value TestMigrationFailed for TestMigrationState. */ + public static final TestMigrationState TEST_MIGRATION_FAILED = fromString("TestMigrationFailed"); + + /** Static value TestMigrationCleanupInProgress for TestMigrationState. */ + public static final TestMigrationState TEST_MIGRATION_CLEANUP_IN_PROGRESS = + fromString("TestMigrationCleanupInProgress"); + + /** Static value TestMigrationCompletedWithInformation for TestMigrationState. */ + public static final TestMigrationState TEST_MIGRATION_COMPLETED_WITH_INFORMATION = + fromString("TestMigrationCompletedWithInformation"); + + /** Static value TestMigrationPartiallySucceeded for TestMigrationState. */ + public static final TestMigrationState TEST_MIGRATION_PARTIALLY_SUCCEEDED = + fromString("TestMigrationPartiallySucceeded"); + + /** + * Creates or finds a TestMigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestMigrationState. + */ + @JsonCreator + public static TestMigrationState fromString(String name) { + return fromString(name, TestMigrationState.class); + } + + /** + * Gets known TestMigrationState values. + * + * @return known TestMigrationState values. + */ + public static Collection values() { + return values(TestMigrationState.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverInput.java new file mode 100644 index 000000000000..31a1240140c7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for unplanned failover. */ +@Fluent +public final class UnplannedFailoverInput { + /* + * Unplanned failover input properties. + */ + @JsonProperty(value = "properties", required = true) + private UnplannedFailoverInputProperties properties; + + /** Creates an instance of UnplannedFailoverInput class. */ + public UnplannedFailoverInput() { + } + + /** + * Get the properties property: Unplanned failover input properties. + * + * @return the properties value. + */ + public UnplannedFailoverInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Unplanned failover input properties. + * + * @param properties the properties value to set. + * @return the UnplannedFailoverInput object itself. + */ + public UnplannedFailoverInput withProperties(UnplannedFailoverInputProperties 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 UnplannedFailoverInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UnplannedFailoverInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverInputProperties.java new file mode 100644 index 000000000000..3421fa4603ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverInputProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for unplanned failover input properties. */ +@Fluent +public final class UnplannedFailoverInputProperties { + /* + * Failover direction. + */ + @JsonProperty(value = "failoverDirection") + private String failoverDirection; + + /* + * Source site operations status. + */ + @JsonProperty(value = "sourceSiteOperations") + private String sourceSiteOperations; + + /* + * Provider specific settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private UnplannedFailoverProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of UnplannedFailoverInputProperties class. */ + public UnplannedFailoverInputProperties() { + } + + /** + * Get the failoverDirection property: Failover direction. + * + * @return the failoverDirection value. + */ + public String failoverDirection() { + return this.failoverDirection; + } + + /** + * Set the failoverDirection property: Failover direction. + * + * @param failoverDirection the failoverDirection value to set. + * @return the UnplannedFailoverInputProperties object itself. + */ + public UnplannedFailoverInputProperties withFailoverDirection(String failoverDirection) { + this.failoverDirection = failoverDirection; + return this; + } + + /** + * Get the sourceSiteOperations property: Source site operations status. + * + * @return the sourceSiteOperations value. + */ + public String sourceSiteOperations() { + return this.sourceSiteOperations; + } + + /** + * Set the sourceSiteOperations property: Source site operations status. + * + * @param sourceSiteOperations the sourceSiteOperations value to set. + * @return the UnplannedFailoverInputProperties object itself. + */ + public UnplannedFailoverInputProperties withSourceSiteOperations(String sourceSiteOperations) { + this.sourceSiteOperations = sourceSiteOperations; + return this; + } + + /** + * Get the providerSpecificDetails property: Provider specific settings. + * + * @return the providerSpecificDetails value. + */ + public UnplannedFailoverProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: Provider specific settings. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the UnplannedFailoverInputProperties object itself. + */ + public UnplannedFailoverInputProperties withProviderSpecificDetails( + UnplannedFailoverProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverProviderSpecificInput.java new file mode 100644 index 000000000000..3853deccb8ac --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Provider specific unplanned failover input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = UnplannedFailoverProviderSpecificInput.class) +@JsonTypeName("UnplannedFailoverProviderSpecificInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AUnplannedFailoverInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzureUnplannedFailoverInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2UnplannedFailoverInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmUnplannedFailoverInput.class), + @JsonSubTypes.Type(name = "InMage", value = InMageUnplannedFailoverInput.class) +}) +@Immutable +public class UnplannedFailoverProviderSpecificInput { + /** Creates an instance of UnplannedFailoverProviderSpecificInput class. */ + public UnplannedFailoverProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInput.java new file mode 100644 index 000000000000..7c1bcc9366e5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update appliance for replication protected item input. */ +@Fluent +public final class UpdateApplianceForReplicationProtectedItemInput { + /* + * Update appliance replication protected item properties. + */ + @JsonProperty(value = "properties", required = true) + private UpdateApplianceForReplicationProtectedItemInputProperties properties; + + /** Creates an instance of UpdateApplianceForReplicationProtectedItemInput class. */ + public UpdateApplianceForReplicationProtectedItemInput() { + } + + /** + * Get the properties property: Update appliance replication protected item properties. + * + * @return the properties value. + */ + public UpdateApplianceForReplicationProtectedItemInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Update appliance replication protected item properties. + * + * @param properties the properties value to set. + * @return the UpdateApplianceForReplicationProtectedItemInput object itself. + */ + public UpdateApplianceForReplicationProtectedItemInput withProperties( + UpdateApplianceForReplicationProtectedItemInputProperties 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" + + " UpdateApplianceForReplicationProtectedItemInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateApplianceForReplicationProtectedItemInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java new file mode 100644 index 000000000000..751ac721403a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemInputProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update appliance for protected item input properties. */ +@Fluent +public final class UpdateApplianceForReplicationProtectedItemInputProperties { + /* + * The target appliance Id. + */ + @JsonProperty(value = "targetApplianceId", required = true) + private String targetApplianceId; + + /* + * The provider specific input to update replication protected item. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private UpdateApplianceForReplicationProtectedItemProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of UpdateApplianceForReplicationProtectedItemInputProperties class. */ + public UpdateApplianceForReplicationProtectedItemInputProperties() { + } + + /** + * Get the targetApplianceId property: The target appliance Id. + * + * @return the targetApplianceId value. + */ + public String targetApplianceId() { + return this.targetApplianceId; + } + + /** + * Set the targetApplianceId property: The target appliance Id. + * + * @param targetApplianceId the targetApplianceId value to set. + * @return the UpdateApplianceForReplicationProtectedItemInputProperties object itself. + */ + public UpdateApplianceForReplicationProtectedItemInputProperties withTargetApplianceId(String targetApplianceId) { + this.targetApplianceId = targetApplianceId; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider specific input to update replication protected item. + * + * @return the providerSpecificDetails value. + */ + public UpdateApplianceForReplicationProtectedItemProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific input to update replication protected item. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the UpdateApplianceForReplicationProtectedItemInputProperties object itself. + */ + public UpdateApplianceForReplicationProtectedItemInputProperties withProviderSpecificDetails( + UpdateApplianceForReplicationProtectedItemProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetApplianceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetApplianceId in model" + + " UpdateApplianceForReplicationProtectedItemInputProperties")); + } + if (providerSpecificDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerSpecificDetails in model" + + " UpdateApplianceForReplicationProtectedItemInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(UpdateApplianceForReplicationProtectedItemInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemProviderSpecificInput.java new file mode 100644 index 000000000000..453c78e418e0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateApplianceForReplicationProtectedItemProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Update replication protected item provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = UpdateApplianceForReplicationProtectedItemProviderSpecificInput.class) +@JsonTypeName("UpdateApplianceForReplicationProtectedItemProviderSpecificInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmUpdateApplianceForReplicationProtectedItemInput.class) +}) +@Immutable +public class UpdateApplianceForReplicationProtectedItemProviderSpecificInput { + /** Creates an instance of UpdateApplianceForReplicationProtectedItemProviderSpecificInput class. */ + public UpdateApplianceForReplicationProtectedItemProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateDiskInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateDiskInput.java new file mode 100644 index 000000000000..cc23c0c884b0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateDiskInput.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk input for update. */ +@Fluent +public final class UpdateDiskInput { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId", required = true) + private String diskId; + + /* + * The target disk name. + */ + @JsonProperty(value = "targetDiskName") + private String targetDiskName; + + /** Creates an instance of UpdateDiskInput class. */ + public UpdateDiskInput() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk Id. + * + * @param diskId the diskId value to set. + * @return the UpdateDiskInput object itself. + */ + public UpdateDiskInput withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the targetDiskName property: The target disk name. + * + * @return the targetDiskName value. + */ + public String targetDiskName() { + return this.targetDiskName; + } + + /** + * Set the targetDiskName property: The target disk name. + * + * @param targetDiskName the targetDiskName value to set. + * @return the UpdateDiskInput object itself. + */ + public UpdateDiskInput withTargetDiskName(String targetDiskName) { + this.targetDiskName = targetDiskName; + 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 UpdateDiskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateDiskInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInput.java new file mode 100644 index 000000000000..7e3553541d3c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update migration item input. */ +@Fluent +public final class UpdateMigrationItemInput { + /* + * Update migration item input properties. + */ + @JsonProperty(value = "properties") + private UpdateMigrationItemInputProperties properties; + + /** Creates an instance of UpdateMigrationItemInput class. */ + public UpdateMigrationItemInput() { + } + + /** + * Get the properties property: Update migration item input properties. + * + * @return the properties value. + */ + public UpdateMigrationItemInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Update migration item input properties. + * + * @param properties the properties value to set. + * @return the UpdateMigrationItemInput object itself. + */ + public UpdateMigrationItemInput withProperties(UpdateMigrationItemInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInputProperties.java new file mode 100644 index 000000000000..4efedab53fa1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update migration item input properties. */ +@Fluent +public final class UpdateMigrationItemInputProperties { + /* + * The provider specific input to update migration item. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private UpdateMigrationItemProviderSpecificInput providerSpecificDetails; + + /** Creates an instance of UpdateMigrationItemInputProperties class. */ + public UpdateMigrationItemInputProperties() { + } + + /** + * Get the providerSpecificDetails property: The provider specific input to update migration item. + * + * @return the providerSpecificDetails value. + */ + public UpdateMigrationItemProviderSpecificInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific input to update migration item. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the UpdateMigrationItemInputProperties object itself. + */ + public UpdateMigrationItemInputProperties withProviderSpecificDetails( + UpdateMigrationItemProviderSpecificInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerSpecificDetails in model" + + " UpdateMigrationItemInputProperties")); + } else { + providerSpecificDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateMigrationItemInputProperties.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemProviderSpecificInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemProviderSpecificInput.java new file mode 100644 index 000000000000..fa170b61d358 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemProviderSpecificInput.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.recoveryservicessiterecovery.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; + +/** Update migration item provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = UpdateMigrationItemProviderSpecificInput.class) +@JsonTypeName("UpdateMigrationItemProviderSpecificInput") +@JsonSubTypes({@JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtUpdateMigrationItemInput.class)}) +@Immutable +public class UpdateMigrationItemProviderSpecificInput { + /** Creates an instance of UpdateMigrationItemProviderSpecificInput class. */ + public UpdateMigrationItemProviderSpecificInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMobilityServiceRequest.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMobilityServiceRequest.java new file mode 100644 index 000000000000..ea963041ad67 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMobilityServiceRequest.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to update the mobility service on a protected item. */ +@Fluent +public final class UpdateMobilityServiceRequest { + /* + * The properties of the update mobility service request. + */ + @JsonProperty(value = "properties") + private UpdateMobilityServiceRequestProperties properties; + + /** Creates an instance of UpdateMobilityServiceRequest class. */ + public UpdateMobilityServiceRequest() { + } + + /** + * Get the properties property: The properties of the update mobility service request. + * + * @return the properties value. + */ + public UpdateMobilityServiceRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the update mobility service request. + * + * @param properties the properties value to set. + * @return the UpdateMobilityServiceRequest object itself. + */ + public UpdateMobilityServiceRequest withProperties(UpdateMobilityServiceRequestProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMobilityServiceRequestProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMobilityServiceRequestProperties.java new file mode 100644 index 000000000000..183ec6d4efe1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMobilityServiceRequestProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an update mobility service request. */ +@Fluent +public final class UpdateMobilityServiceRequestProperties { + /* + * The CS run as account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /** Creates an instance of UpdateMobilityServiceRequestProperties class. */ + public UpdateMobilityServiceRequestProperties() { + } + + /** + * Get the runAsAccountId property: The CS run as account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The CS run as account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the UpdateMobilityServiceRequestProperties object itself. + */ + public UpdateMobilityServiceRequestProperties withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateNetworkMappingInput.java new file mode 100644 index 000000000000..2ca31e86b43b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateNetworkMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update network mapping input. */ +@Fluent +public final class UpdateNetworkMappingInput { + /* + * The input properties needed to update network mapping. + */ + @JsonProperty(value = "properties") + private UpdateNetworkMappingInputProperties properties; + + /** Creates an instance of UpdateNetworkMappingInput class. */ + public UpdateNetworkMappingInput() { + } + + /** + * Get the properties property: The input properties needed to update network mapping. + * + * @return the properties value. + */ + public UpdateNetworkMappingInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The input properties needed to update network mapping. + * + * @param properties the properties value to set. + * @return the UpdateNetworkMappingInput object itself. + */ + public UpdateNetworkMappingInput withProperties(UpdateNetworkMappingInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateNetworkMappingInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateNetworkMappingInputProperties.java new file mode 100644 index 000000000000..85823ac81b6f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateNetworkMappingInputProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common input details for network mapping operation. */ +@Fluent +public final class UpdateNetworkMappingInputProperties { + /* + * Recovery fabric name. + */ + @JsonProperty(value = "recoveryFabricName") + private String recoveryFabricName; + + /* + * Recovery network Id. + */ + @JsonProperty(value = "recoveryNetworkId") + private String recoveryNetworkId; + + /* + * Fabrics specific input network Id. + */ + @JsonProperty(value = "fabricSpecificDetails") + private FabricSpecificUpdateNetworkMappingInput fabricSpecificDetails; + + /** Creates an instance of UpdateNetworkMappingInputProperties class. */ + public UpdateNetworkMappingInputProperties() { + } + + /** + * Get the recoveryFabricName property: Recovery fabric name. + * + * @return the recoveryFabricName value. + */ + public String recoveryFabricName() { + return this.recoveryFabricName; + } + + /** + * Set the recoveryFabricName property: Recovery fabric name. + * + * @param recoveryFabricName the recoveryFabricName value to set. + * @return the UpdateNetworkMappingInputProperties object itself. + */ + public UpdateNetworkMappingInputProperties withRecoveryFabricName(String recoveryFabricName) { + this.recoveryFabricName = recoveryFabricName; + return this; + } + + /** + * Get the recoveryNetworkId property: Recovery network Id. + * + * @return the recoveryNetworkId value. + */ + public String recoveryNetworkId() { + return this.recoveryNetworkId; + } + + /** + * Set the recoveryNetworkId property: Recovery network Id. + * + * @param recoveryNetworkId the recoveryNetworkId value to set. + * @return the UpdateNetworkMappingInputProperties object itself. + */ + public UpdateNetworkMappingInputProperties withRecoveryNetworkId(String recoveryNetworkId) { + this.recoveryNetworkId = recoveryNetworkId; + return this; + } + + /** + * Get the fabricSpecificDetails property: Fabrics specific input network Id. + * + * @return the fabricSpecificDetails value. + */ + public FabricSpecificUpdateNetworkMappingInput fabricSpecificDetails() { + return this.fabricSpecificDetails; + } + + /** + * Set the fabricSpecificDetails property: Fabrics specific input network Id. + * + * @param fabricSpecificDetails the fabricSpecificDetails value to set. + * @return the UpdateNetworkMappingInputProperties object itself. + */ + public UpdateNetworkMappingInputProperties withFabricSpecificDetails( + FabricSpecificUpdateNetworkMappingInput fabricSpecificDetails) { + this.fabricSpecificDetails = fabricSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fabricSpecificDetails() != null) { + fabricSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdatePolicyInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdatePolicyInput.java new file mode 100644 index 000000000000..f12ea5be55bb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdatePolicyInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update policy input. */ +@Fluent +public final class UpdatePolicyInput { + /* + * The ReplicationProviderSettings. + */ + @JsonProperty(value = "properties") + private UpdatePolicyInputProperties properties; + + /** Creates an instance of UpdatePolicyInput class. */ + public UpdatePolicyInput() { + } + + /** + * Get the properties property: The ReplicationProviderSettings. + * + * @return the properties value. + */ + public UpdatePolicyInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The ReplicationProviderSettings. + * + * @param properties the properties value to set. + * @return the UpdatePolicyInput object itself. + */ + public UpdatePolicyInput withProperties(UpdatePolicyInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdatePolicyInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdatePolicyInputProperties.java new file mode 100644 index 000000000000..62fac239f63c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdatePolicyInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Policy update properties. */ +@Fluent +public final class UpdatePolicyInputProperties { + /* + * The ReplicationProviderSettings. + */ + @JsonProperty(value = "replicationProviderSettings") + private PolicyProviderSpecificInput replicationProviderSettings; + + /** Creates an instance of UpdatePolicyInputProperties class. */ + public UpdatePolicyInputProperties() { + } + + /** + * Get the replicationProviderSettings property: The ReplicationProviderSettings. + * + * @return the replicationProviderSettings value. + */ + public PolicyProviderSpecificInput replicationProviderSettings() { + return this.replicationProviderSettings; + } + + /** + * Set the replicationProviderSettings property: The ReplicationProviderSettings. + * + * @param replicationProviderSettings the replicationProviderSettings value to set. + * @return the UpdatePolicyInputProperties object itself. + */ + public UpdatePolicyInputProperties withReplicationProviderSettings( + PolicyProviderSpecificInput replicationProviderSettings) { + this.replicationProviderSettings = replicationProviderSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (replicationProviderSettings() != null) { + replicationProviderSettings().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateProtectionContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateProtectionContainerMappingInput.java new file mode 100644 index 000000000000..0af686d2a5d8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateProtectionContainerMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container pairing update input. */ +@Fluent +public final class UpdateProtectionContainerMappingInput { + /* + * Update protection container mapping input properties. + */ + @JsonProperty(value = "properties") + private UpdateProtectionContainerMappingInputProperties properties; + + /** Creates an instance of UpdateProtectionContainerMappingInput class. */ + public UpdateProtectionContainerMappingInput() { + } + + /** + * Get the properties property: Update protection container mapping input properties. + * + * @return the properties value. + */ + public UpdateProtectionContainerMappingInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Update protection container mapping input properties. + * + * @param properties the properties value to set. + * @return the UpdateProtectionContainerMappingInput object itself. + */ + public UpdateProtectionContainerMappingInput withProperties( + UpdateProtectionContainerMappingInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateProtectionContainerMappingInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateProtectionContainerMappingInputProperties.java new file mode 100644 index 000000000000..49385d47f2dc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateProtectionContainerMappingInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container pairing update input. */ +@Fluent +public final class UpdateProtectionContainerMappingInputProperties { + /* + * Provider specific input for updating protection container mapping. + */ + @JsonProperty(value = "providerSpecificInput") + private ReplicationProviderSpecificUpdateContainerMappingInput providerSpecificInput; + + /** Creates an instance of UpdateProtectionContainerMappingInputProperties class. */ + public UpdateProtectionContainerMappingInputProperties() { + } + + /** + * Get the providerSpecificInput property: Provider specific input for updating protection container mapping. + * + * @return the providerSpecificInput value. + */ + public ReplicationProviderSpecificUpdateContainerMappingInput providerSpecificInput() { + return this.providerSpecificInput; + } + + /** + * Set the providerSpecificInput property: Provider specific input for updating protection container mapping. + * + * @param providerSpecificInput the providerSpecificInput value to set. + * @return the UpdateProtectionContainerMappingInputProperties object itself. + */ + public UpdateProtectionContainerMappingInputProperties withProviderSpecificInput( + ReplicationProviderSpecificUpdateContainerMappingInput providerSpecificInput) { + this.providerSpecificInput = providerSpecificInput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerSpecificInput() != null) { + providerSpecificInput().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateRecoveryPlanInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateRecoveryPlanInput.java new file mode 100644 index 000000000000..170aa6453351 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateRecoveryPlanInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update recovery plan input class. */ +@Fluent +public final class UpdateRecoveryPlanInput { + /* + * Recovery plan update properties. + */ + @JsonProperty(value = "properties") + private UpdateRecoveryPlanInputProperties properties; + + /** Creates an instance of UpdateRecoveryPlanInput class. */ + public UpdateRecoveryPlanInput() { + } + + /** + * Get the properties property: Recovery plan update properties. + * + * @return the properties value. + */ + public UpdateRecoveryPlanInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Recovery plan update properties. + * + * @param properties the properties value to set. + * @return the UpdateRecoveryPlanInput object itself. + */ + public UpdateRecoveryPlanInput withProperties(UpdateRecoveryPlanInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateRecoveryPlanInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateRecoveryPlanInputProperties.java new file mode 100644 index 000000000000..96188fa82ade --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateRecoveryPlanInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan update properties. */ +@Fluent +public final class UpdateRecoveryPlanInputProperties { + /* + * The recovery plan groups. + */ + @JsonProperty(value = "groups") + private List groups; + + /** Creates an instance of UpdateRecoveryPlanInputProperties class. */ + public UpdateRecoveryPlanInputProperties() { + } + + /** + * Get the groups property: The recovery plan groups. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The recovery plan groups. + * + * @param groups the groups value to set. + * @return the UpdateRecoveryPlanInputProperties object itself. + */ + public UpdateRecoveryPlanInputProperties withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemInput.java new file mode 100644 index 000000000000..1ab57814e45c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update replication protected item input. */ +@Fluent +public final class UpdateReplicationProtectedItemInput { + /* + * Update replication protected item properties. + */ + @JsonProperty(value = "properties") + private UpdateReplicationProtectedItemInputProperties properties; + + /** Creates an instance of UpdateReplicationProtectedItemInput class. */ + public UpdateReplicationProtectedItemInput() { + } + + /** + * Get the properties property: Update replication protected item properties. + * + * @return the properties value. + */ + public UpdateReplicationProtectedItemInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Update replication protected item properties. + * + * @param properties the properties value to set. + * @return the UpdateReplicationProtectedItemInput object itself. + */ + public UpdateReplicationProtectedItemInput withProperties( + UpdateReplicationProtectedItemInputProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemInputProperties.java new file mode 100644 index 000000000000..4d582c5a0919 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Update protected item input properties. */ +@Fluent +public final class UpdateReplicationProtectedItemInputProperties { + /* + * Target Azure VM name given by the user. + */ + @JsonProperty(value = "recoveryAzureVMName") + private String recoveryAzureVMName; + + /* + * Target Azure VM size. + */ + @JsonProperty(value = "recoveryAzureVMSize") + private String recoveryAzureVMSize; + + /* + * Target Azure Network Id. + */ + @JsonProperty(value = "selectedRecoveryAzureNetworkId") + private String selectedRecoveryAzureNetworkId; + + /* + * The Azure Network Id for test failover. + */ + @JsonProperty(value = "selectedTfoAzureNetworkId") + private String selectedTfoAzureNetworkId; + + /* + * The selected source nic Id which will be used as the primary nic during failover. + */ + @JsonProperty(value = "selectedSourceNicId") + private String selectedSourceNicId; + + /* + * The selected option to enable RDP\SSH on target vm after failover. String value of + * SrsDataContract.EnableRDPOnTargetOption enum. + */ + @JsonProperty(value = "enableRdpOnTargetOption") + private String enableRdpOnTargetOption; + + /* + * The list of VM nic details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * License type. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /* + * The target availability set Id. + */ + @JsonProperty(value = "recoveryAvailabilitySetId") + private String recoveryAvailabilitySetId; + + /* + * The provider specific input to update replication protected item. + */ + @JsonProperty(value = "providerSpecificDetails") + private UpdateReplicationProtectedItemProviderInput providerSpecificDetails; + + /** Creates an instance of UpdateReplicationProtectedItemInputProperties class. */ + public UpdateReplicationProtectedItemInputProperties() { + } + + /** + * Get the recoveryAzureVMName property: Target Azure VM name given by the user. + * + * @return the recoveryAzureVMName value. + */ + public String recoveryAzureVMName() { + return this.recoveryAzureVMName; + } + + /** + * Set the recoveryAzureVMName property: Target Azure VM name given by the user. + * + * @param recoveryAzureVMName the recoveryAzureVMName value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withRecoveryAzureVMName(String recoveryAzureVMName) { + this.recoveryAzureVMName = recoveryAzureVMName; + return this; + } + + /** + * Get the recoveryAzureVMSize property: Target Azure VM size. + * + * @return the recoveryAzureVMSize value. + */ + public String recoveryAzureVMSize() { + return this.recoveryAzureVMSize; + } + + /** + * Set the recoveryAzureVMSize property: Target Azure VM size. + * + * @param recoveryAzureVMSize the recoveryAzureVMSize value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withRecoveryAzureVMSize(String recoveryAzureVMSize) { + this.recoveryAzureVMSize = recoveryAzureVMSize; + return this; + } + + /** + * Get the selectedRecoveryAzureNetworkId property: Target Azure Network Id. + * + * @return the selectedRecoveryAzureNetworkId value. + */ + public String selectedRecoveryAzureNetworkId() { + return this.selectedRecoveryAzureNetworkId; + } + + /** + * Set the selectedRecoveryAzureNetworkId property: Target Azure Network Id. + * + * @param selectedRecoveryAzureNetworkId the selectedRecoveryAzureNetworkId value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withSelectedRecoveryAzureNetworkId( + String selectedRecoveryAzureNetworkId) { + this.selectedRecoveryAzureNetworkId = selectedRecoveryAzureNetworkId; + return this; + } + + /** + * Get the selectedTfoAzureNetworkId property: The Azure Network Id for test failover. + * + * @return the selectedTfoAzureNetworkId value. + */ + public String selectedTfoAzureNetworkId() { + return this.selectedTfoAzureNetworkId; + } + + /** + * Set the selectedTfoAzureNetworkId property: The Azure Network Id for test failover. + * + * @param selectedTfoAzureNetworkId the selectedTfoAzureNetworkId value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withSelectedTfoAzureNetworkId( + String selectedTfoAzureNetworkId) { + this.selectedTfoAzureNetworkId = selectedTfoAzureNetworkId; + return this; + } + + /** + * Get the selectedSourceNicId property: The selected source nic Id which will be used as the primary nic during + * failover. + * + * @return the selectedSourceNicId value. + */ + public String selectedSourceNicId() { + return this.selectedSourceNicId; + } + + /** + * Set the selectedSourceNicId property: The selected source nic Id which will be used as the primary nic during + * failover. + * + * @param selectedSourceNicId the selectedSourceNicId value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withSelectedSourceNicId(String selectedSourceNicId) { + this.selectedSourceNicId = selectedSourceNicId; + return this; + } + + /** + * Get the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target vm after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @return the enableRdpOnTargetOption value. + */ + public String enableRdpOnTargetOption() { + return this.enableRdpOnTargetOption; + } + + /** + * Set the enableRdpOnTargetOption property: The selected option to enable RDP\SSH on target vm after failover. + * String value of SrsDataContract.EnableRDPOnTargetOption enum. + * + * @param enableRdpOnTargetOption the enableRdpOnTargetOption value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withEnableRdpOnTargetOption(String enableRdpOnTargetOption) { + this.enableRdpOnTargetOption = enableRdpOnTargetOption; + return this; + } + + /** + * Get the vmNics property: The list of VM nic details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The list of VM nic details. + * + * @param vmNics the vmNics value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the licenseType property: License type. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: License type. + * + * @param licenseType the licenseType value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the recoveryAvailabilitySetId property: The target availability set Id. + * + * @return the recoveryAvailabilitySetId value. + */ + public String recoveryAvailabilitySetId() { + return this.recoveryAvailabilitySetId; + } + + /** + * Set the recoveryAvailabilitySetId property: The target availability set Id. + * + * @param recoveryAvailabilitySetId the recoveryAvailabilitySetId value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withRecoveryAvailabilitySetId( + String recoveryAvailabilitySetId) { + this.recoveryAvailabilitySetId = recoveryAvailabilitySetId; + return this; + } + + /** + * Get the providerSpecificDetails property: The provider specific input to update replication protected item. + * + * @return the providerSpecificDetails value. + */ + public UpdateReplicationProtectedItemProviderInput providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The provider specific input to update replication protected item. + * + * @param providerSpecificDetails the providerSpecificDetails value to set. + * @return the UpdateReplicationProtectedItemInputProperties object itself. + */ + public UpdateReplicationProtectedItemInputProperties withProviderSpecificDetails( + UpdateReplicationProtectedItemProviderInput providerSpecificDetails) { + this.providerSpecificDetails = providerSpecificDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (providerSpecificDetails() != null) { + providerSpecificDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemProviderInput.java new file mode 100644 index 000000000000..ef38c5302688 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemProviderInput.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.recoveryservicessiterecovery.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; + +/** Update replication protected item provider specific input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = UpdateReplicationProtectedItemProviderInput.class) +@JsonTypeName("UpdateReplicationProtectedItemProviderInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AUpdateReplicationProtectedItemInput.class), + @JsonSubTypes.Type( + name = "HyperVReplicaAzure", + value = HyperVReplicaAzureUpdateReplicationProtectedItemInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2UpdateReplicationProtectedItemInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmUpdateReplicationProtectedItemInput.class) +}) +@Immutable +public class UpdateReplicationProtectedItemProviderInput { + /** Creates an instance of UpdateReplicationProtectedItemProviderInput class. */ + public UpdateReplicationProtectedItemProviderInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateVCenterRequest.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateVCenterRequest.java new file mode 100644 index 000000000000..659efc58a2e3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateVCenterRequest.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input required to update vCenter. */ +@Fluent +public final class UpdateVCenterRequest { + /* + * The update VCenter Request Properties. + */ + @JsonProperty(value = "properties") + private UpdateVCenterRequestProperties properties; + + /** Creates an instance of UpdateVCenterRequest class. */ + public UpdateVCenterRequest() { + } + + /** + * Get the properties property: The update VCenter Request Properties. + * + * @return the properties value. + */ + public UpdateVCenterRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The update VCenter Request Properties. + * + * @param properties the properties value to set. + * @return the UpdateVCenterRequest object itself. + */ + public UpdateVCenterRequest withProperties(UpdateVCenterRequestProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateVCenterRequestProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateVCenterRequestProperties.java new file mode 100644 index 000000000000..e824bed33226 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateVCenterRequestProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an update vCenter request. */ +@Fluent +public final class UpdateVCenterRequestProperties { + /* + * The friendly name of the vCenter. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The IP address of the vCenter to be discovered. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The process server Id from where the update can be orchestrated. + */ + @JsonProperty(value = "processServerId") + private String processServerId; + + /* + * The port number for discovery. + */ + @JsonProperty(value = "port") + private String port; + + /* + * The CS account Id which has privileges to update the vCenter. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /** Creates an instance of UpdateVCenterRequestProperties class. */ + public UpdateVCenterRequestProperties() { + } + + /** + * Get the friendlyName property: The friendly name of the vCenter. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name of the vCenter. + * + * @param friendlyName the friendlyName value to set. + * @return the UpdateVCenterRequestProperties object itself. + */ + public UpdateVCenterRequestProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the ipAddress property: The IP address of the vCenter to be discovered. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address of the vCenter to be discovered. + * + * @param ipAddress the ipAddress value to set. + * @return the UpdateVCenterRequestProperties object itself. + */ + public UpdateVCenterRequestProperties withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the processServerId property: The process server Id from where the update can be orchestrated. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The process server Id from where the update can be orchestrated. + * + * @param processServerId the processServerId value to set. + * @return the UpdateVCenterRequestProperties object itself. + */ + public UpdateVCenterRequestProperties withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the port property: The port number for discovery. + * + * @return the port value. + */ + public String port() { + return this.port; + } + + /** + * Set the port property: The port number for discovery. + * + * @param port the port value to set. + * @return the UpdateVCenterRequestProperties object itself. + */ + public UpdateVCenterRequestProperties withPort(String port) { + this.port = port; + return this; + } + + /** + * Get the runAsAccountId property: The CS account Id which has privileges to update the vCenter. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The CS account Id which has privileges to update the vCenter. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the UpdateVCenterRequestProperties object itself. + */ + public UpdateVCenterRequestProperties withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenter.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenter.java new file mode 100644 index 000000000000..c65312172df3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenter.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VCenterInner; + +/** An immutable client-side representation of VCenter. */ +public interface VCenter { + /** + * 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: VCenter related data. + * + * @return the properties value. + */ + VCenterProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * 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.recoveryservicessiterecovery.fluent.models.VCenterInner object. + * + * @return the inner object. + */ + VCenterInner innerModel(); + + /** The entirety of the VCenter definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VCenter definition stages. */ + interface DefinitionStages { + /** The first stage of the VCenter definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VCenter definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName, fabricName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name. + * @return the next definition stage. + */ + WithCreate withExistingReplicationFabric(String resourceName, String resourceGroupName, String fabricName); + } + /** + * The stage of the VCenter 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + VCenter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VCenter create(Context context); + } + /** The stage of the VCenter definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of an add vCenter request.. + * + * @param properties The properties of an add vCenter request. + * @return the next definition stage. + */ + WithCreate withProperties(AddVCenterRequestProperties properties); + } + } + /** + * Begins update for the VCenter resource. + * + * @return the stage of resource update. + */ + VCenter.Update update(); + + /** The template for VCenter update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VCenter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VCenter apply(Context context); + } + /** The VCenter update stages. */ + interface UpdateStages { + /** The stage of the VCenter update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The update VCenter Request Properties.. + * + * @param properties The update VCenter Request Properties. + * @return the next definition stage. + */ + Update withProperties(UpdateVCenterRequestProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VCenter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VCenter refresh(Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenterCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenterCollection.java new file mode 100644 index 000000000000..0f495cbe86cc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenterCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VCenterInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of vCenter details. */ +@Fluent +public final class VCenterCollection { + /* + * The vCenter details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of VCenterCollection class. */ + public VCenterCollection() { + } + + /** + * Get the value property: The vCenter details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The vCenter details. + * + * @param value the value value to set. + * @return the VCenterCollection object itself. + */ + public VCenterCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the VCenterCollection object itself. + */ + public VCenterCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenterProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenterProperties.java new file mode 100644 index 000000000000..49830741bf59 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenterProperties.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** vCenter properties. */ +@Fluent +public final class VCenterProperties { + /* + * Friendly name of the vCenter. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * VCenter internal ID. + */ + @JsonProperty(value = "internalId") + private String internalId; + + /* + * The time when the last heartbeat was received by vCenter. + */ + @JsonProperty(value = "lastHeartbeat") + private OffsetDateTime lastHeartbeat; + + /* + * The VCenter discovery status. + */ + @JsonProperty(value = "discoveryStatus") + private String discoveryStatus; + + /* + * The process server Id. + */ + @JsonProperty(value = "processServerId") + private String processServerId; + + /* + * The IP address of the vCenter. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The infrastructure Id of vCenter. + */ + @JsonProperty(value = "infrastructureId") + private String infrastructureId; + + /* + * The port number for discovery. + */ + @JsonProperty(value = "port") + private String port; + + /* + * The account Id which has privileges to discover the vCenter. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /* + * The ARM resource name of the fabric containing this VCenter. + */ + @JsonProperty(value = "fabricArmResourceName") + private String fabricArmResourceName; + + /* + * The health errors for this VCenter. + */ + @JsonProperty(value = "healthErrors") + private List healthErrors; + + /** Creates an instance of VCenterProperties class. */ + public VCenterProperties() { + } + + /** + * Get the friendlyName property: Friendly name of the vCenter. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the vCenter. + * + * @param friendlyName the friendlyName value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the internalId property: VCenter internal ID. + * + * @return the internalId value. + */ + public String internalId() { + return this.internalId; + } + + /** + * Set the internalId property: VCenter internal ID. + * + * @param internalId the internalId value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withInternalId(String internalId) { + this.internalId = internalId; + return this; + } + + /** + * Get the lastHeartbeat property: The time when the last heartbeat was received by vCenter. + * + * @return the lastHeartbeat value. + */ + public OffsetDateTime lastHeartbeat() { + return this.lastHeartbeat; + } + + /** + * Set the lastHeartbeat property: The time when the last heartbeat was received by vCenter. + * + * @param lastHeartbeat the lastHeartbeat value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withLastHeartbeat(OffsetDateTime lastHeartbeat) { + this.lastHeartbeat = lastHeartbeat; + return this; + } + + /** + * Get the discoveryStatus property: The VCenter discovery status. + * + * @return the discoveryStatus value. + */ + public String discoveryStatus() { + return this.discoveryStatus; + } + + /** + * Set the discoveryStatus property: The VCenter discovery status. + * + * @param discoveryStatus the discoveryStatus value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withDiscoveryStatus(String discoveryStatus) { + this.discoveryStatus = discoveryStatus; + return this; + } + + /** + * Get the processServerId property: The process server Id. + * + * @return the processServerId value. + */ + public String processServerId() { + return this.processServerId; + } + + /** + * Set the processServerId property: The process server Id. + * + * @param processServerId the processServerId value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withProcessServerId(String processServerId) { + this.processServerId = processServerId; + return this; + } + + /** + * Get the ipAddress property: The IP address of the vCenter. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address of the vCenter. + * + * @param ipAddress the ipAddress value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the infrastructureId property: The infrastructure Id of vCenter. + * + * @return the infrastructureId value. + */ + public String infrastructureId() { + return this.infrastructureId; + } + + /** + * Set the infrastructureId property: The infrastructure Id of vCenter. + * + * @param infrastructureId the infrastructureId value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withInfrastructureId(String infrastructureId) { + this.infrastructureId = infrastructureId; + return this; + } + + /** + * Get the port property: The port number for discovery. + * + * @return the port value. + */ + public String port() { + return this.port; + } + + /** + * Set the port property: The port number for discovery. + * + * @param port the port value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withPort(String port) { + this.port = port; + return this; + } + + /** + * Get the runAsAccountId property: The account Id which has privileges to discover the vCenter. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: The account Id which has privileges to discover the vCenter. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Get the fabricArmResourceName property: The ARM resource name of the fabric containing this VCenter. + * + * @return the fabricArmResourceName value. + */ + public String fabricArmResourceName() { + return this.fabricArmResourceName; + } + + /** + * Set the fabricArmResourceName property: The ARM resource name of the fabric containing this VCenter. + * + * @param fabricArmResourceName the fabricArmResourceName value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withFabricArmResourceName(String fabricArmResourceName) { + this.fabricArmResourceName = fabricArmResourceName; + return this; + } + + /** + * Get the healthErrors property: The health errors for this VCenter. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Set the healthErrors property: The health errors for this VCenter. + * + * @param healthErrors the healthErrors value to set. + * @return the VCenterProperties object itself. + */ + public VCenterProperties withHealthErrors(List healthErrors) { + this.healthErrors = healthErrors; + 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()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicDetails.java new file mode 100644 index 000000000000..47575f7798ef --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Hyper V VM network details. */ +@Fluent +public final class VMNicDetails { + /* + * The nic Id. + */ + @JsonProperty(value = "nicId") + private String nicId; + + /* + * The replica nic Id. + */ + @JsonProperty(value = "replicaNicId") + private String replicaNicId; + + /* + * The source nic ARM Id. + */ + @JsonProperty(value = "sourceNicArmId") + private String sourceNicArmId; + + /* + * VM network name. + */ + @JsonProperty(value = "vMNetworkName") + private String vMNetworkName; + + /* + * Recovery VM network Id. + */ + @JsonProperty(value = "recoveryVMNetworkId") + private String recoveryVMNetworkId; + + /* + * The IP configurations of the NIC. + */ + @JsonProperty(value = "ipConfigs") + private List ipConfigs; + + /* + * Selection type for failover. + */ + @JsonProperty(value = "selectionType") + private String selectionType; + + /* + * The id of the NSG associated with the NIC. + */ + @JsonProperty(value = "recoveryNetworkSecurityGroupId") + private String recoveryNetworkSecurityGroupId; + + /* + * A value indicating whether the NIC has accelerated networking enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworkingOnRecovery") + private Boolean enableAcceleratedNetworkingOnRecovery; + + /* + * The network to be used by NIC during test failover. + */ + @JsonProperty(value = "tfoVMNetworkId") + private String tfoVMNetworkId; + + /* + * The NSG to be used by NIC during test failover. + */ + @JsonProperty(value = "tfoNetworkSecurityGroupId") + private String tfoNetworkSecurityGroupId; + + /* + * Whether the TFO NIC has accelerated networking enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworkingOnTfo") + private Boolean enableAcceleratedNetworkingOnTfo; + + /* + * The name of the NIC to be used when creating target NICs. + */ + @JsonProperty(value = "recoveryNicName") + private String recoveryNicName; + + /* + * The resource group of the NIC to be used when creating target NICs. + */ + @JsonProperty(value = "recoveryNicResourceGroupName") + private String recoveryNicResourceGroupName; + + /* + * A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + */ + @JsonProperty(value = "reuseExistingNic") + private Boolean reuseExistingNic; + + /* + * The name of the NIC to be used when creating target NICs in TFO. + */ + @JsonProperty(value = "tfoRecoveryNicName") + private String tfoRecoveryNicName; + + /* + * The resource group of the NIC to be used when creating target NICs in TFO. + */ + @JsonProperty(value = "tfoRecoveryNicResourceGroupName") + private String tfoRecoveryNicResourceGroupName; + + /* + * A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + */ + @JsonProperty(value = "tfoReuseExistingNic") + private Boolean tfoReuseExistingNic; + + /* + * Target NIC name. + */ + @JsonProperty(value = "targetNicName") + private String targetNicName; + + /** Creates an instance of VMNicDetails class. */ + public VMNicDetails() { + } + + /** + * Get the nicId property: The nic Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Set the nicId property: The nic Id. + * + * @param nicId the nicId value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withNicId(String nicId) { + this.nicId = nicId; + return this; + } + + /** + * Get the replicaNicId property: The replica nic Id. + * + * @return the replicaNicId value. + */ + public String replicaNicId() { + return this.replicaNicId; + } + + /** + * Set the replicaNicId property: The replica nic Id. + * + * @param replicaNicId the replicaNicId value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withReplicaNicId(String replicaNicId) { + this.replicaNicId = replicaNicId; + return this; + } + + /** + * Get the sourceNicArmId property: The source nic ARM Id. + * + * @return the sourceNicArmId value. + */ + public String sourceNicArmId() { + return this.sourceNicArmId; + } + + /** + * Set the sourceNicArmId property: The source nic ARM Id. + * + * @param sourceNicArmId the sourceNicArmId value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withSourceNicArmId(String sourceNicArmId) { + this.sourceNicArmId = sourceNicArmId; + return this; + } + + /** + * Get the vMNetworkName property: VM network name. + * + * @return the vMNetworkName value. + */ + public String vMNetworkName() { + return this.vMNetworkName; + } + + /** + * Set the vMNetworkName property: VM network name. + * + * @param vMNetworkName the vMNetworkName value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withVMNetworkName(String vMNetworkName) { + this.vMNetworkName = vMNetworkName; + return this; + } + + /** + * Get the recoveryVMNetworkId property: Recovery VM network Id. + * + * @return the recoveryVMNetworkId value. + */ + public String recoveryVMNetworkId() { + return this.recoveryVMNetworkId; + } + + /** + * Set the recoveryVMNetworkId property: Recovery VM network Id. + * + * @param recoveryVMNetworkId the recoveryVMNetworkId value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withRecoveryVMNetworkId(String recoveryVMNetworkId) { + this.recoveryVMNetworkId = recoveryVMNetworkId; + return this; + } + + /** + * Get the ipConfigs property: The IP configurations of the NIC. + * + * @return the ipConfigs value. + */ + public List ipConfigs() { + return this.ipConfigs; + } + + /** + * Set the ipConfigs property: The IP configurations of the NIC. + * + * @param ipConfigs the ipConfigs value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withIpConfigs(List ipConfigs) { + this.ipConfigs = ipConfigs; + return this; + } + + /** + * Get the selectionType property: Selection type for failover. + * + * @return the selectionType value. + */ + public String selectionType() { + return this.selectionType; + } + + /** + * Set the selectionType property: Selection type for failover. + * + * @param selectionType the selectionType value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withSelectionType(String selectionType) { + this.selectionType = selectionType; + return this; + } + + /** + * Get the recoveryNetworkSecurityGroupId property: The id of the NSG associated with the NIC. + * + * @return the recoveryNetworkSecurityGroupId value. + */ + public String recoveryNetworkSecurityGroupId() { + return this.recoveryNetworkSecurityGroupId; + } + + /** + * Set the recoveryNetworkSecurityGroupId property: The id of the NSG associated with the NIC. + * + * @param recoveryNetworkSecurityGroupId the recoveryNetworkSecurityGroupId value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withRecoveryNetworkSecurityGroupId(String recoveryNetworkSecurityGroupId) { + this.recoveryNetworkSecurityGroupId = recoveryNetworkSecurityGroupId; + return this; + } + + /** + * Get the enableAcceleratedNetworkingOnRecovery property: A value indicating whether the NIC has accelerated + * networking enabled. + * + * @return the enableAcceleratedNetworkingOnRecovery value. + */ + public Boolean enableAcceleratedNetworkingOnRecovery() { + return this.enableAcceleratedNetworkingOnRecovery; + } + + /** + * Set the enableAcceleratedNetworkingOnRecovery property: A value indicating whether the NIC has accelerated + * networking enabled. + * + * @param enableAcceleratedNetworkingOnRecovery the enableAcceleratedNetworkingOnRecovery value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withEnableAcceleratedNetworkingOnRecovery(Boolean enableAcceleratedNetworkingOnRecovery) { + this.enableAcceleratedNetworkingOnRecovery = enableAcceleratedNetworkingOnRecovery; + return this; + } + + /** + * Get the tfoVMNetworkId property: The network to be used by NIC during test failover. + * + * @return the tfoVMNetworkId value. + */ + public String tfoVMNetworkId() { + return this.tfoVMNetworkId; + } + + /** + * Set the tfoVMNetworkId property: The network to be used by NIC during test failover. + * + * @param tfoVMNetworkId the tfoVMNetworkId value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withTfoVMNetworkId(String tfoVMNetworkId) { + this.tfoVMNetworkId = tfoVMNetworkId; + return this; + } + + /** + * Get the tfoNetworkSecurityGroupId property: The NSG to be used by NIC during test failover. + * + * @return the tfoNetworkSecurityGroupId value. + */ + public String tfoNetworkSecurityGroupId() { + return this.tfoNetworkSecurityGroupId; + } + + /** + * Set the tfoNetworkSecurityGroupId property: The NSG to be used by NIC during test failover. + * + * @param tfoNetworkSecurityGroupId the tfoNetworkSecurityGroupId value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withTfoNetworkSecurityGroupId(String tfoNetworkSecurityGroupId) { + this.tfoNetworkSecurityGroupId = tfoNetworkSecurityGroupId; + return this; + } + + /** + * Get the enableAcceleratedNetworkingOnTfo property: Whether the TFO NIC has accelerated networking enabled. + * + * @return the enableAcceleratedNetworkingOnTfo value. + */ + public Boolean enableAcceleratedNetworkingOnTfo() { + return this.enableAcceleratedNetworkingOnTfo; + } + + /** + * Set the enableAcceleratedNetworkingOnTfo property: Whether the TFO NIC has accelerated networking enabled. + * + * @param enableAcceleratedNetworkingOnTfo the enableAcceleratedNetworkingOnTfo value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withEnableAcceleratedNetworkingOnTfo(Boolean enableAcceleratedNetworkingOnTfo) { + this.enableAcceleratedNetworkingOnTfo = enableAcceleratedNetworkingOnTfo; + return this; + } + + /** + * Get the recoveryNicName property: The name of the NIC to be used when creating target NICs. + * + * @return the recoveryNicName value. + */ + public String recoveryNicName() { + return this.recoveryNicName; + } + + /** + * Set the recoveryNicName property: The name of the NIC to be used when creating target NICs. + * + * @param recoveryNicName the recoveryNicName value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withRecoveryNicName(String recoveryNicName) { + this.recoveryNicName = recoveryNicName; + return this; + } + + /** + * Get the recoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target + * NICs. + * + * @return the recoveryNicResourceGroupName value. + */ + public String recoveryNicResourceGroupName() { + return this.recoveryNicResourceGroupName; + } + + /** + * Set the recoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target + * NICs. + * + * @param recoveryNicResourceGroupName the recoveryNicResourceGroupName value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withRecoveryNicResourceGroupName(String recoveryNicResourceGroupName) { + this.recoveryNicResourceGroupName = recoveryNicResourceGroupName; + return this; + } + + /** + * Get the reuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during + * failover subject to availability. + * + * @return the reuseExistingNic value. + */ + public Boolean reuseExistingNic() { + return this.reuseExistingNic; + } + + /** + * Set the reuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during + * failover subject to availability. + * + * @param reuseExistingNic the reuseExistingNic value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withReuseExistingNic(Boolean reuseExistingNic) { + this.reuseExistingNic = reuseExistingNic; + return this; + } + + /** + * Get the tfoRecoveryNicName property: The name of the NIC to be used when creating target NICs in TFO. + * + * @return the tfoRecoveryNicName value. + */ + public String tfoRecoveryNicName() { + return this.tfoRecoveryNicName; + } + + /** + * Set the tfoRecoveryNicName property: The name of the NIC to be used when creating target NICs in TFO. + * + * @param tfoRecoveryNicName the tfoRecoveryNicName value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withTfoRecoveryNicName(String tfoRecoveryNicName) { + this.tfoRecoveryNicName = tfoRecoveryNicName; + return this; + } + + /** + * Get the tfoRecoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target + * NICs in TFO. + * + * @return the tfoRecoveryNicResourceGroupName value. + */ + public String tfoRecoveryNicResourceGroupName() { + return this.tfoRecoveryNicResourceGroupName; + } + + /** + * Set the tfoRecoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target + * NICs in TFO. + * + * @param tfoRecoveryNicResourceGroupName the tfoRecoveryNicResourceGroupName value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withTfoRecoveryNicResourceGroupName(String tfoRecoveryNicResourceGroupName) { + this.tfoRecoveryNicResourceGroupName = tfoRecoveryNicResourceGroupName; + return this; + } + + /** + * Get the tfoReuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during + * test failover subject to availability. + * + * @return the tfoReuseExistingNic value. + */ + public Boolean tfoReuseExistingNic() { + return this.tfoReuseExistingNic; + } + + /** + * Set the tfoReuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during + * test failover subject to availability. + * + * @param tfoReuseExistingNic the tfoReuseExistingNic value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withTfoReuseExistingNic(Boolean tfoReuseExistingNic) { + this.tfoReuseExistingNic = tfoReuseExistingNic; + return this; + } + + /** + * Get the targetNicName property: Target NIC name. + * + * @return the targetNicName value. + */ + public String targetNicName() { + return this.targetNicName; + } + + /** + * Set the targetNicName property: Target NIC name. + * + * @param targetNicName the targetNicName value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withTargetNicName(String targetNicName) { + this.targetNicName = targetNicName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigs() != null) { + ipConfigs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicInputDetails.java new file mode 100644 index 000000000000..ad13bc24c330 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicInputDetails.java @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Hyper V VM network input details. */ +@Fluent +public final class VMNicInputDetails { + /* + * The nic Id. + */ + @JsonProperty(value = "nicId") + private String nicId; + + /* + * The IP configurations to be used by NIC during test failover and failover. + */ + @JsonProperty(value = "ipConfigs") + private List ipConfigs; + + /* + * Selection type for failover. + */ + @JsonProperty(value = "selectionType") + private String selectionType; + + /* + * The id of the NSG associated with the NIC. + */ + @JsonProperty(value = "recoveryNetworkSecurityGroupId") + private String recoveryNetworkSecurityGroupId; + + /* + * Whether the NIC has accelerated networking enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworkingOnRecovery") + private Boolean enableAcceleratedNetworkingOnRecovery; + + /* + * The NSG to be used by NIC during test failover. + */ + @JsonProperty(value = "tfoNetworkSecurityGroupId") + private String tfoNetworkSecurityGroupId; + + /* + * Whether the test NIC has accelerated networking enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworkingOnTfo") + private Boolean enableAcceleratedNetworkingOnTfo; + + /* + * The name of the NIC to be used when creating target NICs. + */ + @JsonProperty(value = "recoveryNicName") + private String recoveryNicName; + + /* + * The resource group of the NIC to be used when creating target NICs. + */ + @JsonProperty(value = "recoveryNicResourceGroupName") + private String recoveryNicResourceGroupName; + + /* + * A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. + */ + @JsonProperty(value = "reuseExistingNic") + private Boolean reuseExistingNic; + + /* + * The name of the NIC to be used when creating target NICs in TFO. + */ + @JsonProperty(value = "tfoNicName") + private String tfoNicName; + + /* + * The resource group of the NIC to be used when creating target NICs in TFO. + */ + @JsonProperty(value = "tfoNicResourceGroupName") + private String tfoNicResourceGroupName; + + /* + * A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. + */ + @JsonProperty(value = "tfoReuseExistingNic") + private Boolean tfoReuseExistingNic; + + /* + * Target NIC name. + */ + @JsonProperty(value = "targetNicName") + private String targetNicName; + + /** Creates an instance of VMNicInputDetails class. */ + public VMNicInputDetails() { + } + + /** + * Get the nicId property: The nic Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Set the nicId property: The nic Id. + * + * @param nicId the nicId value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withNicId(String nicId) { + this.nicId = nicId; + return this; + } + + /** + * Get the ipConfigs property: The IP configurations to be used by NIC during test failover and failover. + * + * @return the ipConfigs value. + */ + public List ipConfigs() { + return this.ipConfigs; + } + + /** + * Set the ipConfigs property: The IP configurations to be used by NIC during test failover and failover. + * + * @param ipConfigs the ipConfigs value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withIpConfigs(List ipConfigs) { + this.ipConfigs = ipConfigs; + return this; + } + + /** + * Get the selectionType property: Selection type for failover. + * + * @return the selectionType value. + */ + public String selectionType() { + return this.selectionType; + } + + /** + * Set the selectionType property: Selection type for failover. + * + * @param selectionType the selectionType value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withSelectionType(String selectionType) { + this.selectionType = selectionType; + return this; + } + + /** + * Get the recoveryNetworkSecurityGroupId property: The id of the NSG associated with the NIC. + * + * @return the recoveryNetworkSecurityGroupId value. + */ + public String recoveryNetworkSecurityGroupId() { + return this.recoveryNetworkSecurityGroupId; + } + + /** + * Set the recoveryNetworkSecurityGroupId property: The id of the NSG associated with the NIC. + * + * @param recoveryNetworkSecurityGroupId the recoveryNetworkSecurityGroupId value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withRecoveryNetworkSecurityGroupId(String recoveryNetworkSecurityGroupId) { + this.recoveryNetworkSecurityGroupId = recoveryNetworkSecurityGroupId; + return this; + } + + /** + * Get the enableAcceleratedNetworkingOnRecovery property: Whether the NIC has accelerated networking enabled. + * + * @return the enableAcceleratedNetworkingOnRecovery value. + */ + public Boolean enableAcceleratedNetworkingOnRecovery() { + return this.enableAcceleratedNetworkingOnRecovery; + } + + /** + * Set the enableAcceleratedNetworkingOnRecovery property: Whether the NIC has accelerated networking enabled. + * + * @param enableAcceleratedNetworkingOnRecovery the enableAcceleratedNetworkingOnRecovery value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withEnableAcceleratedNetworkingOnRecovery(Boolean enableAcceleratedNetworkingOnRecovery) { + this.enableAcceleratedNetworkingOnRecovery = enableAcceleratedNetworkingOnRecovery; + return this; + } + + /** + * Get the tfoNetworkSecurityGroupId property: The NSG to be used by NIC during test failover. + * + * @return the tfoNetworkSecurityGroupId value. + */ + public String tfoNetworkSecurityGroupId() { + return this.tfoNetworkSecurityGroupId; + } + + /** + * Set the tfoNetworkSecurityGroupId property: The NSG to be used by NIC during test failover. + * + * @param tfoNetworkSecurityGroupId the tfoNetworkSecurityGroupId value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withTfoNetworkSecurityGroupId(String tfoNetworkSecurityGroupId) { + this.tfoNetworkSecurityGroupId = tfoNetworkSecurityGroupId; + return this; + } + + /** + * Get the enableAcceleratedNetworkingOnTfo property: Whether the test NIC has accelerated networking enabled. + * + * @return the enableAcceleratedNetworkingOnTfo value. + */ + public Boolean enableAcceleratedNetworkingOnTfo() { + return this.enableAcceleratedNetworkingOnTfo; + } + + /** + * Set the enableAcceleratedNetworkingOnTfo property: Whether the test NIC has accelerated networking enabled. + * + * @param enableAcceleratedNetworkingOnTfo the enableAcceleratedNetworkingOnTfo value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withEnableAcceleratedNetworkingOnTfo(Boolean enableAcceleratedNetworkingOnTfo) { + this.enableAcceleratedNetworkingOnTfo = enableAcceleratedNetworkingOnTfo; + return this; + } + + /** + * Get the recoveryNicName property: The name of the NIC to be used when creating target NICs. + * + * @return the recoveryNicName value. + */ + public String recoveryNicName() { + return this.recoveryNicName; + } + + /** + * Set the recoveryNicName property: The name of the NIC to be used when creating target NICs. + * + * @param recoveryNicName the recoveryNicName value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withRecoveryNicName(String recoveryNicName) { + this.recoveryNicName = recoveryNicName; + return this; + } + + /** + * Get the recoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target + * NICs. + * + * @return the recoveryNicResourceGroupName value. + */ + public String recoveryNicResourceGroupName() { + return this.recoveryNicResourceGroupName; + } + + /** + * Set the recoveryNicResourceGroupName property: The resource group of the NIC to be used when creating target + * NICs. + * + * @param recoveryNicResourceGroupName the recoveryNicResourceGroupName value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withRecoveryNicResourceGroupName(String recoveryNicResourceGroupName) { + this.recoveryNicResourceGroupName = recoveryNicResourceGroupName; + return this; + } + + /** + * Get the reuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during + * failover subject to availability. + * + * @return the reuseExistingNic value. + */ + public Boolean reuseExistingNic() { + return this.reuseExistingNic; + } + + /** + * Set the reuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during + * failover subject to availability. + * + * @param reuseExistingNic the reuseExistingNic value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withReuseExistingNic(Boolean reuseExistingNic) { + this.reuseExistingNic = reuseExistingNic; + return this; + } + + /** + * Get the tfoNicName property: The name of the NIC to be used when creating target NICs in TFO. + * + * @return the tfoNicName value. + */ + public String tfoNicName() { + return this.tfoNicName; + } + + /** + * Set the tfoNicName property: The name of the NIC to be used when creating target NICs in TFO. + * + * @param tfoNicName the tfoNicName value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withTfoNicName(String tfoNicName) { + this.tfoNicName = tfoNicName; + return this; + } + + /** + * Get the tfoNicResourceGroupName property: The resource group of the NIC to be used when creating target NICs in + * TFO. + * + * @return the tfoNicResourceGroupName value. + */ + public String tfoNicResourceGroupName() { + return this.tfoNicResourceGroupName; + } + + /** + * Set the tfoNicResourceGroupName property: The resource group of the NIC to be used when creating target NICs in + * TFO. + * + * @param tfoNicResourceGroupName the tfoNicResourceGroupName value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withTfoNicResourceGroupName(String tfoNicResourceGroupName) { + this.tfoNicResourceGroupName = tfoNicResourceGroupName; + return this; + } + + /** + * Get the tfoReuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during + * test failover subject to availability. + * + * @return the tfoReuseExistingNic value. + */ + public Boolean tfoReuseExistingNic() { + return this.tfoReuseExistingNic; + } + + /** + * Set the tfoReuseExistingNic property: A value indicating whether an existing NIC is allowed to be reused during + * test failover subject to availability. + * + * @param tfoReuseExistingNic the tfoReuseExistingNic value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withTfoReuseExistingNic(Boolean tfoReuseExistingNic) { + this.tfoReuseExistingNic = tfoReuseExistingNic; + return this; + } + + /** + * Get the targetNicName property: Target NIC name. + * + * @return the targetNicName value. + */ + public String targetNicName() { + return this.targetNicName; + } + + /** + * Set the targetNicName property: Target NIC name. + * + * @param targetNicName the targetNicName value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withTargetNicName(String targetNicName) { + this.targetNicName = targetNicName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigs() != null) { + ipConfigs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtContainerCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtContainerCreationInput.java new file mode 100644 index 000000000000..66c7b56bbab7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtContainerCreationInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMwareCbt container creation input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Immutable +public final class VMwareCbtContainerCreationInput extends ReplicationProviderSpecificContainerCreationInput { + /** Creates an instance of VMwareCbtContainerCreationInput class. */ + public VMwareCbtContainerCreationInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtContainerMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtContainerMappingInput.java new file mode 100644 index 000000000000..64dfdd89b93b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtContainerMappingInput.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.recoveryservicessiterecovery.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; + +/** VMwareCbt container mapping input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtContainerMappingInput extends ReplicationProviderSpecificContainerMappingInput { + /* + * The target key vault ARM Id. + */ + @JsonProperty(value = "keyVaultId") + private String keyVaultId; + + /* + * The target key vault URL. + */ + @JsonProperty(value = "keyVaultUri") + private String keyVaultUri; + + /* + * The storage account ARM Id. + */ + @JsonProperty(value = "storageAccountId", required = true) + private String storageAccountId; + + /* + * The secret name of the storage account. + */ + @JsonProperty(value = "storageAccountSasSecretName") + private String storageAccountSasSecretName; + + /* + * The secret name of the service bus connection string. + */ + @JsonProperty(value = "serviceBusConnectionStringSecretName") + private String serviceBusConnectionStringSecretName; + + /* + * The target location. + */ + @JsonProperty(value = "targetLocation", required = true) + private String targetLocation; + + /** Creates an instance of VMwareCbtContainerMappingInput class. */ + public VMwareCbtContainerMappingInput() { + } + + /** + * Get the keyVaultId property: The target key vault ARM Id. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Set the keyVaultId property: The target key vault ARM Id. + * + * @param keyVaultId the keyVaultId value to set. + * @return the VMwareCbtContainerMappingInput object itself. + */ + public VMwareCbtContainerMappingInput withKeyVaultId(String keyVaultId) { + this.keyVaultId = keyVaultId; + return this; + } + + /** + * Get the keyVaultUri property: The target key vault URL. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: The target key vault URL. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the VMwareCbtContainerMappingInput object itself. + */ + public VMwareCbtContainerMappingInput withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the storageAccountId property: The storage account ARM Id. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The storage account ARM Id. + * + * @param storageAccountId the storageAccountId value to set. + * @return the VMwareCbtContainerMappingInput object itself. + */ + public VMwareCbtContainerMappingInput withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the storageAccountSasSecretName property: The secret name of the storage account. + * + * @return the storageAccountSasSecretName value. + */ + public String storageAccountSasSecretName() { + return this.storageAccountSasSecretName; + } + + /** + * Set the storageAccountSasSecretName property: The secret name of the storage account. + * + * @param storageAccountSasSecretName the storageAccountSasSecretName value to set. + * @return the VMwareCbtContainerMappingInput object itself. + */ + public VMwareCbtContainerMappingInput withStorageAccountSasSecretName(String storageAccountSasSecretName) { + this.storageAccountSasSecretName = storageAccountSasSecretName; + return this; + } + + /** + * Get the serviceBusConnectionStringSecretName property: The secret name of the service bus connection string. + * + * @return the serviceBusConnectionStringSecretName value. + */ + public String serviceBusConnectionStringSecretName() { + return this.serviceBusConnectionStringSecretName; + } + + /** + * Set the serviceBusConnectionStringSecretName property: The secret name of the service bus connection string. + * + * @param serviceBusConnectionStringSecretName the serviceBusConnectionStringSecretName value to set. + * @return the VMwareCbtContainerMappingInput object itself. + */ + public VMwareCbtContainerMappingInput withServiceBusConnectionStringSecretName( + String serviceBusConnectionStringSecretName) { + this.serviceBusConnectionStringSecretName = serviceBusConnectionStringSecretName; + return this; + } + + /** + * Get the targetLocation property: The target location. + * + * @return the targetLocation value. + */ + public String targetLocation() { + return this.targetLocation; + } + + /** + * Set the targetLocation property: The target location. + * + * @param targetLocation the targetLocation value to set. + * @return the VMwareCbtContainerMappingInput object itself. + */ + public VMwareCbtContainerMappingInput withTargetLocation(String targetLocation) { + this.targetLocation = targetLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (storageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageAccountId in model VMwareCbtContainerMappingInput")); + } + if (targetLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetLocation in model VMwareCbtContainerMappingInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareCbtContainerMappingInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtDiskInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtDiskInput.java new file mode 100644 index 000000000000..fcedc4b712ea --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtDiskInput.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareCbt disk input. */ +@Fluent +public final class VMwareCbtDiskInput { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId", required = true) + private String diskId; + + /* + * The disk type. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /* + * A value indicating whether the disk is the OS disk. + */ + @JsonProperty(value = "isOSDisk", required = true) + private String isOSDisk; + + /* + * The log storage account ARM Id. + */ + @JsonProperty(value = "logStorageAccountId", required = true) + private String logStorageAccountId; + + /* + * The key vault secret name of the log storage account. + */ + @JsonProperty(value = "logStorageAccountSasSecretName", required = true) + private String logStorageAccountSasSecretName; + + /* + * The DiskEncryptionSet ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** Creates an instance of VMwareCbtDiskInput class. */ + public VMwareCbtDiskInput() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk Id. + * + * @param diskId the diskId value to set. + * @return the VMwareCbtDiskInput object itself. + */ + public VMwareCbtDiskInput withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the diskType property: The disk type. + * + * @return the diskType value. + */ + public DiskAccountType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The disk type. + * + * @param diskType the diskType value to set. + * @return the VMwareCbtDiskInput object itself. + */ + public VMwareCbtDiskInput withDiskType(DiskAccountType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the isOSDisk property: A value indicating whether the disk is the OS disk. + * + * @return the isOSDisk value. + */ + public String isOSDisk() { + return this.isOSDisk; + } + + /** + * Set the isOSDisk property: A value indicating whether the disk is the OS disk. + * + * @param isOSDisk the isOSDisk value to set. + * @return the VMwareCbtDiskInput object itself. + */ + public VMwareCbtDiskInput withIsOSDisk(String isOSDisk) { + this.isOSDisk = isOSDisk; + return this; + } + + /** + * Get the logStorageAccountId property: The log storage account ARM Id. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Set the logStorageAccountId property: The log storage account ARM Id. + * + * @param logStorageAccountId the logStorageAccountId value to set. + * @return the VMwareCbtDiskInput object itself. + */ + public VMwareCbtDiskInput withLogStorageAccountId(String logStorageAccountId) { + this.logStorageAccountId = logStorageAccountId; + return this; + } + + /** + * Get the logStorageAccountSasSecretName property: The key vault secret name of the log storage account. + * + * @return the logStorageAccountSasSecretName value. + */ + public String logStorageAccountSasSecretName() { + return this.logStorageAccountSasSecretName; + } + + /** + * Set the logStorageAccountSasSecretName property: The key vault secret name of the log storage account. + * + * @param logStorageAccountSasSecretName the logStorageAccountSasSecretName value to set. + * @return the VMwareCbtDiskInput object itself. + */ + public VMwareCbtDiskInput withLogStorageAccountSasSecretName(String logStorageAccountSasSecretName) { + this.logStorageAccountSasSecretName = logStorageAccountSasSecretName; + return this; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the VMwareCbtDiskInput object itself. + */ + public VMwareCbtDiskInput withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + 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 VMwareCbtDiskInput")); + } + if (isOSDisk() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property isOSDisk in model VMwareCbtDiskInput")); + } + if (logStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property logStorageAccountId in model VMwareCbtDiskInput")); + } + if (logStorageAccountSasSecretName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property logStorageAccountSasSecretName in model VMwareCbtDiskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareCbtDiskInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtEnableMigrationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtEnableMigrationInput.java new file mode 100644 index 000000000000..487bb378469c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtEnableMigrationInput.java @@ -0,0 +1,677 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** VMwareCbt specific enable migration input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtEnableMigrationInput extends EnableMigrationProviderSpecificInput { + /* + * The ARM Id of the VM discovered in VMware. + */ + @JsonProperty(value = "vmwareMachineId", required = true) + private String vmwareMachineId; + + /* + * The disks to include list. + */ + @JsonProperty(value = "disksToInclude", required = true) + private List disksToInclude; + + /* + * License type. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private SqlServerLicenseType sqlServerLicenseType; + + /* + * A value indicating whether bulk SQL RP registration to be done. + */ + @JsonProperty(value = "performSqlBulkRegistration") + private String performSqlBulkRegistration; + + /* + * The data mover run as account Id. + */ + @JsonProperty(value = "dataMoverRunAsAccountId", required = true) + private String dataMoverRunAsAccountId; + + /* + * The snapshot run as account Id. + */ + @JsonProperty(value = "snapshotRunAsAccountId", required = true) + private String snapshotRunAsAccountId; + + /* + * The target VM name. + */ + @JsonProperty(value = "targetVmName") + private String targetVmName; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /* + * The target resource group ARM Id. + */ + @JsonProperty(value = "targetResourceGroupId", required = true) + private String targetResourceGroupId; + + /* + * The target network ARM Id. + */ + @JsonProperty(value = "targetNetworkId", required = true) + private String targetNetworkId; + + /* + * The selected test network ARM Id. + */ + @JsonProperty(value = "testNetworkId") + private String testNetworkId; + + /* + * The target subnet name. + */ + @JsonProperty(value = "targetSubnetName") + private String targetSubnetName; + + /* + * The selected test subnet name. + */ + @JsonProperty(value = "testSubnetName") + private String testSubnetName; + + /* + * The target availability set ARM Id. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target proximity placement group ARM Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The target boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId") + private String targetBootDiagnosticsStorageAccountId; + + /* + * A value indicating whether auto resync is to be done. + */ + @JsonProperty(value = "performAutoResync") + private String performAutoResync; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The tags for the seed disks. + */ + @JsonProperty(value = "seedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map seedDiskTags; + + /* + * The tags for the target disks. + */ + @JsonProperty(value = "targetDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetDiskTags; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /** Creates an instance of VMwareCbtEnableMigrationInput class. */ + public VMwareCbtEnableMigrationInput() { + } + + /** + * Get the vmwareMachineId property: The ARM Id of the VM discovered in VMware. + * + * @return the vmwareMachineId value. + */ + public String vmwareMachineId() { + return this.vmwareMachineId; + } + + /** + * Set the vmwareMachineId property: The ARM Id of the VM discovered in VMware. + * + * @param vmwareMachineId the vmwareMachineId value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withVmwareMachineId(String vmwareMachineId) { + this.vmwareMachineId = vmwareMachineId; + return this; + } + + /** + * Get the disksToInclude property: The disks to include list. + * + * @return the disksToInclude value. + */ + public List disksToInclude() { + return this.disksToInclude; + } + + /** + * Set the disksToInclude property: The disks to include list. + * + * @param disksToInclude the disksToInclude value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withDisksToInclude(List disksToInclude) { + this.disksToInclude = disksToInclude; + return this; + } + + /** + * Get the licenseType property: License type. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: License type. + * + * @param licenseType the licenseType value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public SqlServerLicenseType sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withSqlServerLicenseType(SqlServerLicenseType sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the performSqlBulkRegistration property: A value indicating whether bulk SQL RP registration to be done. + * + * @return the performSqlBulkRegistration value. + */ + public String performSqlBulkRegistration() { + return this.performSqlBulkRegistration; + } + + /** + * Set the performSqlBulkRegistration property: A value indicating whether bulk SQL RP registration to be done. + * + * @param performSqlBulkRegistration the performSqlBulkRegistration value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withPerformSqlBulkRegistration(String performSqlBulkRegistration) { + this.performSqlBulkRegistration = performSqlBulkRegistration; + return this; + } + + /** + * Get the dataMoverRunAsAccountId property: The data mover run as account Id. + * + * @return the dataMoverRunAsAccountId value. + */ + public String dataMoverRunAsAccountId() { + return this.dataMoverRunAsAccountId; + } + + /** + * Set the dataMoverRunAsAccountId property: The data mover run as account Id. + * + * @param dataMoverRunAsAccountId the dataMoverRunAsAccountId value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withDataMoverRunAsAccountId(String dataMoverRunAsAccountId) { + this.dataMoverRunAsAccountId = dataMoverRunAsAccountId; + return this; + } + + /** + * Get the snapshotRunAsAccountId property: The snapshot run as account Id. + * + * @return the snapshotRunAsAccountId value. + */ + public String snapshotRunAsAccountId() { + return this.snapshotRunAsAccountId; + } + + /** + * Set the snapshotRunAsAccountId property: The snapshot run as account Id. + * + * @param snapshotRunAsAccountId the snapshotRunAsAccountId value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withSnapshotRunAsAccountId(String snapshotRunAsAccountId) { + this.snapshotRunAsAccountId = snapshotRunAsAccountId; + return this; + } + + /** + * Get the targetVmName property: The target VM name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Set the targetVmName property: The target VM name. + * + * @param targetVmName the targetVmName value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetVmName(String targetVmName) { + this.targetVmName = targetVmName; + return this; + } + + /** + * Get the targetVmSize property: The target VM size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Set the targetVmSize property: The target VM size. + * + * @param targetVmSize the targetVmSize value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetVmSize(String targetVmSize) { + this.targetVmSize = targetVmSize; + return this; + } + + /** + * Get the targetResourceGroupId property: The target resource group ARM Id. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: The target resource group ARM Id. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the targetNetworkId property: The target network ARM Id. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: The target network ARM Id. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: The selected test network ARM Id. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: The selected test network ARM Id. + * + * @param testNetworkId the testNetworkId value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the targetSubnetName property: The target subnet name. + * + * @return the targetSubnetName value. + */ + public String targetSubnetName() { + return this.targetSubnetName; + } + + /** + * Set the targetSubnetName property: The target subnet name. + * + * @param targetSubnetName the targetSubnetName value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetSubnetName(String targetSubnetName) { + this.targetSubnetName = targetSubnetName; + return this; + } + + /** + * Get the testSubnetName property: The selected test subnet name. + * + * @return the testSubnetName value. + */ + public String testSubnetName() { + return this.testSubnetName; + } + + /** + * Set the testSubnetName property: The selected test subnet name. + * + * @param testSubnetName the testSubnetName value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTestSubnetName(String testSubnetName) { + this.testSubnetName = testSubnetName; + return this; + } + + /** + * Get the targetAvailabilitySetId property: The target availability set ARM Id. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The target availability set ARM Id. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group ARM Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group ARM Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetProximityPlacementGroupId(String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @return the targetBootDiagnosticsStorageAccountId value. + */ + public String targetBootDiagnosticsStorageAccountId() { + return this.targetBootDiagnosticsStorageAccountId; + } + + /** + * Set the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @param targetBootDiagnosticsStorageAccountId the targetBootDiagnosticsStorageAccountId value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetBootDiagnosticsStorageAccountId( + String targetBootDiagnosticsStorageAccountId) { + this.targetBootDiagnosticsStorageAccountId = targetBootDiagnosticsStorageAccountId; + return this; + } + + /** + * Get the performAutoResync property: A value indicating whether auto resync is to be done. + * + * @return the performAutoResync value. + */ + public String performAutoResync() { + return this.performAutoResync; + } + + /** + * Set the performAutoResync property: A value indicating whether auto resync is to be done. + * + * @param performAutoResync the performAutoResync value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withPerformAutoResync(String performAutoResync) { + this.performAutoResync = performAutoResync; + return this; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the seedDiskTags property: The tags for the seed disks. + * + * @return the seedDiskTags value. + */ + public Map seedDiskTags() { + return this.seedDiskTags; + } + + /** + * Set the seedDiskTags property: The tags for the seed disks. + * + * @param seedDiskTags the seedDiskTags value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withSeedDiskTags(Map seedDiskTags) { + this.seedDiskTags = seedDiskTags; + return this; + } + + /** + * Get the targetDiskTags property: The tags for the target disks. + * + * @return the targetDiskTags value. + */ + public Map targetDiskTags() { + return this.targetDiskTags; + } + + /** + * Set the targetDiskTags property: The tags for the target disks. + * + * @param targetDiskTags the targetDiskTags value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetDiskTags(Map targetDiskTags) { + this.targetDiskTags = targetDiskTags; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the VMwareCbtEnableMigrationInput object itself. + */ + public VMwareCbtEnableMigrationInput withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmwareMachineId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmwareMachineId in model VMwareCbtEnableMigrationInput")); + } + if (disksToInclude() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property disksToInclude in model VMwareCbtEnableMigrationInput")); + } else { + disksToInclude().forEach(e -> e.validate()); + } + if (dataMoverRunAsAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataMoverRunAsAccountId in model VMwareCbtEnableMigrationInput")); + } + if (snapshotRunAsAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property snapshotRunAsAccountId in model VMwareCbtEnableMigrationInput")); + } + if (targetResourceGroupId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceGroupId in model VMwareCbtEnableMigrationInput")); + } + if (targetNetworkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetNetworkId in model VMwareCbtEnableMigrationInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareCbtEnableMigrationInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtEventDetails.java new file mode 100644 index 000000000000..ad320ca4a93b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtEventDetails.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.recoveryservicessiterecovery.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; + +/** Event details for VMwareCbt provider. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Immutable +public final class VMwareCbtEventDetails extends EventProviderSpecificDetails { + /* + * The migration item name. + */ + @JsonProperty(value = "migrationItemName", access = JsonProperty.Access.WRITE_ONLY) + private String migrationItemName; + + /** Creates an instance of VMwareCbtEventDetails class. */ + public VMwareCbtEventDetails() { + } + + /** + * Get the migrationItemName property: The migration item name. + * + * @return the migrationItemName value. + */ + public String migrationItemName() { + return this.migrationItemName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrateInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrateInput.java new file mode 100644 index 000000000000..fa7bfdc745a5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrateInput.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.recoveryservicessiterecovery.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; + +/** VMwareCbt specific migrate input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtMigrateInput extends MigrateProviderSpecificInput { + /* + * A value indicating whether VM is to be shutdown. + */ + @JsonProperty(value = "performShutdown", required = true) + private String performShutdown; + + /** Creates an instance of VMwareCbtMigrateInput class. */ + public VMwareCbtMigrateInput() { + } + + /** + * Get the performShutdown property: A value indicating whether VM is to be shutdown. + * + * @return the performShutdown value. + */ + public String performShutdown() { + return this.performShutdown; + } + + /** + * Set the performShutdown property: A value indicating whether VM is to be shutdown. + * + * @param performShutdown the performShutdown value to set. + * @return the VMwareCbtMigrateInput object itself. + */ + public VMwareCbtMigrateInput withPerformShutdown(String performShutdown) { + this.performShutdown = performShutdown; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (performShutdown() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property performShutdown in model VMwareCbtMigrateInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareCbtMigrateInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrationDetails.java new file mode 100644 index 000000000000..aea6dcbca74e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrationDetails.java @@ -0,0 +1,814 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +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; +import java.util.Map; + +/** VMwareCbt provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtMigrationDetails extends MigrationProviderSpecificSettings { + /* + * The ARM Id of the VM discovered in VMware. + */ + @JsonProperty(value = "vmwareMachineId", access = JsonProperty.Access.WRITE_ONLY) + private String vmwareMachineId; + + /* + * The type of the OS on the VM. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /* + * The firmware type. + */ + @JsonProperty(value = "firmwareType", access = JsonProperty.Access.WRITE_ONLY) + private String firmwareType; + + /* + * The target generation. + */ + @JsonProperty(value = "targetGeneration", access = JsonProperty.Access.WRITE_ONLY) + private String targetGeneration; + + /* + * License Type of the VM to be used. + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private String sqlServerLicenseType; + + /* + * The data mover run as account Id. + */ + @JsonProperty(value = "dataMoverRunAsAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String dataMoverRunAsAccountId; + + /* + * The snapshot run as account Id. + */ + @JsonProperty(value = "snapshotRunAsAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String snapshotRunAsAccountId; + + /* + * The replication storage account ARM Id. This is applicable only for the blob based replication test hook. + */ + @JsonProperty(value = "storageAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountId; + + /* + * Target VM name. + */ + @JsonProperty(value = "targetVmName") + private String targetVmName; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /* + * The target location. + */ + @JsonProperty(value = "targetLocation", access = JsonProperty.Access.WRITE_ONLY) + private String targetLocation; + + /* + * The target resource group Id. + */ + @JsonProperty(value = "targetResourceGroupId") + private String targetResourceGroupId; + + /* + * The target availability set Id. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The target boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId") + private String targetBootDiagnosticsStorageAccountId; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The list of protected disks. + */ + @JsonProperty(value = "protectedDisks") + private List protectedDisks; + + /* + * The target network Id. + */ + @JsonProperty(value = "targetNetworkId") + private String targetNetworkId; + + /* + * The test network Id. + */ + @JsonProperty(value = "testNetworkId") + private String testNetworkId; + + /* + * The network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /* + * The recovery point Id to which the VM was migrated. + */ + @JsonProperty(value = "migrationRecoveryPointId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationRecoveryPointId; + + /* + * The last recovery point received time. + */ + @JsonProperty(value = "lastRecoveryPointReceived", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastRecoveryPointReceived; + + /* + * The last recovery point Id. + */ + @JsonProperty(value = "lastRecoveryPointId", access = JsonProperty.Access.WRITE_ONLY) + private String lastRecoveryPointId; + + /* + * The initial seeding progress percentage. + */ + @JsonProperty(value = "initialSeedingProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer initialSeedingProgressPercentage; + + /* + * The migration progress percentage. + */ + @JsonProperty(value = "migrationProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer migrationProgressPercentage; + + /* + * The resync progress percentage. + */ + @JsonProperty(value = "resyncProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer resyncProgressPercentage; + + /* + * The resume progress percentage. + */ + @JsonProperty(value = "resumeProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer resumeProgressPercentage; + + /* + * The initial seeding retry count. + */ + @JsonProperty(value = "initialSeedingRetryCount", access = JsonProperty.Access.WRITE_ONLY) + private Long initialSeedingRetryCount; + + /* + * The resync retry count. + */ + @JsonProperty(value = "resyncRetryCount", access = JsonProperty.Access.WRITE_ONLY) + private Long resyncRetryCount; + + /* + * The resume retry count. + */ + @JsonProperty(value = "resumeRetryCount", access = JsonProperty.Access.WRITE_ONLY) + private Long resumeRetryCount; + + /* + * A value indicating whether resync is required. + */ + @JsonProperty(value = "resyncRequired", access = JsonProperty.Access.WRITE_ONLY) + private String resyncRequired; + + /* + * The resync state. + */ + @JsonProperty(value = "resyncState", access = JsonProperty.Access.WRITE_ONLY) + private ResyncState resyncState; + + /* + * A value indicating whether auto resync is to be done. + */ + @JsonProperty(value = "performAutoResync") + private String performAutoResync; + + /* + * The tags for the seed disks. + */ + @JsonProperty(value = "seedDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map seedDiskTags; + + /* + * The tags for the target disks. + */ + @JsonProperty(value = "targetDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetDiskTags; + + /** Creates an instance of VMwareCbtMigrationDetails class. */ + public VMwareCbtMigrationDetails() { + } + + /** + * Get the vmwareMachineId property: The ARM Id of the VM discovered in VMware. + * + * @return the vmwareMachineId value. + */ + public String vmwareMachineId() { + return this.vmwareMachineId; + } + + /** + * Get the osType property: The type of the OS on the VM. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the firmwareType property: The firmware type. + * + * @return the firmwareType value. + */ + public String firmwareType() { + return this.firmwareType; + } + + /** + * Get the targetGeneration property: The target generation. + * + * @return the targetGeneration value. + */ + public String targetGeneration() { + return this.targetGeneration; + } + + /** + * Get the licenseType property: License Type of the VM to be used. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: License Type of the VM to be used. + * + * @param licenseType the licenseType value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public String sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withSqlServerLicenseType(String sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the dataMoverRunAsAccountId property: The data mover run as account Id. + * + * @return the dataMoverRunAsAccountId value. + */ + public String dataMoverRunAsAccountId() { + return this.dataMoverRunAsAccountId; + } + + /** + * Get the snapshotRunAsAccountId property: The snapshot run as account Id. + * + * @return the snapshotRunAsAccountId value. + */ + public String snapshotRunAsAccountId() { + return this.snapshotRunAsAccountId; + } + + /** + * Get the storageAccountId property: The replication storage account ARM Id. This is applicable only for the blob + * based replication test hook. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Get the targetVmName property: Target VM name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Set the targetVmName property: Target VM name. + * + * @param targetVmName the targetVmName value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetVmName(String targetVmName) { + this.targetVmName = targetVmName; + return this; + } + + /** + * Get the targetVmSize property: The target VM size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Set the targetVmSize property: The target VM size. + * + * @param targetVmSize the targetVmSize value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetVmSize(String targetVmSize) { + this.targetVmSize = targetVmSize; + return this; + } + + /** + * Get the targetLocation property: The target location. + * + * @return the targetLocation value. + */ + public String targetLocation() { + return this.targetLocation; + } + + /** + * Get the targetResourceGroupId property: The target resource group Id. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: The target resource group Id. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the targetAvailabilitySetId property: The target availability set Id. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The target availability set Id. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetProximityPlacementGroupId(String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @return the targetBootDiagnosticsStorageAccountId value. + */ + public String targetBootDiagnosticsStorageAccountId() { + return this.targetBootDiagnosticsStorageAccountId; + } + + /** + * Set the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @param targetBootDiagnosticsStorageAccountId the targetBootDiagnosticsStorageAccountId value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetBootDiagnosticsStorageAccountId( + String targetBootDiagnosticsStorageAccountId) { + this.targetBootDiagnosticsStorageAccountId = targetBootDiagnosticsStorageAccountId; + return this; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the protectedDisks property: The list of protected disks. + * + * @return the protectedDisks value. + */ + public List protectedDisks() { + return this.protectedDisks; + } + + /** + * Set the protectedDisks property: The list of protected disks. + * + * @param protectedDisks the protectedDisks value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withProtectedDisks(List protectedDisks) { + this.protectedDisks = protectedDisks; + return this; + } + + /** + * Get the targetNetworkId property: The target network Id. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: The target network Id. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: The test network Id. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: The test network Id. + * + * @param testNetworkId the testNetworkId value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the vmNics property: The network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The network details. + * + * @param vmNics the vmNics value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Get the migrationRecoveryPointId property: The recovery point Id to which the VM was migrated. + * + * @return the migrationRecoveryPointId value. + */ + public String migrationRecoveryPointId() { + return this.migrationRecoveryPointId; + } + + /** + * Get the lastRecoveryPointReceived property: The last recovery point received time. + * + * @return the lastRecoveryPointReceived value. + */ + public OffsetDateTime lastRecoveryPointReceived() { + return this.lastRecoveryPointReceived; + } + + /** + * Get the lastRecoveryPointId property: The last recovery point Id. + * + * @return the lastRecoveryPointId value. + */ + public String lastRecoveryPointId() { + return this.lastRecoveryPointId; + } + + /** + * Get the initialSeedingProgressPercentage property: The initial seeding progress percentage. + * + * @return the initialSeedingProgressPercentage value. + */ + public Integer initialSeedingProgressPercentage() { + return this.initialSeedingProgressPercentage; + } + + /** + * Get the migrationProgressPercentage property: The migration progress percentage. + * + * @return the migrationProgressPercentage value. + */ + public Integer migrationProgressPercentage() { + return this.migrationProgressPercentage; + } + + /** + * Get the resyncProgressPercentage property: The resync progress percentage. + * + * @return the resyncProgressPercentage value. + */ + public Integer resyncProgressPercentage() { + return this.resyncProgressPercentage; + } + + /** + * Get the resumeProgressPercentage property: The resume progress percentage. + * + * @return the resumeProgressPercentage value. + */ + public Integer resumeProgressPercentage() { + return this.resumeProgressPercentage; + } + + /** + * Get the initialSeedingRetryCount property: The initial seeding retry count. + * + * @return the initialSeedingRetryCount value. + */ + public Long initialSeedingRetryCount() { + return this.initialSeedingRetryCount; + } + + /** + * Get the resyncRetryCount property: The resync retry count. + * + * @return the resyncRetryCount value. + */ + public Long resyncRetryCount() { + return this.resyncRetryCount; + } + + /** + * Get the resumeRetryCount property: The resume retry count. + * + * @return the resumeRetryCount value. + */ + public Long resumeRetryCount() { + return this.resumeRetryCount; + } + + /** + * Get the resyncRequired property: A value indicating whether resync is required. + * + * @return the resyncRequired value. + */ + public String resyncRequired() { + return this.resyncRequired; + } + + /** + * Get the resyncState property: The resync state. + * + * @return the resyncState value. + */ + public ResyncState resyncState() { + return this.resyncState; + } + + /** + * Get the performAutoResync property: A value indicating whether auto resync is to be done. + * + * @return the performAutoResync value. + */ + public String performAutoResync() { + return this.performAutoResync; + } + + /** + * Set the performAutoResync property: A value indicating whether auto resync is to be done. + * + * @param performAutoResync the performAutoResync value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withPerformAutoResync(String performAutoResync) { + this.performAutoResync = performAutoResync; + return this; + } + + /** + * Get the seedDiskTags property: The tags for the seed disks. + * + * @return the seedDiskTags value. + */ + public Map seedDiskTags() { + return this.seedDiskTags; + } + + /** + * Set the seedDiskTags property: The tags for the seed disks. + * + * @param seedDiskTags the seedDiskTags value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withSeedDiskTags(Map seedDiskTags) { + this.seedDiskTags = seedDiskTags; + return this; + } + + /** + * Get the targetDiskTags property: The tags for the target disks. + * + * @return the targetDiskTags value. + */ + public Map targetDiskTags() { + return this.targetDiskTags; + } + + /** + * Set the targetDiskTags property: The tags for the target disks. + * + * @param targetDiskTags the targetDiskTags value to set. + * @return the VMwareCbtMigrationDetails object itself. + */ + public VMwareCbtMigrationDetails withTargetDiskTags(Map targetDiskTags) { + this.targetDiskTags = targetDiskTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protectedDisks() != null) { + protectedDisks().forEach(e -> e.validate()); + } + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicDetails.java new file mode 100644 index 000000000000..37bf6ae3619c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicDetails.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareCbt NIC details. */ +@Fluent +public final class VMwareCbtNicDetails { + /* + * The NIC Id. + */ + @JsonProperty(value = "nicId", access = JsonProperty.Access.WRITE_ONLY) + private String nicId; + + /* + * A value indicating whether this is the primary NIC. + */ + @JsonProperty(value = "isPrimaryNic") + private String isPrimaryNic; + + /* + * The source IP address. + */ + @JsonProperty(value = "sourceIPAddress", access = JsonProperty.Access.WRITE_ONLY) + private String sourceIpAddress; + + /* + * The source IP address type. + */ + @JsonProperty(value = "sourceIPAddressType", access = JsonProperty.Access.WRITE_ONLY) + private EthernetAddressType sourceIpAddressType; + + /* + * Source network Id. + */ + @JsonProperty(value = "sourceNetworkId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceNetworkId; + + /* + * The target IP address. + */ + @JsonProperty(value = "targetIPAddress") + private String targetIpAddress; + + /* + * The target IP address type. + */ + @JsonProperty(value = "targetIPAddressType") + private EthernetAddressType targetIpAddressType; + + /* + * Target subnet name. + */ + @JsonProperty(value = "targetSubnetName") + private String targetSubnetName; + + /* + * Source network Id. + */ + @JsonProperty(value = "testNetworkId") + private String testNetworkId; + + /* + * Test subnet name. + */ + @JsonProperty(value = "testSubnetName") + private String testSubnetName; + + /* + * The test IP address. + */ + @JsonProperty(value = "testIPAddress") + private String testIpAddress; + + /* + * The test IP address type. + */ + @JsonProperty(value = "testIPAddressType") + private EthernetAddressType testIpAddressType; + + /* + * Target NIC name. + */ + @JsonProperty(value = "targetNicName") + private String targetNicName; + + /* + * A value indicating whether this NIC is selected for migration. + */ + @JsonProperty(value = "isSelectedForMigration") + private String isSelectedForMigration; + + /** Creates an instance of VMwareCbtNicDetails class. */ + public VMwareCbtNicDetails() { + } + + /** + * Get the nicId property: The NIC Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Get the isPrimaryNic property: A value indicating whether this is the primary NIC. + * + * @return the isPrimaryNic value. + */ + public String isPrimaryNic() { + return this.isPrimaryNic; + } + + /** + * Set the isPrimaryNic property: A value indicating whether this is the primary NIC. + * + * @param isPrimaryNic the isPrimaryNic value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withIsPrimaryNic(String isPrimaryNic) { + this.isPrimaryNic = isPrimaryNic; + return this; + } + + /** + * Get the sourceIpAddress property: The source IP address. + * + * @return the sourceIpAddress value. + */ + public String sourceIpAddress() { + return this.sourceIpAddress; + } + + /** + * Get the sourceIpAddressType property: The source IP address type. + * + * @return the sourceIpAddressType value. + */ + public EthernetAddressType sourceIpAddressType() { + return this.sourceIpAddressType; + } + + /** + * Get the sourceNetworkId property: Source network Id. + * + * @return the sourceNetworkId value. + */ + public String sourceNetworkId() { + return this.sourceNetworkId; + } + + /** + * Get the targetIpAddress property: The target IP address. + * + * @return the targetIpAddress value. + */ + public String targetIpAddress() { + return this.targetIpAddress; + } + + /** + * Set the targetIpAddress property: The target IP address. + * + * @param targetIpAddress the targetIpAddress value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withTargetIpAddress(String targetIpAddress) { + this.targetIpAddress = targetIpAddress; + return this; + } + + /** + * Get the targetIpAddressType property: The target IP address type. + * + * @return the targetIpAddressType value. + */ + public EthernetAddressType targetIpAddressType() { + return this.targetIpAddressType; + } + + /** + * Set the targetIpAddressType property: The target IP address type. + * + * @param targetIpAddressType the targetIpAddressType value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withTargetIpAddressType(EthernetAddressType targetIpAddressType) { + this.targetIpAddressType = targetIpAddressType; + return this; + } + + /** + * Get the targetSubnetName property: Target subnet name. + * + * @return the targetSubnetName value. + */ + public String targetSubnetName() { + return this.targetSubnetName; + } + + /** + * Set the targetSubnetName property: Target subnet name. + * + * @param targetSubnetName the targetSubnetName value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withTargetSubnetName(String targetSubnetName) { + this.targetSubnetName = targetSubnetName; + return this; + } + + /** + * Get the testNetworkId property: Source network Id. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: Source network Id. + * + * @param testNetworkId the testNetworkId value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the testSubnetName property: Test subnet name. + * + * @return the testSubnetName value. + */ + public String testSubnetName() { + return this.testSubnetName; + } + + /** + * Set the testSubnetName property: Test subnet name. + * + * @param testSubnetName the testSubnetName value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withTestSubnetName(String testSubnetName) { + this.testSubnetName = testSubnetName; + return this; + } + + /** + * Get the testIpAddress property: The test IP address. + * + * @return the testIpAddress value. + */ + public String testIpAddress() { + return this.testIpAddress; + } + + /** + * Set the testIpAddress property: The test IP address. + * + * @param testIpAddress the testIpAddress value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withTestIpAddress(String testIpAddress) { + this.testIpAddress = testIpAddress; + return this; + } + + /** + * Get the testIpAddressType property: The test IP address type. + * + * @return the testIpAddressType value. + */ + public EthernetAddressType testIpAddressType() { + return this.testIpAddressType; + } + + /** + * Set the testIpAddressType property: The test IP address type. + * + * @param testIpAddressType the testIpAddressType value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withTestIpAddressType(EthernetAddressType testIpAddressType) { + this.testIpAddressType = testIpAddressType; + return this; + } + + /** + * Get the targetNicName property: Target NIC name. + * + * @return the targetNicName value. + */ + public String targetNicName() { + return this.targetNicName; + } + + /** + * Set the targetNicName property: Target NIC name. + * + * @param targetNicName the targetNicName value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withTargetNicName(String targetNicName) { + this.targetNicName = targetNicName; + return this; + } + + /** + * Get the isSelectedForMigration property: A value indicating whether this NIC is selected for migration. + * + * @return the isSelectedForMigration value. + */ + public String isSelectedForMigration() { + return this.isSelectedForMigration; + } + + /** + * Set the isSelectedForMigration property: A value indicating whether this NIC is selected for migration. + * + * @param isSelectedForMigration the isSelectedForMigration value to set. + * @return the VMwareCbtNicDetails object itself. + */ + public VMwareCbtNicDetails withIsSelectedForMigration(String isSelectedForMigration) { + this.isSelectedForMigration = isSelectedForMigration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicInput.java new file mode 100644 index 000000000000..21a5f6fa3eab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicInput.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareCbt NIC input. */ +@Fluent +public final class VMwareCbtNicInput { + /* + * The NIC Id. + */ + @JsonProperty(value = "nicId", required = true) + private String nicId; + + /* + * A value indicating whether this is the primary NIC. + */ + @JsonProperty(value = "isPrimaryNic", required = true) + private String isPrimaryNic; + + /* + * Target subnet name. + */ + @JsonProperty(value = "targetSubnetName") + private String targetSubnetName; + + /* + * The static IP address. + */ + @JsonProperty(value = "targetStaticIPAddress") + private String targetStaticIpAddress; + + /* + * A value indicating whether this NIC is selected for migration. + */ + @JsonProperty(value = "isSelectedForMigration") + private String isSelectedForMigration; + + /* + * Target NIC name. + */ + @JsonProperty(value = "targetNicName") + private String targetNicName; + + /* + * The test subnet name. + */ + @JsonProperty(value = "testSubnetName") + private String testSubnetName; + + /* + * The test static IP address. + */ + @JsonProperty(value = "testStaticIPAddress") + private String testStaticIpAddress; + + /** Creates an instance of VMwareCbtNicInput class. */ + public VMwareCbtNicInput() { + } + + /** + * Get the nicId property: The NIC Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Set the nicId property: The NIC Id. + * + * @param nicId the nicId value to set. + * @return the VMwareCbtNicInput object itself. + */ + public VMwareCbtNicInput withNicId(String nicId) { + this.nicId = nicId; + return this; + } + + /** + * Get the isPrimaryNic property: A value indicating whether this is the primary NIC. + * + * @return the isPrimaryNic value. + */ + public String isPrimaryNic() { + return this.isPrimaryNic; + } + + /** + * Set the isPrimaryNic property: A value indicating whether this is the primary NIC. + * + * @param isPrimaryNic the isPrimaryNic value to set. + * @return the VMwareCbtNicInput object itself. + */ + public VMwareCbtNicInput withIsPrimaryNic(String isPrimaryNic) { + this.isPrimaryNic = isPrimaryNic; + return this; + } + + /** + * Get the targetSubnetName property: Target subnet name. + * + * @return the targetSubnetName value. + */ + public String targetSubnetName() { + return this.targetSubnetName; + } + + /** + * Set the targetSubnetName property: Target subnet name. + * + * @param targetSubnetName the targetSubnetName value to set. + * @return the VMwareCbtNicInput object itself. + */ + public VMwareCbtNicInput withTargetSubnetName(String targetSubnetName) { + this.targetSubnetName = targetSubnetName; + return this; + } + + /** + * Get the targetStaticIpAddress property: The static IP address. + * + * @return the targetStaticIpAddress value. + */ + public String targetStaticIpAddress() { + return this.targetStaticIpAddress; + } + + /** + * Set the targetStaticIpAddress property: The static IP address. + * + * @param targetStaticIpAddress the targetStaticIpAddress value to set. + * @return the VMwareCbtNicInput object itself. + */ + public VMwareCbtNicInput withTargetStaticIpAddress(String targetStaticIpAddress) { + this.targetStaticIpAddress = targetStaticIpAddress; + return this; + } + + /** + * Get the isSelectedForMigration property: A value indicating whether this NIC is selected for migration. + * + * @return the isSelectedForMigration value. + */ + public String isSelectedForMigration() { + return this.isSelectedForMigration; + } + + /** + * Set the isSelectedForMigration property: A value indicating whether this NIC is selected for migration. + * + * @param isSelectedForMigration the isSelectedForMigration value to set. + * @return the VMwareCbtNicInput object itself. + */ + public VMwareCbtNicInput withIsSelectedForMigration(String isSelectedForMigration) { + this.isSelectedForMigration = isSelectedForMigration; + return this; + } + + /** + * Get the targetNicName property: Target NIC name. + * + * @return the targetNicName value. + */ + public String targetNicName() { + return this.targetNicName; + } + + /** + * Set the targetNicName property: Target NIC name. + * + * @param targetNicName the targetNicName value to set. + * @return the VMwareCbtNicInput object itself. + */ + public VMwareCbtNicInput withTargetNicName(String targetNicName) { + this.targetNicName = targetNicName; + return this; + } + + /** + * Get the testSubnetName property: The test subnet name. + * + * @return the testSubnetName value. + */ + public String testSubnetName() { + return this.testSubnetName; + } + + /** + * Set the testSubnetName property: The test subnet name. + * + * @param testSubnetName the testSubnetName value to set. + * @return the VMwareCbtNicInput object itself. + */ + public VMwareCbtNicInput withTestSubnetName(String testSubnetName) { + this.testSubnetName = testSubnetName; + return this; + } + + /** + * Get the testStaticIpAddress property: The test static IP address. + * + * @return the testStaticIpAddress value. + */ + public String testStaticIpAddress() { + return this.testStaticIpAddress; + } + + /** + * Set the testStaticIpAddress property: The test static IP address. + * + * @param testStaticIpAddress the testStaticIpAddress value to set. + * @return the VMwareCbtNicInput object itself. + */ + public VMwareCbtNicInput withTestStaticIpAddress(String testStaticIpAddress) { + this.testStaticIpAddress = testStaticIpAddress; + 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 VMwareCbtNicInput")); + } + if (isPrimaryNic() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property isPrimaryNic in model VMwareCbtNicInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareCbtNicInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtPolicyCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtPolicyCreationInput.java new file mode 100644 index 000000000000..107e3203ab26 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtPolicyCreationInput.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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 Cbt policy creation input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtPolicyCreationInput extends PolicyProviderSpecificInput { + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistoryInMinutes") + private Integer recoveryPointHistoryInMinutes; + + /* + * The crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /* + * The app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /** Creates an instance of VMwareCbtPolicyCreationInput class. */ + public VMwareCbtPolicyCreationInput() { + } + + /** + * Get the recoveryPointHistoryInMinutes property: The duration in minutes until which the recovery points need to + * be stored. + * + * @return the recoveryPointHistoryInMinutes value. + */ + public Integer recoveryPointHistoryInMinutes() { + return this.recoveryPointHistoryInMinutes; + } + + /** + * Set the recoveryPointHistoryInMinutes property: The duration in minutes until which the recovery points need to + * be stored. + * + * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. + * @return the VMwareCbtPolicyCreationInput object itself. + */ + public VMwareCbtPolicyCreationInput withRecoveryPointHistoryInMinutes(Integer recoveryPointHistoryInMinutes) { + this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency (in minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the VMwareCbtPolicyCreationInput object itself. + */ + public VMwareCbtPolicyCreationInput withCrashConsistentFrequencyInMinutes( + Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency (in minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the VMwareCbtPolicyCreationInput object itself. + */ + public VMwareCbtPolicyCreationInput withAppConsistentFrequencyInMinutes(Integer 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectedDiskDetails.java new file mode 100644 index 000000000000..5a28e520637f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectedDiskDetails.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareCbt protected disk details. */ +@Fluent +public final class VMwareCbtProtectedDiskDetails { + /* + * The disk id. + */ + @JsonProperty(value = "diskId", access = JsonProperty.Access.WRITE_ONLY) + private String diskId; + + /* + * The disk name. + */ + @JsonProperty(value = "diskName", access = JsonProperty.Access.WRITE_ONLY) + private String diskName; + + /* + * The disk type. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /* + * The disk path. + */ + @JsonProperty(value = "diskPath", access = JsonProperty.Access.WRITE_ONLY) + private String diskPath; + + /* + * A value indicating whether the disk is the OS disk. + */ + @JsonProperty(value = "isOSDisk", access = JsonProperty.Access.WRITE_ONLY) + private String isOSDisk; + + /* + * The disk capacity in bytes. + */ + @JsonProperty(value = "capacityInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityInBytes; + + /* + * The log storage account ARM Id. + */ + @JsonProperty(value = "logStorageAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String logStorageAccountId; + + /* + * The key vault secret name of the log storage account. + */ + @JsonProperty(value = "logStorageAccountSasSecretName", access = JsonProperty.Access.WRITE_ONLY) + private String logStorageAccountSasSecretName; + + /* + * The DiskEncryptionSet ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId", access = JsonProperty.Access.WRITE_ONLY) + private String diskEncryptionSetId; + + /* + * The ARM Id of the seed managed disk. + */ + @JsonProperty(value = "seedManagedDiskId", access = JsonProperty.Access.WRITE_ONLY) + private String seedManagedDiskId; + + /* + * The uri of the seed blob. + */ + @JsonProperty(value = "seedBlobUri", access = JsonProperty.Access.WRITE_ONLY) + private String seedBlobUri; + + /* + * The ARM Id of the target managed disk. + */ + @JsonProperty(value = "targetManagedDiskId", access = JsonProperty.Access.WRITE_ONLY) + private String targetManagedDiskId; + + /* + * The uri of the target blob. + */ + @JsonProperty(value = "targetBlobUri", access = JsonProperty.Access.WRITE_ONLY) + private String targetBlobUri; + + /* + * The name for the target managed disk. + */ + @JsonProperty(value = "targetDiskName") + private String targetDiskName; + + /** Creates an instance of VMwareCbtProtectedDiskDetails class. */ + public VMwareCbtProtectedDiskDetails() { + } + + /** + * Get the diskId property: The disk id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Get the diskName property: The disk name. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Get the diskType property: The disk type. + * + * @return the diskType value. + */ + public DiskAccountType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The disk type. + * + * @param diskType the diskType value to set. + * @return the VMwareCbtProtectedDiskDetails object itself. + */ + public VMwareCbtProtectedDiskDetails withDiskType(DiskAccountType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the diskPath property: The disk path. + * + * @return the diskPath value. + */ + public String diskPath() { + return this.diskPath; + } + + /** + * Get the isOSDisk property: A value indicating whether the disk is the OS disk. + * + * @return the isOSDisk value. + */ + public String isOSDisk() { + return this.isOSDisk; + } + + /** + * Get the capacityInBytes property: The disk capacity in bytes. + * + * @return the capacityInBytes value. + */ + public Long capacityInBytes() { + return this.capacityInBytes; + } + + /** + * Get the logStorageAccountId property: The log storage account ARM Id. + * + * @return the logStorageAccountId value. + */ + public String logStorageAccountId() { + return this.logStorageAccountId; + } + + /** + * Get the logStorageAccountSasSecretName property: The key vault secret name of the log storage account. + * + * @return the logStorageAccountSasSecretName value. + */ + public String logStorageAccountSasSecretName() { + return this.logStorageAccountSasSecretName; + } + + /** + * Get the diskEncryptionSetId property: The DiskEncryptionSet ARM Id. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Get the seedManagedDiskId property: The ARM Id of the seed managed disk. + * + * @return the seedManagedDiskId value. + */ + public String seedManagedDiskId() { + return this.seedManagedDiskId; + } + + /** + * Get the seedBlobUri property: The uri of the seed blob. + * + * @return the seedBlobUri value. + */ + public String seedBlobUri() { + return this.seedBlobUri; + } + + /** + * Get the targetManagedDiskId property: The ARM Id of the target managed disk. + * + * @return the targetManagedDiskId value. + */ + public String targetManagedDiskId() { + return this.targetManagedDiskId; + } + + /** + * Get the targetBlobUri property: The uri of the target blob. + * + * @return the targetBlobUri value. + */ + public String targetBlobUri() { + return this.targetBlobUri; + } + + /** + * Get the targetDiskName property: The name for the target managed disk. + * + * @return the targetDiskName value. + */ + public String targetDiskName() { + return this.targetDiskName; + } + + /** + * Set the targetDiskName property: The name for the target managed disk. + * + * @param targetDiskName the targetDiskName value to set. + * @return the VMwareCbtProtectedDiskDetails object itself. + */ + public VMwareCbtProtectedDiskDetails withTargetDiskName(String targetDiskName) { + this.targetDiskName = targetDiskName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectionContainerMappingDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectionContainerMappingDetails.java new file mode 100644 index 000000000000..eabd230de645 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectionContainerMappingDetails.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** VMwareCbt provider specific container mapping details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Immutable +public final class VMwareCbtProtectionContainerMappingDetails + extends ProtectionContainerMappingProviderSpecificDetails { + /* + * The target key vault ARM Id. + */ + @JsonProperty(value = "keyVaultId", access = JsonProperty.Access.WRITE_ONLY) + private String keyVaultId; + + /* + * The target key vault URI. + */ + @JsonProperty(value = "keyVaultUri", access = JsonProperty.Access.WRITE_ONLY) + private String keyVaultUri; + + /* + * The storage account ARM Id. + */ + @JsonProperty(value = "storageAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountId; + + /* + * The secret name of the storage account. + */ + @JsonProperty(value = "storageAccountSasSecretName", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountSasSecretName; + + /* + * The secret name of the service bus connection string. + */ + @JsonProperty(value = "serviceBusConnectionStringSecretName", access = JsonProperty.Access.WRITE_ONLY) + private String serviceBusConnectionStringSecretName; + + /* + * The target location. + */ + @JsonProperty(value = "targetLocation", access = JsonProperty.Access.WRITE_ONLY) + private String targetLocation; + + /* + * The role size to NIC count map. + */ + @JsonProperty(value = "roleSizeToNicCountMap", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map roleSizeToNicCountMap; + + /** Creates an instance of VMwareCbtProtectionContainerMappingDetails class. */ + public VMwareCbtProtectionContainerMappingDetails() { + } + + /** + * Get the keyVaultId property: The target key vault ARM Id. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Get the keyVaultUri property: The target key vault URI. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Get the storageAccountId property: The storage account ARM Id. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Get the storageAccountSasSecretName property: The secret name of the storage account. + * + * @return the storageAccountSasSecretName value. + */ + public String storageAccountSasSecretName() { + return this.storageAccountSasSecretName; + } + + /** + * Get the serviceBusConnectionStringSecretName property: The secret name of the service bus connection string. + * + * @return the serviceBusConnectionStringSecretName value. + */ + public String serviceBusConnectionStringSecretName() { + return this.serviceBusConnectionStringSecretName; + } + + /** + * Get the targetLocation property: The target location. + * + * @return the targetLocation value. + */ + public String targetLocation() { + return this.targetLocation; + } + + /** + * Get the roleSizeToNicCountMap property: The role size to NIC count map. + * + * @return the roleSizeToNicCountMap value. + */ + public Map roleSizeToNicCountMap() { + return this.roleSizeToNicCountMap; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtResumeReplicationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtResumeReplicationInput.java new file mode 100644 index 000000000000..76459774d1e7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtResumeReplicationInput.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.recoveryservicessiterecovery.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; + +/** VMwareCbt specific resume replication input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtResumeReplicationInput extends ResumeReplicationProviderSpecificInput { + /* + * A value indicating whether Migration resources to be deleted. + */ + @JsonProperty(value = "deleteMigrationResources") + private String deleteMigrationResources; + + /** Creates an instance of VMwareCbtResumeReplicationInput class. */ + public VMwareCbtResumeReplicationInput() { + } + + /** + * Get the deleteMigrationResources property: A value indicating whether Migration resources to be deleted. + * + * @return the deleteMigrationResources value. + */ + public String deleteMigrationResources() { + return this.deleteMigrationResources; + } + + /** + * Set the deleteMigrationResources property: A value indicating whether Migration resources to be deleted. + * + * @param deleteMigrationResources the deleteMigrationResources value to set. + * @return the VMwareCbtResumeReplicationInput object itself. + */ + public VMwareCbtResumeReplicationInput withDeleteMigrationResources(String deleteMigrationResources) { + this.deleteMigrationResources = deleteMigrationResources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtResyncInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtResyncInput.java new file mode 100644 index 000000000000..c3e007ca17e0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtResyncInput.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.recoveryservicessiterecovery.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; + +/** VMwareCbt specific resync input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtResyncInput extends ResyncProviderSpecificInput { + /* + * A value indicating whether CBT is to be reset. + */ + @JsonProperty(value = "skipCbtReset", required = true) + private String skipCbtReset; + + /** Creates an instance of VMwareCbtResyncInput class. */ + public VMwareCbtResyncInput() { + } + + /** + * Get the skipCbtReset property: A value indicating whether CBT is to be reset. + * + * @return the skipCbtReset value. + */ + public String skipCbtReset() { + return this.skipCbtReset; + } + + /** + * Set the skipCbtReset property: A value indicating whether CBT is to be reset. + * + * @param skipCbtReset the skipCbtReset value to set. + * @return the VMwareCbtResyncInput object itself. + */ + public VMwareCbtResyncInput withSkipCbtReset(String skipCbtReset) { + this.skipCbtReset = skipCbtReset; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (skipCbtReset() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property skipCbtReset in model VMwareCbtResyncInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareCbtResyncInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtTestMigrateInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtTestMigrateInput.java new file mode 100644 index 000000000000..a20f4a564195 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtTestMigrateInput.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.recoveryservicessiterecovery.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; + +/** VMwareCbt specific test migrate input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtTestMigrateInput extends TestMigrateProviderSpecificInput { + /* + * The recovery point Id. + */ + @JsonProperty(value = "recoveryPointId", required = true) + private String recoveryPointId; + + /* + * The test network Id. + */ + @JsonProperty(value = "networkId", required = true) + private String networkId; + + /* + * The list of NIC details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /** Creates an instance of VMwareCbtTestMigrateInput class. */ + public VMwareCbtTestMigrateInput() { + } + + /** + * Get the recoveryPointId property: The recovery point Id. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: The recovery point Id. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the VMwareCbtTestMigrateInput object itself. + */ + public VMwareCbtTestMigrateInput withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the networkId property: The test network Id. + * + * @return the networkId value. + */ + public String networkId() { + return this.networkId; + } + + /** + * Set the networkId property: The test network Id. + * + * @param networkId the networkId value to set. + * @return the VMwareCbtTestMigrateInput object itself. + */ + public VMwareCbtTestMigrateInput withNetworkId(String networkId) { + this.networkId = networkId; + return this; + } + + /** + * Get the vmNics property: The list of NIC details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The list of NIC details. + * + * @param vmNics the vmNics value to set. + * @return the VMwareCbtTestMigrateInput object itself. + */ + public VMwareCbtTestMigrateInput withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointId in model VMwareCbtTestMigrateInput")); + } + if (networkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkId in model VMwareCbtTestMigrateInput")); + } + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareCbtTestMigrateInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtUpdateDiskInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtUpdateDiskInput.java new file mode 100644 index 000000000000..66e9f9c6b969 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtUpdateDiskInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareCbt disk input for update. */ +@Fluent +public final class VMwareCbtUpdateDiskInput { + /* + * The disk Id. + */ + @JsonProperty(value = "diskId", required = true) + private String diskId; + + /* + * The target disk name. + */ + @JsonProperty(value = "targetDiskName") + private String targetDiskName; + + /* + * A value indicating whether the disk is the OS disk. + */ + @JsonProperty(value = "isOSDisk") + private String isOSDisk; + + /** Creates an instance of VMwareCbtUpdateDiskInput class. */ + public VMwareCbtUpdateDiskInput() { + } + + /** + * Get the diskId property: The disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: The disk Id. + * + * @param diskId the diskId value to set. + * @return the VMwareCbtUpdateDiskInput object itself. + */ + public VMwareCbtUpdateDiskInput withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the targetDiskName property: The target disk name. + * + * @return the targetDiskName value. + */ + public String targetDiskName() { + return this.targetDiskName; + } + + /** + * Set the targetDiskName property: The target disk name. + * + * @param targetDiskName the targetDiskName value to set. + * @return the VMwareCbtUpdateDiskInput object itself. + */ + public VMwareCbtUpdateDiskInput withTargetDiskName(String targetDiskName) { + this.targetDiskName = targetDiskName; + return this; + } + + /** + * Get the isOSDisk property: A value indicating whether the disk is the OS disk. + * + * @return the isOSDisk value. + */ + public String isOSDisk() { + return this.isOSDisk; + } + + /** + * Set the isOSDisk property: A value indicating whether the disk is the OS disk. + * + * @param isOSDisk the isOSDisk value to set. + * @return the VMwareCbtUpdateDiskInput object itself. + */ + public VMwareCbtUpdateDiskInput withIsOSDisk(String 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 VMwareCbtUpdateDiskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareCbtUpdateDiskInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtUpdateMigrationItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtUpdateMigrationItemInput.java new file mode 100644 index 000000000000..e338c62e659a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtUpdateMigrationItemInput.java @@ -0,0 +1,486 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** VMwareCbt specific update migration item input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtUpdateMigrationItemInput extends UpdateMigrationItemProviderSpecificInput { + /* + * The target VM name. + */ + @JsonProperty(value = "targetVmName") + private String targetVmName; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /* + * The target resource group ARM Id. + */ + @JsonProperty(value = "targetResourceGroupId") + private String targetResourceGroupId; + + /* + * The target availability set ARM Id. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The target proximity placement group ARM Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The target boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId") + private String targetBootDiagnosticsStorageAccountId; + + /* + * The target network ARM Id. + */ + @JsonProperty(value = "targetNetworkId") + private String targetNetworkId; + + /* + * The test network ARM Id. + */ + @JsonProperty(value = "testNetworkId") + private String testNetworkId; + + /* + * The list of NIC details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The list of disk update properties. + */ + @JsonProperty(value = "vmDisks") + private List vmDisks; + + /* + * The license type. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /* + * The SQL Server license type. + */ + @JsonProperty(value = "sqlServerLicenseType") + private SqlServerLicenseType sqlServerLicenseType; + + /* + * A value indicating whether auto resync is to be done. + */ + @JsonProperty(value = "performAutoResync") + private String performAutoResync; + + /* + * The target VM tags. + */ + @JsonProperty(value = "targetVmTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetVmTags; + + /* + * The tags for the target disks. + */ + @JsonProperty(value = "targetDiskTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetDiskTags; + + /* + * The tags for the target NICs. + */ + @JsonProperty(value = "targetNicTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetNicTags; + + /** Creates an instance of VMwareCbtUpdateMigrationItemInput class. */ + public VMwareCbtUpdateMigrationItemInput() { + } + + /** + * Get the targetVmName property: The target VM name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Set the targetVmName property: The target VM name. + * + * @param targetVmName the targetVmName value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetVmName(String targetVmName) { + this.targetVmName = targetVmName; + return this; + } + + /** + * Get the targetVmSize property: The target VM size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Set the targetVmSize property: The target VM size. + * + * @param targetVmSize the targetVmSize value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetVmSize(String targetVmSize) { + this.targetVmSize = targetVmSize; + return this; + } + + /** + * Get the targetResourceGroupId property: The target resource group ARM Id. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: The target resource group ARM Id. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the targetAvailabilitySetId property: The target availability set ARM Id. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The target availability set ARM Id. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + return this; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: The target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetAvailabilityZone(String targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group ARM Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Set the targetProximityPlacementGroupId property: The target proximity placement group ARM Id. + * + * @param targetProximityPlacementGroupId the targetProximityPlacementGroupId value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetProximityPlacementGroupId( + String targetProximityPlacementGroupId) { + this.targetProximityPlacementGroupId = targetProximityPlacementGroupId; + return this; + } + + /** + * Get the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @return the targetBootDiagnosticsStorageAccountId value. + */ + public String targetBootDiagnosticsStorageAccountId() { + return this.targetBootDiagnosticsStorageAccountId; + } + + /** + * Set the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @param targetBootDiagnosticsStorageAccountId the targetBootDiagnosticsStorageAccountId value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetBootDiagnosticsStorageAccountId( + String targetBootDiagnosticsStorageAccountId) { + this.targetBootDiagnosticsStorageAccountId = targetBootDiagnosticsStorageAccountId; + return this; + } + + /** + * Get the targetNetworkId property: The target network ARM Id. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: The target network ARM Id. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: The test network ARM Id. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: The test network ARM Id. + * + * @param testNetworkId the testNetworkId value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the vmNics property: The list of NIC details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * Set the vmNics property: The list of NIC details. + * + * @param vmNics the vmNics value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withVmNics(List vmNics) { + this.vmNics = vmNics; + return this; + } + + /** + * Get the vmDisks property: The list of disk update properties. + * + * @return the vmDisks value. + */ + public List vmDisks() { + return this.vmDisks; + } + + /** + * Set the vmDisks property: The list of disk update properties. + * + * @param vmDisks the vmDisks value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withVmDisks(List vmDisks) { + this.vmDisks = vmDisks; + return this; + } + + /** + * Get the licenseType property: The license type. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The license type. + * + * @param licenseType the licenseType value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the sqlServerLicenseType property: The SQL Server license type. + * + * @return the sqlServerLicenseType value. + */ + public SqlServerLicenseType sqlServerLicenseType() { + return this.sqlServerLicenseType; + } + + /** + * Set the sqlServerLicenseType property: The SQL Server license type. + * + * @param sqlServerLicenseType the sqlServerLicenseType value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withSqlServerLicenseType(SqlServerLicenseType sqlServerLicenseType) { + this.sqlServerLicenseType = sqlServerLicenseType; + return this; + } + + /** + * Get the performAutoResync property: A value indicating whether auto resync is to be done. + * + * @return the performAutoResync value. + */ + public String performAutoResync() { + return this.performAutoResync; + } + + /** + * Set the performAutoResync property: A value indicating whether auto resync is to be done. + * + * @param performAutoResync the performAutoResync value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withPerformAutoResync(String performAutoResync) { + this.performAutoResync = performAutoResync; + return this; + } + + /** + * Get the targetVmTags property: The target VM tags. + * + * @return the targetVmTags value. + */ + public Map targetVmTags() { + return this.targetVmTags; + } + + /** + * Set the targetVmTags property: The target VM tags. + * + * @param targetVmTags the targetVmTags value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetVmTags(Map targetVmTags) { + this.targetVmTags = targetVmTags; + return this; + } + + /** + * Get the targetDiskTags property: The tags for the target disks. + * + * @return the targetDiskTags value. + */ + public Map targetDiskTags() { + return this.targetDiskTags; + } + + /** + * Set the targetDiskTags property: The tags for the target disks. + * + * @param targetDiskTags the targetDiskTags value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetDiskTags(Map targetDiskTags) { + this.targetDiskTags = targetDiskTags; + return this; + } + + /** + * Get the targetNicTags property: The tags for the target NICs. + * + * @return the targetNicTags value. + */ + public Map targetNicTags() { + return this.targetNicTags; + } + + /** + * Set the targetNicTags property: The tags for the target NICs. + * + * @param targetNicTags the targetNicTags value to set. + * @return the VMwareCbtUpdateMigrationItemInput object itself. + */ + public VMwareCbtUpdateMigrationItemInput withTargetNicTags(Map targetNicTags) { + this.targetNicTags = targetNicTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmNics() != null) { + vmNics().forEach(e -> e.validate()); + } + if (vmDisks() != null) { + vmDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareDetails.java new file mode 100644 index 000000000000..a2c37993d73f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareDetails.java @@ -0,0 +1,906 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.time.OffsetDateTime; +import java.util.List; + +/** Store the fabric details specific to the VMware fabric. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMware") +@Fluent +public final class VMwareDetails extends FabricSpecificDetails { + /* + * The list of Process Servers associated with the fabric. + */ + @JsonProperty(value = "processServers") + private List processServers; + + /* + * The list of Master Target servers associated with the fabric. + */ + @JsonProperty(value = "masterTargetServers") + private List masterTargetServers; + + /* + * The list of run as accounts created on the server. + */ + @JsonProperty(value = "runAsAccounts") + private List runAsAccounts; + + /* + * The number of replication pairs configured in this CS. + */ + @JsonProperty(value = "replicationPairCount") + private String replicationPairCount; + + /* + * The number of process servers. + */ + @JsonProperty(value = "processServerCount") + private String processServerCount; + + /* + * The number of source and target servers configured to talk to this CS. + */ + @JsonProperty(value = "agentCount") + private String agentCount; + + /* + * The number of protected servers. + */ + @JsonProperty(value = "protectedServers") + private String protectedServers; + + /* + * The percentage of the system load. + */ + @JsonProperty(value = "systemLoad") + private String systemLoad; + + /* + * The system load status. + */ + @JsonProperty(value = "systemLoadStatus") + private String systemLoadStatus; + + /* + * The percentage of the CPU load. + */ + @JsonProperty(value = "cpuLoad") + private String cpuLoad; + + /* + * The CPU load status. + */ + @JsonProperty(value = "cpuLoadStatus") + private String cpuLoadStatus; + + /* + * The total memory. + */ + @JsonProperty(value = "totalMemoryInBytes") + private Long totalMemoryInBytes; + + /* + * The available memory. + */ + @JsonProperty(value = "availableMemoryInBytes") + private Long availableMemoryInBytes; + + /* + * The memory usage status. + */ + @JsonProperty(value = "memoryUsageStatus") + private String memoryUsageStatus; + + /* + * The total space. + */ + @JsonProperty(value = "totalSpaceInBytes") + private Long totalSpaceInBytes; + + /* + * The available space. + */ + @JsonProperty(value = "availableSpaceInBytes") + private Long availableSpaceInBytes; + + /* + * The space usage status. + */ + @JsonProperty(value = "spaceUsageStatus") + private String spaceUsageStatus; + + /* + * The web load. + */ + @JsonProperty(value = "webLoad") + private String webLoad; + + /* + * The web load status. + */ + @JsonProperty(value = "webLoadStatus") + private String webLoadStatus; + + /* + * The database server load. + */ + @JsonProperty(value = "databaseServerLoad") + private String databaseServerLoad; + + /* + * The database server load status. + */ + @JsonProperty(value = "databaseServerLoadStatus") + private String databaseServerLoadStatus; + + /* + * The CS service status. + */ + @JsonProperty(value = "csServiceStatus") + private String csServiceStatus; + + /* + * The IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The agent Version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * The host name. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * The last heartbeat received from CS server. + */ + @JsonProperty(value = "lastHeartbeat") + private OffsetDateTime lastHeartbeat; + + /* + * Version status. + */ + @JsonProperty(value = "versionStatus") + private String versionStatus; + + /* + * CS SSL cert expiry date. + */ + @JsonProperty(value = "sslCertExpiryDate") + private OffsetDateTime sslCertExpiryDate; + + /* + * CS SSL cert expiry date. + */ + @JsonProperty(value = "sslCertExpiryRemainingDays") + private Integer sslCertExpiryRemainingDays; + + /* + * PS template version. + */ + @JsonProperty(value = "psTemplateVersion") + private String psTemplateVersion; + + /* + * Agent expiry date. + */ + @JsonProperty(value = "agentExpiryDate") + private OffsetDateTime agentExpiryDate; + + /* + * The agent version details. + */ + @JsonProperty(value = "agentVersionDetails") + private VersionDetails agentVersionDetails; + + /* + * The switch provider blocking error information. + */ + @JsonProperty(value = "switchProviderBlockingErrorDetails") + private List switchProviderBlockingErrorDetails; + + /** Creates an instance of VMwareDetails class. */ + public VMwareDetails() { + } + + /** + * Get the processServers property: The list of Process Servers associated with the fabric. + * + * @return the processServers value. + */ + public List processServers() { + return this.processServers; + } + + /** + * Set the processServers property: The list of Process Servers associated with the fabric. + * + * @param processServers the processServers value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withProcessServers(List processServers) { + this.processServers = processServers; + return this; + } + + /** + * Get the masterTargetServers property: The list of Master Target servers associated with the fabric. + * + * @return the masterTargetServers value. + */ + public List masterTargetServers() { + return this.masterTargetServers; + } + + /** + * Set the masterTargetServers property: The list of Master Target servers associated with the fabric. + * + * @param masterTargetServers the masterTargetServers value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withMasterTargetServers(List masterTargetServers) { + this.masterTargetServers = masterTargetServers; + return this; + } + + /** + * Get the runAsAccounts property: The list of run as accounts created on the server. + * + * @return the runAsAccounts value. + */ + public List runAsAccounts() { + return this.runAsAccounts; + } + + /** + * Set the runAsAccounts property: The list of run as accounts created on the server. + * + * @param runAsAccounts the runAsAccounts value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withRunAsAccounts(List runAsAccounts) { + this.runAsAccounts = runAsAccounts; + return this; + } + + /** + * Get the replicationPairCount property: The number of replication pairs configured in this CS. + * + * @return the replicationPairCount value. + */ + public String replicationPairCount() { + return this.replicationPairCount; + } + + /** + * Set the replicationPairCount property: The number of replication pairs configured in this CS. + * + * @param replicationPairCount the replicationPairCount value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withReplicationPairCount(String replicationPairCount) { + this.replicationPairCount = replicationPairCount; + return this; + } + + /** + * Get the processServerCount property: The number of process servers. + * + * @return the processServerCount value. + */ + public String processServerCount() { + return this.processServerCount; + } + + /** + * Set the processServerCount property: The number of process servers. + * + * @param processServerCount the processServerCount value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withProcessServerCount(String processServerCount) { + this.processServerCount = processServerCount; + return this; + } + + /** + * Get the agentCount property: The number of source and target servers configured to talk to this CS. + * + * @return the agentCount value. + */ + public String agentCount() { + return this.agentCount; + } + + /** + * Set the agentCount property: The number of source and target servers configured to talk to this CS. + * + * @param agentCount the agentCount value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withAgentCount(String agentCount) { + this.agentCount = agentCount; + return this; + } + + /** + * Get the protectedServers property: The number of protected servers. + * + * @return the protectedServers value. + */ + public String protectedServers() { + return this.protectedServers; + } + + /** + * Set the protectedServers property: The number of protected servers. + * + * @param protectedServers the protectedServers value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withProtectedServers(String protectedServers) { + this.protectedServers = protectedServers; + return this; + } + + /** + * Get the systemLoad property: The percentage of the system load. + * + * @return the systemLoad value. + */ + public String systemLoad() { + return this.systemLoad; + } + + /** + * Set the systemLoad property: The percentage of the system load. + * + * @param systemLoad the systemLoad value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withSystemLoad(String systemLoad) { + this.systemLoad = systemLoad; + return this; + } + + /** + * Get the systemLoadStatus property: The system load status. + * + * @return the systemLoadStatus value. + */ + public String systemLoadStatus() { + return this.systemLoadStatus; + } + + /** + * Set the systemLoadStatus property: The system load status. + * + * @param systemLoadStatus the systemLoadStatus value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withSystemLoadStatus(String systemLoadStatus) { + this.systemLoadStatus = systemLoadStatus; + return this; + } + + /** + * Get the cpuLoad property: The percentage of the CPU load. + * + * @return the cpuLoad value. + */ + public String cpuLoad() { + return this.cpuLoad; + } + + /** + * Set the cpuLoad property: The percentage of the CPU load. + * + * @param cpuLoad the cpuLoad value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withCpuLoad(String cpuLoad) { + this.cpuLoad = cpuLoad; + return this; + } + + /** + * Get the cpuLoadStatus property: The CPU load status. + * + * @return the cpuLoadStatus value. + */ + public String cpuLoadStatus() { + return this.cpuLoadStatus; + } + + /** + * Set the cpuLoadStatus property: The CPU load status. + * + * @param cpuLoadStatus the cpuLoadStatus value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withCpuLoadStatus(String cpuLoadStatus) { + this.cpuLoadStatus = cpuLoadStatus; + return this; + } + + /** + * Get the totalMemoryInBytes property: The total memory. + * + * @return the totalMemoryInBytes value. + */ + public Long totalMemoryInBytes() { + return this.totalMemoryInBytes; + } + + /** + * Set the totalMemoryInBytes property: The total memory. + * + * @param totalMemoryInBytes the totalMemoryInBytes value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withTotalMemoryInBytes(Long totalMemoryInBytes) { + this.totalMemoryInBytes = totalMemoryInBytes; + return this; + } + + /** + * Get the availableMemoryInBytes property: The available memory. + * + * @return the availableMemoryInBytes value. + */ + public Long availableMemoryInBytes() { + return this.availableMemoryInBytes; + } + + /** + * Set the availableMemoryInBytes property: The available memory. + * + * @param availableMemoryInBytes the availableMemoryInBytes value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withAvailableMemoryInBytes(Long availableMemoryInBytes) { + this.availableMemoryInBytes = availableMemoryInBytes; + return this; + } + + /** + * Get the memoryUsageStatus property: The memory usage status. + * + * @return the memoryUsageStatus value. + */ + public String memoryUsageStatus() { + return this.memoryUsageStatus; + } + + /** + * Set the memoryUsageStatus property: The memory usage status. + * + * @param memoryUsageStatus the memoryUsageStatus value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withMemoryUsageStatus(String memoryUsageStatus) { + this.memoryUsageStatus = memoryUsageStatus; + return this; + } + + /** + * Get the totalSpaceInBytes property: The total space. + * + * @return the totalSpaceInBytes value. + */ + public Long totalSpaceInBytes() { + return this.totalSpaceInBytes; + } + + /** + * Set the totalSpaceInBytes property: The total space. + * + * @param totalSpaceInBytes the totalSpaceInBytes value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withTotalSpaceInBytes(Long totalSpaceInBytes) { + this.totalSpaceInBytes = totalSpaceInBytes; + return this; + } + + /** + * Get the availableSpaceInBytes property: The available space. + * + * @return the availableSpaceInBytes value. + */ + public Long availableSpaceInBytes() { + return this.availableSpaceInBytes; + } + + /** + * Set the availableSpaceInBytes property: The available space. + * + * @param availableSpaceInBytes the availableSpaceInBytes value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withAvailableSpaceInBytes(Long availableSpaceInBytes) { + this.availableSpaceInBytes = availableSpaceInBytes; + return this; + } + + /** + * Get the spaceUsageStatus property: The space usage status. + * + * @return the spaceUsageStatus value. + */ + public String spaceUsageStatus() { + return this.spaceUsageStatus; + } + + /** + * Set the spaceUsageStatus property: The space usage status. + * + * @param spaceUsageStatus the spaceUsageStatus value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withSpaceUsageStatus(String spaceUsageStatus) { + this.spaceUsageStatus = spaceUsageStatus; + return this; + } + + /** + * Get the webLoad property: The web load. + * + * @return the webLoad value. + */ + public String webLoad() { + return this.webLoad; + } + + /** + * Set the webLoad property: The web load. + * + * @param webLoad the webLoad value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withWebLoad(String webLoad) { + this.webLoad = webLoad; + return this; + } + + /** + * Get the webLoadStatus property: The web load status. + * + * @return the webLoadStatus value. + */ + public String webLoadStatus() { + return this.webLoadStatus; + } + + /** + * Set the webLoadStatus property: The web load status. + * + * @param webLoadStatus the webLoadStatus value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withWebLoadStatus(String webLoadStatus) { + this.webLoadStatus = webLoadStatus; + return this; + } + + /** + * Get the databaseServerLoad property: The database server load. + * + * @return the databaseServerLoad value. + */ + public String databaseServerLoad() { + return this.databaseServerLoad; + } + + /** + * Set the databaseServerLoad property: The database server load. + * + * @param databaseServerLoad the databaseServerLoad value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withDatabaseServerLoad(String databaseServerLoad) { + this.databaseServerLoad = databaseServerLoad; + return this; + } + + /** + * Get the databaseServerLoadStatus property: The database server load status. + * + * @return the databaseServerLoadStatus value. + */ + public String databaseServerLoadStatus() { + return this.databaseServerLoadStatus; + } + + /** + * Set the databaseServerLoadStatus property: The database server load status. + * + * @param databaseServerLoadStatus the databaseServerLoadStatus value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withDatabaseServerLoadStatus(String databaseServerLoadStatus) { + this.databaseServerLoadStatus = databaseServerLoadStatus; + return this; + } + + /** + * Get the csServiceStatus property: The CS service status. + * + * @return the csServiceStatus value. + */ + public String csServiceStatus() { + return this.csServiceStatus; + } + + /** + * Set the csServiceStatus property: The CS service status. + * + * @param csServiceStatus the csServiceStatus value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withCsServiceStatus(String csServiceStatus) { + this.csServiceStatus = csServiceStatus; + return this; + } + + /** + * Get the ipAddress property: The IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the agentVersion property: The agent Version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The agent Version. + * + * @param agentVersion the agentVersion value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the hostname property: The host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name. + * + * @param hostname the hostname value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the lastHeartbeat property: The last heartbeat received from CS server. + * + * @return the lastHeartbeat value. + */ + public OffsetDateTime lastHeartbeat() { + return this.lastHeartbeat; + } + + /** + * Set the lastHeartbeat property: The last heartbeat received from CS server. + * + * @param lastHeartbeat the lastHeartbeat value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withLastHeartbeat(OffsetDateTime lastHeartbeat) { + this.lastHeartbeat = lastHeartbeat; + return this; + } + + /** + * Get the versionStatus property: Version status. + * + * @return the versionStatus value. + */ + public String versionStatus() { + return this.versionStatus; + } + + /** + * Set the versionStatus property: Version status. + * + * @param versionStatus the versionStatus value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withVersionStatus(String versionStatus) { + this.versionStatus = versionStatus; + return this; + } + + /** + * Get the sslCertExpiryDate property: CS SSL cert expiry date. + * + * @return the sslCertExpiryDate value. + */ + public OffsetDateTime sslCertExpiryDate() { + return this.sslCertExpiryDate; + } + + /** + * Set the sslCertExpiryDate property: CS SSL cert expiry date. + * + * @param sslCertExpiryDate the sslCertExpiryDate value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withSslCertExpiryDate(OffsetDateTime sslCertExpiryDate) { + this.sslCertExpiryDate = sslCertExpiryDate; + return this; + } + + /** + * Get the sslCertExpiryRemainingDays property: CS SSL cert expiry date. + * + * @return the sslCertExpiryRemainingDays value. + */ + public Integer sslCertExpiryRemainingDays() { + return this.sslCertExpiryRemainingDays; + } + + /** + * Set the sslCertExpiryRemainingDays property: CS SSL cert expiry date. + * + * @param sslCertExpiryRemainingDays the sslCertExpiryRemainingDays value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withSslCertExpiryRemainingDays(Integer sslCertExpiryRemainingDays) { + this.sslCertExpiryRemainingDays = sslCertExpiryRemainingDays; + return this; + } + + /** + * Get the psTemplateVersion property: PS template version. + * + * @return the psTemplateVersion value. + */ + public String psTemplateVersion() { + return this.psTemplateVersion; + } + + /** + * Set the psTemplateVersion property: PS template version. + * + * @param psTemplateVersion the psTemplateVersion value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withPsTemplateVersion(String psTemplateVersion) { + this.psTemplateVersion = psTemplateVersion; + return this; + } + + /** + * Get the agentExpiryDate property: Agent expiry date. + * + * @return the agentExpiryDate value. + */ + public OffsetDateTime agentExpiryDate() { + return this.agentExpiryDate; + } + + /** + * Set the agentExpiryDate property: Agent expiry date. + * + * @param agentExpiryDate the agentExpiryDate value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withAgentExpiryDate(OffsetDateTime agentExpiryDate) { + this.agentExpiryDate = agentExpiryDate; + return this; + } + + /** + * Get the agentVersionDetails property: The agent version details. + * + * @return the agentVersionDetails value. + */ + public VersionDetails agentVersionDetails() { + return this.agentVersionDetails; + } + + /** + * Set the agentVersionDetails property: The agent version details. + * + * @param agentVersionDetails the agentVersionDetails value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withAgentVersionDetails(VersionDetails agentVersionDetails) { + this.agentVersionDetails = agentVersionDetails; + return this; + } + + /** + * Get the switchProviderBlockingErrorDetails property: The switch provider blocking error information. + * + * @return the switchProviderBlockingErrorDetails value. + */ + public List switchProviderBlockingErrorDetails() { + return this.switchProviderBlockingErrorDetails; + } + + /** + * Set the switchProviderBlockingErrorDetails property: The switch provider blocking error information. + * + * @param switchProviderBlockingErrorDetails the switchProviderBlockingErrorDetails value to set. + * @return the VMwareDetails object itself. + */ + public VMwareDetails withSwitchProviderBlockingErrorDetails( + List switchProviderBlockingErrorDetails) { + this.switchProviderBlockingErrorDetails = switchProviderBlockingErrorDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (processServers() != null) { + processServers().forEach(e -> e.validate()); + } + if (masterTargetServers() != null) { + masterTargetServers().forEach(e -> e.validate()); + } + if (runAsAccounts() != null) { + runAsAccounts().forEach(e -> e.validate()); + } + if (agentVersionDetails() != null) { + agentVersionDetails().validate(); + } + if (switchProviderBlockingErrorDetails() != null) { + switchProviderBlockingErrorDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricCreationInput.java new file mode 100644 index 000000000000..30235f98fb93 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricCreationInput.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** VMwareV2 fabric provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareV2") +@Fluent +public final class VMwareV2FabricCreationInput extends FabricSpecificCreationInput { + /* + * The ARM Id of the VMware site. + */ + @JsonProperty(value = "vmwareSiteId") + private String vmwareSiteId; + + /* + * The ARM Id of the physical site. + */ + @JsonProperty(value = "physicalSiteId") + private String physicalSiteId; + + /* + * The ARM Id of the migration solution. + */ + @JsonProperty(value = "migrationSolutionId", required = true) + private String migrationSolutionId; + + /** Creates an instance of VMwareV2FabricCreationInput class. */ + public VMwareV2FabricCreationInput() { + } + + /** + * Get the vmwareSiteId property: The ARM Id of the VMware site. + * + * @return the vmwareSiteId value. + */ + public String vmwareSiteId() { + return this.vmwareSiteId; + } + + /** + * Set the vmwareSiteId property: The ARM Id of the VMware site. + * + * @param vmwareSiteId the vmwareSiteId value to set. + * @return the VMwareV2FabricCreationInput object itself. + */ + public VMwareV2FabricCreationInput withVmwareSiteId(String vmwareSiteId) { + this.vmwareSiteId = vmwareSiteId; + return this; + } + + /** + * Get the physicalSiteId property: The ARM Id of the physical site. + * + * @return the physicalSiteId value. + */ + public String physicalSiteId() { + return this.physicalSiteId; + } + + /** + * Set the physicalSiteId property: The ARM Id of the physical site. + * + * @param physicalSiteId the physicalSiteId value to set. + * @return the VMwareV2FabricCreationInput object itself. + */ + public VMwareV2FabricCreationInput withPhysicalSiteId(String physicalSiteId) { + this.physicalSiteId = physicalSiteId; + return this; + } + + /** + * Get the migrationSolutionId property: The ARM Id of the migration solution. + * + * @return the migrationSolutionId value. + */ + public String migrationSolutionId() { + return this.migrationSolutionId; + } + + /** + * Set the migrationSolutionId property: The ARM Id of the migration solution. + * + * @param migrationSolutionId the migrationSolutionId value to set. + * @return the VMwareV2FabricCreationInput object itself. + */ + public VMwareV2FabricCreationInput 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 (migrationSolutionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property migrationSolutionId in model VMwareV2FabricCreationInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareV2FabricCreationInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricSpecificDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricSpecificDetails.java new file mode 100644 index 000000000000..752cc6ce64f1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricSpecificDetails.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** VMwareV2 fabric specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareV2") +@Immutable +public final class VMwareV2FabricSpecificDetails extends FabricSpecificDetails { + /* + * The ARM Id of the VMware site. + */ + @JsonProperty(value = "vmwareSiteId", access = JsonProperty.Access.WRITE_ONLY) + private String vmwareSiteId; + + /* + * The ARM Id of the physical site. + */ + @JsonProperty(value = "physicalSiteId", access = JsonProperty.Access.WRITE_ONLY) + private String physicalSiteId; + + /* + * The Migration solution ARM Id. + */ + @JsonProperty(value = "migrationSolutionId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationSolutionId; + + /* + * The service endpoint. + */ + @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceEndpoint; + + /* + * The service resource Id. + */ + @JsonProperty(value = "serviceResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceResourceId; + + /* + * The service container Id. + */ + @JsonProperty(value = "serviceContainerId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceContainerId; + + /* + * The list of process servers. + */ + @JsonProperty(value = "processServers", access = JsonProperty.Access.WRITE_ONLY) + private List processServers; + + /** Creates an instance of VMwareV2FabricSpecificDetails class. */ + public VMwareV2FabricSpecificDetails() { + } + + /** + * Get the vmwareSiteId property: The ARM Id of the VMware site. + * + * @return the vmwareSiteId value. + */ + public String vmwareSiteId() { + return this.vmwareSiteId; + } + + /** + * Get the physicalSiteId property: The ARM Id of the physical site. + * + * @return the physicalSiteId value. + */ + public String physicalSiteId() { + return this.physicalSiteId; + } + + /** + * Get the migrationSolutionId property: The Migration solution ARM Id. + * + * @return the migrationSolutionId value. + */ + public String migrationSolutionId() { + return this.migrationSolutionId; + } + + /** + * Get the serviceEndpoint property: The service endpoint. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.serviceEndpoint; + } + + /** + * Get the serviceResourceId property: The service resource Id. + * + * @return the serviceResourceId value. + */ + public String serviceResourceId() { + return this.serviceResourceId; + } + + /** + * Get the serviceContainerId property: The service container Id. + * + * @return the serviceContainerId value. + */ + public String serviceContainerId() { + return this.serviceContainerId; + } + + /** + * Get the processServers property: The list of process servers. + * + * @return the processServers value. + */ + public List processServers() { + return this.processServers; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (processServers() != null) { + processServers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareVirtualMachineDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareVirtualMachineDetails.java new file mode 100644 index 000000000000..5e06adb5568b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareVirtualMachineDetails.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; +import java.util.List; + +/** VMware provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareVirtualMachine") +@Fluent +public final class VMwareVirtualMachineDetails extends ConfigurationSettings { + /* + * The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage + * CreateProtection. + */ + @JsonProperty(value = "agentGeneratedId") + private String agentGeneratedId; + + /* + * The value indicating if InMage scout agent is installed on guest. + */ + @JsonProperty(value = "agentInstalled") + private String agentInstalled; + + /* + * The OsType installed on VM. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The agent version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * The IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The value indicating whether VM is powered on. + */ + @JsonProperty(value = "poweredOn") + private String poweredOn; + + /* + * The VCenter infrastructure Id. + */ + @JsonProperty(value = "vCenterInfrastructureId") + private String vCenterInfrastructureId; + + /* + * A value indicating the discovery type of the machine. Value can be vCenter or physical. + */ + @JsonProperty(value = "discoveryType") + private String discoveryType; + + /* + * The disk details. + */ + @JsonProperty(value = "diskDetails") + private List diskDetails; + + /* + * The validation errors. + */ + @JsonProperty(value = "validationErrors") + private List validationErrors; + + /** Creates an instance of VMwareVirtualMachineDetails class. */ + public VMwareVirtualMachineDetails() { + } + + /** + * Get the agentGeneratedId property: The ID generated by the InMage agent after it gets installed on guest. This is + * the ID to be used during InMage CreateProtection. + * + * @return the agentGeneratedId value. + */ + public String agentGeneratedId() { + return this.agentGeneratedId; + } + + /** + * Set the agentGeneratedId property: The ID generated by the InMage agent after it gets installed on guest. This is + * the ID to be used during InMage CreateProtection. + * + * @param agentGeneratedId the agentGeneratedId value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withAgentGeneratedId(String agentGeneratedId) { + this.agentGeneratedId = agentGeneratedId; + return this; + } + + /** + * Get the agentInstalled property: The value indicating if InMage scout agent is installed on guest. + * + * @return the agentInstalled value. + */ + public String agentInstalled() { + return this.agentInstalled; + } + + /** + * Set the agentInstalled property: The value indicating if InMage scout agent is installed on guest. + * + * @param agentInstalled the agentInstalled value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withAgentInstalled(String agentInstalled) { + this.agentInstalled = agentInstalled; + return this; + } + + /** + * Get the osType property: The OsType installed on VM. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OsType installed on VM. + * + * @param osType the osType value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the agentVersion property: The agent version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The agent version. + * + * @param agentVersion the agentVersion value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the ipAddress property: The IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the poweredOn property: The value indicating whether VM is powered on. + * + * @return the poweredOn value. + */ + public String poweredOn() { + return this.poweredOn; + } + + /** + * Set the poweredOn property: The value indicating whether VM is powered on. + * + * @param poweredOn the poweredOn value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withPoweredOn(String poweredOn) { + this.poweredOn = poweredOn; + return this; + } + + /** + * Get the vCenterInfrastructureId property: The VCenter infrastructure Id. + * + * @return the vCenterInfrastructureId value. + */ + public String vCenterInfrastructureId() { + return this.vCenterInfrastructureId; + } + + /** + * Set the vCenterInfrastructureId property: The VCenter infrastructure Id. + * + * @param vCenterInfrastructureId the vCenterInfrastructureId value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withVCenterInfrastructureId(String vCenterInfrastructureId) { + this.vCenterInfrastructureId = vCenterInfrastructureId; + return this; + } + + /** + * Get the discoveryType property: A value indicating the discovery type of the machine. Value can be vCenter or + * physical. + * + * @return the discoveryType value. + */ + public String discoveryType() { + return this.discoveryType; + } + + /** + * Set the discoveryType property: A value indicating the discovery type of the machine. Value can be vCenter or + * physical. + * + * @param discoveryType the discoveryType value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withDiscoveryType(String discoveryType) { + this.discoveryType = discoveryType; + return this; + } + + /** + * Get the diskDetails property: The disk details. + * + * @return the diskDetails value. + */ + public List diskDetails() { + return this.diskDetails; + } + + /** + * Set the diskDetails property: The disk details. + * + * @param diskDetails the diskDetails value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withDiskDetails(List diskDetails) { + this.diskDetails = diskDetails; + return this; + } + + /** + * Get the validationErrors property: The validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Set the validationErrors property: The validation errors. + * + * @param validationErrors the validationErrors value to set. + * @return the VMwareVirtualMachineDetails object itself. + */ + public VMwareVirtualMachineDetails withValidationErrors(List validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (diskDetails() != null) { + diskDetails().forEach(e -> e.validate()); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultHealthDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultHealthDetails.java new file mode 100644 index 000000000000..8461df2b6686 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultHealthDetails.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.recoveryservicessiterecovery.models; + +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultHealthDetailsInner; + +/** An immutable client-side representation of VaultHealthDetails. */ +public interface VaultHealthDetails { + /** + * 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: The vault health related data. + * + * @return the properties value. + */ + VaultHealthProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultHealthDetailsInner + * object. + * + * @return the inner object. + */ + VaultHealthDetailsInner innerModel(); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultHealthProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultHealthProperties.java new file mode 100644 index 000000000000..84624d8fa40d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultHealthProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** class to define the health summary of the Vault. */ +@Fluent +public final class VaultHealthProperties { + /* + * The list of errors on the vault. + */ + @JsonProperty(value = "vaultErrors") + private List vaultErrors; + + /* + * The list of the health detail of the protected items in the vault. + */ + @JsonProperty(value = "protectedItemsHealth") + private ResourceHealthSummary protectedItemsHealth; + + /* + * The list of the health detail of the fabrics in the vault. + */ + @JsonProperty(value = "fabricsHealth") + private ResourceHealthSummary fabricsHealth; + + /* + * The list of the health detail of the containers in the vault. + */ + @JsonProperty(value = "containersHealth") + private ResourceHealthSummary containersHealth; + + /** Creates an instance of VaultHealthProperties class. */ + public VaultHealthProperties() { + } + + /** + * Get the vaultErrors property: The list of errors on the vault. + * + * @return the vaultErrors value. + */ + public List vaultErrors() { + return this.vaultErrors; + } + + /** + * Set the vaultErrors property: The list of errors on the vault. + * + * @param vaultErrors the vaultErrors value to set. + * @return the VaultHealthProperties object itself. + */ + public VaultHealthProperties withVaultErrors(List vaultErrors) { + this.vaultErrors = vaultErrors; + return this; + } + + /** + * Get the protectedItemsHealth property: The list of the health detail of the protected items in the vault. + * + * @return the protectedItemsHealth value. + */ + public ResourceHealthSummary protectedItemsHealth() { + return this.protectedItemsHealth; + } + + /** + * Set the protectedItemsHealth property: The list of the health detail of the protected items in the vault. + * + * @param protectedItemsHealth the protectedItemsHealth value to set. + * @return the VaultHealthProperties object itself. + */ + public VaultHealthProperties withProtectedItemsHealth(ResourceHealthSummary protectedItemsHealth) { + this.protectedItemsHealth = protectedItemsHealth; + return this; + } + + /** + * Get the fabricsHealth property: The list of the health detail of the fabrics in the vault. + * + * @return the fabricsHealth value. + */ + public ResourceHealthSummary fabricsHealth() { + return this.fabricsHealth; + } + + /** + * Set the fabricsHealth property: The list of the health detail of the fabrics in the vault. + * + * @param fabricsHealth the fabricsHealth value to set. + * @return the VaultHealthProperties object itself. + */ + public VaultHealthProperties withFabricsHealth(ResourceHealthSummary fabricsHealth) { + this.fabricsHealth = fabricsHealth; + return this; + } + + /** + * Get the containersHealth property: The list of the health detail of the containers in the vault. + * + * @return the containersHealth value. + */ + public ResourceHealthSummary containersHealth() { + return this.containersHealth; + } + + /** + * Set the containersHealth property: The list of the health detail of the containers in the vault. + * + * @param containersHealth the containersHealth value to set. + * @return the VaultHealthProperties object itself. + */ + public VaultHealthProperties withContainersHealth(ResourceHealthSummary containersHealth) { + this.containersHealth = containersHealth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultErrors() != null) { + vaultErrors().forEach(e -> e.validate()); + } + if (protectedItemsHealth() != null) { + protectedItemsHealth().validate(); + } + if (fabricsHealth() != null) { + fabricsHealth().validate(); + } + if (containersHealth() != null) { + containersHealth().validate(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSetting.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSetting.java new file mode 100644 index 000000000000..b75b2170c4bf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSetting.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultSettingInner; + +/** An immutable client-side representation of VaultSetting. */ +public interface VaultSetting { + /** + * 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: The vault setting properties. + * + * @return the properties value. + */ + VaultSettingProperties properties(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultSettingInner object. + * + * @return the inner object. + */ + VaultSettingInner innerModel(); + + /** The entirety of the VaultSetting definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The VaultSetting definition stages. */ + interface DefinitionStages { + /** The first stage of the VaultSetting definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VaultSetting definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceName, resourceGroupName. + * + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @return the next definition stage. + */ + WithProperties withExistingVault(String resourceName, String resourceGroupName); + } + /** The stage of the VaultSetting definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Vault setting creation input properties.. + * + * @param properties Vault setting creation input properties. + * @return the next definition stage. + */ + WithCreate withProperties(VaultSettingCreationInputProperties properties); + } + /** + * The stage of the VaultSetting 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. + */ + VaultSetting create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VaultSetting create(Context context); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VaultSetting refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VaultSetting refresh(Context context); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCollection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCollection.java new file mode 100644 index 000000000000..0b9c048dd66a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCollection.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultSettingInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vault setting collection. */ +@Fluent +public final class VaultSettingCollection { + /* + * The list of vault setting. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of VaultSettingCollection class. */ + public VaultSettingCollection() { + } + + /** + * Get the value property: The list of vault setting. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of vault setting. + * + * @param value the value value to set. + * @return the VaultSettingCollection object itself. + */ + public VaultSettingCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The value of next link. + * + * @param nextLink the nextLink value to set. + * @return the VaultSettingCollection object itself. + */ + public VaultSettingCollection 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/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInput.java new file mode 100644 index 000000000000..cb7a04c32e81 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input to create vault setting. */ +@Fluent +public final class VaultSettingCreationInput { + /* + * Vault setting creation input properties. + */ + @JsonProperty(value = "properties", required = true) + private VaultSettingCreationInputProperties properties; + + /** Creates an instance of VaultSettingCreationInput class. */ + public VaultSettingCreationInput() { + } + + /** + * Get the properties property: Vault setting creation input properties. + * + * @return the properties value. + */ + public VaultSettingCreationInputProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Vault setting creation input properties. + * + * @param properties the properties value to set. + * @return the VaultSettingCreationInput object itself. + */ + public VaultSettingCreationInput withProperties(VaultSettingCreationInputProperties 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 VaultSettingCreationInput")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VaultSettingCreationInput.class); +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInputProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInputProperties.java new file mode 100644 index 000000000000..474ecd7f3e85 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInputProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input to create vault setting. */ +@Fluent +public final class VaultSettingCreationInputProperties { + /* + * The migration solution Id. + */ + @JsonProperty(value = "migrationSolutionId") + private String migrationSolutionId; + + /* + * VMware to Azure provider type. + */ + @JsonProperty(value = "vmwareToAzureProviderType") + private String vmwareToAzureProviderType; + + /** Creates an instance of VaultSettingCreationInputProperties class. */ + public VaultSettingCreationInputProperties() { + } + + /** + * Get the migrationSolutionId property: The migration solution Id. + * + * @return the migrationSolutionId value. + */ + public String migrationSolutionId() { + return this.migrationSolutionId; + } + + /** + * Set the migrationSolutionId property: The migration solution Id. + * + * @param migrationSolutionId the migrationSolutionId value to set. + * @return the VaultSettingCreationInputProperties object itself. + */ + public VaultSettingCreationInputProperties withMigrationSolutionId(String migrationSolutionId) { + this.migrationSolutionId = migrationSolutionId; + return this; + } + + /** + * Get the vmwareToAzureProviderType property: VMware to Azure provider type. + * + * @return the vmwareToAzureProviderType value. + */ + public String vmwareToAzureProviderType() { + return this.vmwareToAzureProviderType; + } + + /** + * Set the vmwareToAzureProviderType property: VMware to Azure provider type. + * + * @param vmwareToAzureProviderType the vmwareToAzureProviderType value to set. + * @return the VaultSettingCreationInputProperties object itself. + */ + public VaultSettingCreationInputProperties withVmwareToAzureProviderType(String vmwareToAzureProviderType) { + this.vmwareToAzureProviderType = vmwareToAzureProviderType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingProperties.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingProperties.java new file mode 100644 index 000000000000..079adbf541a9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingProperties.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault setting properties. */ +@Fluent +public final class VaultSettingProperties { + /* + * The migration solution ARM Id. + */ + @JsonProperty(value = "migrationSolutionId") + private String migrationSolutionId; + + /* + * VMware to Azure provider type. + */ + @JsonProperty(value = "vmwareToAzureProviderType") + private String vmwareToAzureProviderType; + + /** Creates an instance of VaultSettingProperties class. */ + public VaultSettingProperties() { + } + + /** + * Get the migrationSolutionId property: The migration solution ARM Id. + * + * @return the migrationSolutionId value. + */ + public String migrationSolutionId() { + return this.migrationSolutionId; + } + + /** + * Set the migrationSolutionId property: The migration solution ARM Id. + * + * @param migrationSolutionId the migrationSolutionId value to set. + * @return the VaultSettingProperties object itself. + */ + public VaultSettingProperties withMigrationSolutionId(String migrationSolutionId) { + this.migrationSolutionId = migrationSolutionId; + return this; + } + + /** + * Get the vmwareToAzureProviderType property: VMware to Azure provider type. + * + * @return the vmwareToAzureProviderType value. + */ + public String vmwareToAzureProviderType() { + return this.vmwareToAzureProviderType; + } + + /** + * Set the vmwareToAzureProviderType property: VMware to Azure provider type. + * + * @param vmwareToAzureProviderType the vmwareToAzureProviderType value to set. + * @return the VaultSettingProperties object itself. + */ + public VaultSettingProperties withVmwareToAzureProviderType(String vmwareToAzureProviderType) { + this.vmwareToAzureProviderType = vmwareToAzureProviderType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VersionDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VersionDetails.java new file mode 100644 index 000000000000..ed290ae6d679 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VersionDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Version related details. */ +@Fluent +public final class VersionDetails { + /* + * The agent version. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Version expiry date. + */ + @JsonProperty(value = "expiryDate") + private OffsetDateTime expiryDate; + + /* + * A value indicating whether security update required. + */ + @JsonProperty(value = "status") + private AgentVersionStatus status; + + /** Creates an instance of VersionDetails class. */ + public VersionDetails() { + } + + /** + * Get the version property: The agent version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The agent version. + * + * @param version the version value to set. + * @return the VersionDetails object itself. + */ + public VersionDetails withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the expiryDate property: Version expiry date. + * + * @return the expiryDate value. + */ + public OffsetDateTime expiryDate() { + return this.expiryDate; + } + + /** + * Set the expiryDate property: Version expiry date. + * + * @param expiryDate the expiryDate value to set. + * @return the VersionDetails object itself. + */ + public VersionDetails withExpiryDate(OffsetDateTime expiryDate) { + this.expiryDate = expiryDate; + return this; + } + + /** + * Get the status property: A value indicating whether security update required. + * + * @return the status value. + */ + public AgentVersionStatus status() { + return this.status; + } + + /** + * Set the status property: A value indicating whether security update required. + * + * @param status the status value to set. + * @return the VersionDetails object itself. + */ + public VersionDetails withStatus(AgentVersionStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VirtualMachineTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VirtualMachineTaskDetails.java new file mode 100644 index 000000000000..949cd283caa5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VirtualMachineTaskDetails.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.recoveryservicessiterecovery.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; + +/** This class represents the virtual machine task details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VirtualMachineTaskDetails") +@Fluent +public final class VirtualMachineTaskDetails extends JobTaskDetails { + /* + * The skipped reason. + */ + @JsonProperty(value = "skippedReason") + private String skippedReason; + + /* + * The skipped reason string. + */ + @JsonProperty(value = "skippedReasonString") + private String skippedReasonString; + + /** Creates an instance of VirtualMachineTaskDetails class. */ + public VirtualMachineTaskDetails() { + } + + /** + * Get the skippedReason property: The skipped reason. + * + * @return the skippedReason value. + */ + public String skippedReason() { + return this.skippedReason; + } + + /** + * Set the skippedReason property: The skipped reason. + * + * @param skippedReason the skippedReason value to set. + * @return the VirtualMachineTaskDetails object itself. + */ + public VirtualMachineTaskDetails withSkippedReason(String skippedReason) { + this.skippedReason = skippedReason; + return this; + } + + /** + * Get the skippedReasonString property: The skipped reason string. + * + * @return the skippedReasonString value. + */ + public String skippedReasonString() { + return this.skippedReasonString; + } + + /** + * Set the skippedReasonString property: The skipped reason string. + * + * @param skippedReasonString the skippedReasonString value to set. + * @return the VirtualMachineTaskDetails object itself. + */ + public VirtualMachineTaskDetails withSkippedReasonString(String skippedReasonString) { + this.skippedReasonString = skippedReasonString; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineTaskDetails withJobTask(JobEntity jobTask) { + super.withJobTask(jobTask); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmEncryptionType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmEncryptionType.java new file mode 100644 index 000000000000..73e1e4d10b84 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmEncryptionType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The encryption type of the VM. */ +public final class VmEncryptionType extends ExpandableStringEnum { + /** Static value NotEncrypted for VmEncryptionType. */ + public static final VmEncryptionType NOT_ENCRYPTED = fromString("NotEncrypted"); + + /** Static value OnePassEncrypted for VmEncryptionType. */ + public static final VmEncryptionType ONE_PASS_ENCRYPTED = fromString("OnePassEncrypted"); + + /** Static value TwoPassEncrypted for VmEncryptionType. */ + public static final VmEncryptionType TWO_PASS_ENCRYPTED = fromString("TwoPassEncrypted"); + + /** + * Creates or finds a VmEncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VmEncryptionType. + */ + @JsonCreator + public static VmEncryptionType fromString(String name) { + return fromString(name, VmEncryptionType.class); + } + + /** + * Gets known VmEncryptionType values. + * + * @return known VmEncryptionType values. + */ + public static Collection values() { + return values(VmEncryptionType.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmNicUpdatesTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmNicUpdatesTaskDetails.java new file mode 100644 index 000000000000..689c1244c8cd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmNicUpdatesTaskDetails.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.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; + +/** This class represents the vm NicUpdates task details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VmNicUpdatesTaskDetails") +@Fluent +public final class VmNicUpdatesTaskDetails extends TaskTypeDetails { + /* + * Virtual machine Id. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * Nic Id. + */ + @JsonProperty(value = "nicId") + private String nicId; + + /* + * Name of the Nic. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of VmNicUpdatesTaskDetails class. */ + public VmNicUpdatesTaskDetails() { + } + + /** + * Get the vmId property: Virtual machine Id. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: Virtual machine Id. + * + * @param vmId the vmId value to set. + * @return the VmNicUpdatesTaskDetails object itself. + */ + public VmNicUpdatesTaskDetails withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the nicId property: Nic Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Set the nicId property: Nic Id. + * + * @param nicId the nicId value to set. + * @return the VmNicUpdatesTaskDetails object itself. + */ + public VmNicUpdatesTaskDetails withNicId(String nicId) { + this.nicId = nicId; + return this; + } + + /** + * Get the name property: Name of the Nic. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Nic. + * + * @param name the name value to set. + * @return the VmNicUpdatesTaskDetails object itself. + */ + public VmNicUpdatesTaskDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmReplicationProgressHealth.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmReplicationProgressHealth.java new file mode 100644 index 000000000000..b59d1a33cf0d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmReplicationProgressHealth.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.recoveryservicessiterecovery.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The initial replication progress health. */ +public final class VmReplicationProgressHealth extends ExpandableStringEnum { + /** Static value None for VmReplicationProgressHealth. */ + public static final VmReplicationProgressHealth NONE = fromString("None"); + + /** Static value InProgress for VmReplicationProgressHealth. */ + public static final VmReplicationProgressHealth IN_PROGRESS = fromString("InProgress"); + + /** Static value SlowProgress for VmReplicationProgressHealth. */ + public static final VmReplicationProgressHealth SLOW_PROGRESS = fromString("SlowProgress"); + + /** Static value NoProgress for VmReplicationProgressHealth. */ + public static final VmReplicationProgressHealth NO_PROGRESS = fromString("NoProgress"); + + /** + * Creates or finds a VmReplicationProgressHealth from its string representation. + * + * @param name a name to look for. + * @return the corresponding VmReplicationProgressHealth. + */ + @JsonCreator + public static VmReplicationProgressHealth fromString(String name) { + return fromString(name, VmReplicationProgressHealth.class); + } + + /** + * Gets known VmReplicationProgressHealth values. + * + * @return known VmReplicationProgressHealth values. + */ + public static Collection values() { + return values(VmReplicationProgressHealth.class); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmDetails.java new file mode 100644 index 000000000000..70d01cc90f9f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMM fabric specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMM") +@Immutable +public final class VmmDetails extends FabricSpecificDetails { + /** Creates an instance of VmmDetails class. */ + public VmmDetails() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureCreateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureCreateNetworkMappingInput.java new file mode 100644 index 000000000000..a14c6f5ef5bb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureCreateNetworkMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Create network mappings input properties/behavior specific to Vmm to Azure Network mapping. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VmmToAzure") +@Immutable +public final class VmmToAzureCreateNetworkMappingInput extends FabricSpecificCreateNetworkMappingInput { + /** Creates an instance of VmmToAzureCreateNetworkMappingInput class. */ + public VmmToAzureCreateNetworkMappingInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureNetworkMappingSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureNetworkMappingSettings.java new file mode 100644 index 000000000000..fd0049384237 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureNetworkMappingSettings.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** E2A Network Mapping fabric specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VmmToAzure") +@Immutable +public final class VmmToAzureNetworkMappingSettings extends NetworkMappingFabricSpecificSettings { + /** Creates an instance of VmmToAzureNetworkMappingSettings class. */ + public VmmToAzureNetworkMappingSettings() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureUpdateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureUpdateNetworkMappingInput.java new file mode 100644 index 000000000000..eaa33791b7b1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToAzureUpdateNetworkMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Update network mappings input properties/behavior specific to vmm to azure. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VmmToAzure") +@Immutable +public final class VmmToAzureUpdateNetworkMappingInput extends FabricSpecificUpdateNetworkMappingInput { + /** Creates an instance of VmmToAzureUpdateNetworkMappingInput class. */ + public VmmToAzureUpdateNetworkMappingInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmCreateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmCreateNetworkMappingInput.java new file mode 100644 index 000000000000..a2224c73b080 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmCreateNetworkMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Create network mappings input properties/behavior specific to vmm to vmm Network mapping. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VmmToVmm") +@Immutable +public final class VmmToVmmCreateNetworkMappingInput extends FabricSpecificCreateNetworkMappingInput { + /** Creates an instance of VmmToVmmCreateNetworkMappingInput class. */ + public VmmToVmmCreateNetworkMappingInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmNetworkMappingSettings.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmNetworkMappingSettings.java new file mode 100644 index 000000000000..5aac06a7462d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmNetworkMappingSettings.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** E2E Network Mapping fabric specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VmmToVmm") +@Immutable +public final class VmmToVmmNetworkMappingSettings extends NetworkMappingFabricSpecificSettings { + /** Creates an instance of VmmToVmmNetworkMappingSettings class. */ + public VmmToVmmNetworkMappingSettings() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmUpdateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmUpdateNetworkMappingInput.java new file mode 100644 index 000000000000..caae084fadc5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmToVmmUpdateNetworkMappingInput.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Update network mappings input properties/behavior specific to vmm to vmm. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VmmToVmm") +@Immutable +public final class VmmToVmmUpdateNetworkMappingInput extends FabricSpecificUpdateNetworkMappingInput { + /** Creates an instance of VmmToVmmUpdateNetworkMappingInput class. */ + public VmmToVmmUpdateNetworkMappingInput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmVirtualMachineDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmVirtualMachineDetails.java new file mode 100644 index 000000000000..7ecf37ba8a79 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmVirtualMachineDetails.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.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** VMM fabric provider specific VM settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VmmVirtualMachine") +@Fluent +public final class VmmVirtualMachineDetails extends HyperVVirtualMachineDetails { + /** Creates an instance of VmmVirtualMachineDetails class. */ + public VmmVirtualMachineDetails() { + } + + /** {@inheritDoc} */ + @Override + public VmmVirtualMachineDetails withSourceItemId(String sourceItemId) { + super.withSourceItemId(sourceItemId); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmmVirtualMachineDetails withGeneration(String generation) { + super.withGeneration(generation); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmmVirtualMachineDetails withOsDetails(OSDetails osDetails) { + super.withOsDetails(osDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmmVirtualMachineDetails withDiskDetails(List diskDetails) { + super.withDiskDetails(diskDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmmVirtualMachineDetails withHasPhysicalDisk(PresenceStatus hasPhysicalDisk) { + super.withHasPhysicalDisk(hasPhysicalDisk); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmmVirtualMachineDetails withHasFibreChannelAdapter(PresenceStatus hasFibreChannelAdapter) { + super.withHasFibreChannelAdapter(hasFibreChannelAdapter); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmmVirtualMachineDetails withHasSharedVhd(PresenceStatus hasSharedVhd) { + super.withHasSharedVhd(hasSharedVhd); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmmVirtualMachineDetails withHyperVHostId(String hyperVHostId) { + super.withHyperVHostId(hyperVHostId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmwareCbtPolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmwareCbtPolicyDetails.java new file mode 100644 index 000000000000..463dbb112922 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmwareCbtPolicyDetails.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.recoveryservicessiterecovery.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 Cbt specific policy details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VmwareCbtPolicyDetails extends PolicyProviderSpecificDetails { + /* + * The duration in minutes until which the recovery points need to be stored. + */ + @JsonProperty(value = "recoveryPointHistoryInMinutes") + private Integer recoveryPointHistoryInMinutes; + + /* + * The app consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes") + private Integer appConsistentFrequencyInMinutes; + + /* + * The crash consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /** Creates an instance of VmwareCbtPolicyDetails class. */ + public VmwareCbtPolicyDetails() { + } + + /** + * Get the recoveryPointHistoryInMinutes property: The duration in minutes until which the recovery points need to + * be stored. + * + * @return the recoveryPointHistoryInMinutes value. + */ + public Integer recoveryPointHistoryInMinutes() { + return this.recoveryPointHistoryInMinutes; + } + + /** + * Set the recoveryPointHistoryInMinutes property: The duration in minutes until which the recovery points need to + * be stored. + * + * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. + * @return the VmwareCbtPolicyDetails object itself. + */ + public VmwareCbtPolicyDetails withRecoveryPointHistoryInMinutes(Integer recoveryPointHistoryInMinutes) { + this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the VmwareCbtPolicyDetails object itself. + */ + public VmwareCbtPolicyDetails withAppConsistentFrequencyInMinutes(Integer appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the VmwareCbtPolicyDetails object itself. + */ + public VmwareCbtPolicyDetails withCrashConsistentFrequencyInMinutes(Integer crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/package-info.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/package-info.java new file mode 100644 index 000000000000..81415c28aea3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for SiteRecoveryManagementClient. null. */ +package com.azure.resourcemanager.recoveryservicessiterecovery.models; diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/package-info.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/package-info.java new file mode 100644 index 000000000000..0b0e18cfe67f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for SiteRecoveryManagementClient. null. */ +package com.azure.resourcemanager.recoveryservicessiterecovery; diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/module-info.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/module-info.java new file mode 100644 index 000000000000..d7afbb4514ed --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/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.recoveryservicessiterecovery { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.recoveryservicessiterecovery; + exports com.azure.resourcemanager.recoveryservicessiterecovery.fluent; + exports com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models; + exports com.azure.resourcemanager.recoveryservicessiterecovery.models; + + opens com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.recoveryservicessiterecovery.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsGetSamples.java new file mode 100644 index 000000000000..cb20bd24696d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsGetSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for MigrationRecoveryPoints Get. */ +public final class MigrationRecoveryPointsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_Get.json + */ + /** + * Sample code: Gets a recovery point for a migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsARecoveryPointForAMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .migrationRecoveryPoints() + .getWithResponse( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + "b22134ea-620c-474b-9fa5-3c1cb47708e3", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.java new file mode 100644 index 000000000000..85d901d6a4c8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/MigrationRecoveryPointsListByReplicationMigrati.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for MigrationRecoveryPoints ListByReplicationMigrationItems. */ +public final class MigrationRecoveryPointsListByReplicationMigrati { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json + */ + /** + * Sample code: Gets the recovery points for a migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheRecoveryPointsForAMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .migrationRecoveryPoints() + .listByReplicationMigrationItems( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/OperationsListByResourceGroupSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/OperationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..bbba48e4ea45 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/OperationsListByResourceGroupSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations ListByResourceGroup. */ +public final class OperationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/Operations_List.json + */ + /** + * Sample code: Returns the list of available operations. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void returnsTheListOfAvailableOperations( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.operations().listByResourceGroup("resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsGetSamples.java new file mode 100644 index 000000000000..10fad89521a3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsGetSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for RecoveryPoints Get. */ +public final class RecoveryPointsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_Get.json + */ + /** + * Sample code: Gets a recovery point. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsARecoveryPoint( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .recoveryPoints() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + "b22134ea-620c-474b-9fa5-3c1cb47708e3", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.java new file mode 100644 index 000000000000..d9a793d3adaf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/RecoveryPointsListByReplicationProtectedItemsSa.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for RecoveryPoints ListByReplicationProtectedItems. */ +public final class RecoveryPointsListByReplicationProtectedItemsSa { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json + */ + /** + * Sample code: Gets the list of recovery points for a replication protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRecoveryPointsForAReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .recoveryPoints() + .listByReplicationProtectedItems( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateSamples.java new file mode 100644 index 000000000000..e52ea69e0a73 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsCreateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties; +import java.util.Arrays; + +/** Samples for ReplicationAlertSettings Create. */ +public final class ReplicationAlertSettingsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Create.json + */ + /** + * Sample code: Configures email notifications for this vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void configuresEmailNotificationsForThisVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationAlertSettings() + .define("defaultAlertSetting") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new ConfigureAlertRequestProperties() + .withSendToOwners("false") + .withCustomEmailAddresses(Arrays.asList("ronehr@microsoft.com")) + .withLocale("")) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsGetSamples.java new file mode 100644 index 000000000000..df03ffd6a8f3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationAlertSettings Get. */ +public final class ReplicationAlertSettingsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Get.json + */ + /** + * Sample code: Gets an email notification(alert) configuration. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAnEmailNotificationAlertConfiguration( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationAlertSettings() + .getWithResponse("vault1", "resourceGroupPS1", "defaultAlertSetting", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsListSamples.java new file mode 100644 index 000000000000..348a76d01252 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAlertSettingsListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationAlertSettings List. */ +public final class ReplicationAlertSettingsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_List.json + */ + /** + * Sample code: Gets the list of configured email notification(alert) configurations. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfConfiguredEmailNotificationAlertConfigurations( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationAlertSettings().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAppliancesListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAppliancesListSamples.java new file mode 100644 index 000000000000..4d68d98a23fd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationAppliancesListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationAppliances List. */ +public final class ReplicationAppliancesListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAppliances_List.json + */ + /** + * Sample code: Gets the list of appliances. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfAppliances( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationAppliances().list("vault1", "resourceGroupPS1", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.java new file mode 100644 index 000000000000..462b01c3f374 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationEligibilityResultsOperation Get. */ +public final class ReplicationEligibilityResultsOperationGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_Get.json + */ + /** + * Sample code: Gets the validation errors in case the VM is unsuitable for protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationEligibilityResultsOperations().getWithResponse("testRg1", "testVm1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.java new file mode 100644 index 000000000000..58b20fb4b8b9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEligibilityResultsOperationListSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationEligibilityResultsOperation List. */ +public final class ReplicationEligibilityResultsOperationListSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_List.json + */ + /** + * Sample code: Gets the validation errors in case the VM is unsuitable for protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationEligibilityResultsOperations().listWithResponse("testRg1", "testVm2", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEventsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEventsGetSamples.java new file mode 100644 index 000000000000..334c0723aae9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEventsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationEvents Get. */ +public final class ReplicationEventsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_Get.json + */ + /** + * Sample code: Get the details of an Azure Site recovery event. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getTheDetailsOfAnAzureSiteRecoveryEvent( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationEvents() + .getWithResponse("vault1", "resourceGroupPS1", "654b71d0-b2ce-4e6e-a861-98528d4bd375", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEventsListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEventsListSamples.java new file mode 100644 index 000000000000..f796c501bbc1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationEventsListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationEvents List. */ +public final class ReplicationEventsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_List.json + */ + /** + * Sample code: Gets the list of Azure Site Recovery events. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfAzureSiteRecoveryEvents( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationEvents().list("vault1", "resourceGroupPS1", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsCheckConsistencySamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsCheckConsistencySamples.java new file mode 100644 index 000000000000..d26543e602d9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsCheckConsistencySamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics CheckConsistency. */ +public final class ReplicationFabricsCheckConsistencySamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_CheckConsistency.json + */ + /** + * Sample code: Checks the consistency of the ASR fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void checksTheConsistencyOfTheASRFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().checkConsistency("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsCreateSamples.java new file mode 100644 index 000000000000..5539f21e554f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsCreateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricCreationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricSpecificCreationInput; + +/** Samples for ReplicationFabrics Create. */ +public final class ReplicationFabricsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Create.json + */ + /** + * Sample code: Creates an Azure Site Recovery fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createsAnAzureSiteRecoveryFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationFabrics() + .define("cloud1") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties(new FabricCreationInputProperties().withCustomDetails(new FabricSpecificCreationInput())) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsDeleteSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsDeleteSamples.java new file mode 100644 index 000000000000..296fae5bc779 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsDeleteSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics Delete. */ +public final class ReplicationFabricsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Delete.json + */ + /** + * Sample code: Deletes the site. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deletesTheSite( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().delete("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsGetSamples.java new file mode 100644 index 000000000000..70142929deff --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics Get. */ +public final class ReplicationFabricsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Get.json + */ + /** + * Sample code: Gets the details of an ASR fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAnASRFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().getWithResponse("vault1", "resourceGroupPS1", "cloud1", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsListSamples.java new file mode 100644 index 000000000000..43779e87a8c8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics List. */ +public final class ReplicationFabricsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_List.json + */ + /** + * Sample code: Gets the list of ASR fabrics. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfASRFabrics( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsMigrateToAadSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsMigrateToAadSamples.java new file mode 100644 index 000000000000..699551804640 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsMigrateToAadSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics MigrateToAad. */ +public final class ReplicationFabricsMigrateToAadSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_MigrateToAad.json + */ + /** + * Sample code: Migrates the site to AAD. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void migratesTheSiteToAAD( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().migrateToAad("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsPurgeSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsPurgeSamples.java new file mode 100644 index 000000000000..56c9ae0527ed --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsPurgeSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationFabrics Purge. */ +public final class ReplicationFabricsPurgeSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Purge.json + */ + /** + * Sample code: Purges the site. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgesTheSite( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationFabrics().purge("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsReassociateGatewaySamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsReassociateGatewaySamples.java new file mode 100644 index 000000000000..0e7d49b93bf8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsReassociateGatewaySamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverProcessServerRequestProperties; +import java.util.Arrays; + +/** Samples for ReplicationFabrics ReassociateGateway. */ +public final class ReplicationFabricsReassociateGatewaySamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_ReassociateGateway.json + */ + /** + * Sample code: Perform failover of the process server. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void performFailoverOfTheProcessServer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationFabrics() + .reassociateGateway( + "MadhaviVault", + "MadhaviVRG", + "GRACE-V2A-1", + new FailoverProcessServerRequest() + .withProperties( + new FailoverProcessServerRequestProperties() + .withContainerName("cloud_1f3c15af-2256-4568-9e06-e1ef4f728f75") + .withSourceProcessServerId("AFA0EC54-1894-4E44-9CAB02DB8854B117") + .withTargetProcessServerId("5D3ED340-85AE-C646-B338641E015DA405") + .withVmsToMigrate(Arrays.asList("Vm1", "Vm2")) + .withUpdateType("ServerLevel")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsRenewCertificateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsRenewCertificateSamples.java new file mode 100644 index 000000000000..f85693206125 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationFabricsRenewCertificateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RenewCertificateInputProperties; + +/** Samples for ReplicationFabrics RenewCertificate. */ +public final class ReplicationFabricsRenewCertificateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_RenewCertificate.json + */ + /** + * Sample code: Renews certificate for the fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void renewsCertificateForTheFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationFabrics() + .renewCertificate( + "vault1", + "resourceGroupPS1", + "cloud1", + new RenewCertificateInput() + .withProperties(new RenewCertificateInputProperties().withRenewCertificateType("Cloud")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsCancelSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsCancelSamples.java new file mode 100644 index 000000000000..2679853eb5ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsCancelSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationJobs Cancel. */ +public final class ReplicationJobsCancelSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Cancel.json + */ + /** + * Sample code: Cancels the specified job. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void cancelsTheSpecifiedJob( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .cancel("vault1", "resourceGroupPS1", "2653c648-fc72-4316-86f3-fdf8eaa0066b", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsExportSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsExportSamples.java new file mode 100644 index 000000000000..7a0779b81e43 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsExportSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobQueryParameter; + +/** Samples for ReplicationJobs Export. */ +public final class ReplicationJobsExportSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Export.json + */ + /** + * Sample code: Exports the details of the Azure Site Recovery jobs of the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void exportsTheDetailsOfTheAzureSiteRecoveryJobsOfTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .export( + "vault1", + "resourceGroupPS1", + new JobQueryParameter() + .withStartTime("2017-04-27T14:26:51.9161395Z") + .withEndTime("2017-05-04T14:26:51.9161395Z") + .withAffectedObjectTypes("") + .withJobStatus(""), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsGetSamples.java new file mode 100644 index 000000000000..4acacec9c0e6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationJobs Get. */ +public final class ReplicationJobsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Get.json + */ + /** + * Sample code: Gets the job details. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheJobDetails( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .getWithResponse("vault1", "resourceGroupPS1", "58776d0b-3141-48b2-a377-9ad863eb160d", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsListSamples.java new file mode 100644 index 000000000000..0db52235d8ac --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationJobs List. */ +public final class ReplicationJobsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_List.json + */ + /** + * Sample code: Gets the list of jobs. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfJobs( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationJobs().list("vault1", "resourceGroupPS1", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsRestartSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsRestartSamples.java new file mode 100644 index 000000000000..e201efdafcdd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsRestartSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationJobs Restart. */ +public final class ReplicationJobsRestartSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Restart.json + */ + /** + * Sample code: Restarts the specified job. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void restartsTheSpecifiedJob( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .restart("vault1", "resourceGroupPS1", "0664564c-353e-401a-ab0c-722257c10e25", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsResumeSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsResumeSamples.java new file mode 100644 index 000000000000..c660791d69d4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationJobsResumeSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParams; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParamsProperties; + +/** Samples for ReplicationJobs Resume. */ +public final class ReplicationJobsResumeSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Resume.json + */ + /** + * Sample code: Resumes the specified job. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resumesTheSpecifiedJob( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationJobs() + .resume( + "vault1", + "resourceGroupPS1", + "58776d0b-3141-48b2-a377-9ad863eb160d", + new ResumeJobParams().withProperties(new ResumeJobParamsProperties().withComments(" ")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetSamples.java new file mode 100644 index 000000000000..edc94db05158 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationLogicalNetworks Get. */ +public final class ReplicationLogicalNetworksGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_Get.json + */ + /** + * Sample code: Gets a logical network with specified server id and logical network name. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationLogicalNetworks() + .getWithResponse( + "vault1", "resourceGroupPS1", "cloud1", "87ab394f-165f-4aa9-bd84-b018500b4509", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.java new file mode 100644 index 000000000000..7950cfe28044 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationLogicalNetworksListByReplicationFabr.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationLogicalNetworks ListByReplicationFabrics. */ +public final class ReplicationLogicalNetworksListByReplicationFabr { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of logical networks under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfLogicalNetworksUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationLogicalNetworks() + .listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsCreateSamples.java new file mode 100644 index 000000000000..a6bdf52b86d8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsCreateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableMigrationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtDiskInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtEnableMigrationInput; +import java.util.Arrays; + +/** Samples for ReplicationMigrationItems Create. */ +public final class ReplicationMigrationItemsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Create.json + */ + /** + * Sample code: Enables migration. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void enablesMigration( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .define("virtualmachine1") + .withExistingReplicationProtectionContainer( + "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1") + .withProperties( + new EnableMigrationInputProperties() + .withPolicyId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1") + .withProviderSpecificDetails( + new VMwareCbtEnableMigrationInput() + .withVmwareMachineId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/machines/virtualmachine1") + .withDisksToInclude( + Arrays + .asList( + new VMwareCbtDiskInput() + .withDiskId("disk1") + .withIsOSDisk("true") + .withLogStorageAccountId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Storage/storageAccounts/logStorageAccount1") + .withLogStorageAccountSasSecretName("fakeTokenPlaceholder"))) + .withDataMoverRunAsAccountId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/dataMoverRunAsAccount1") + .withSnapshotRunAsAccountId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/snapshotRunAsAccount1") + .withTargetResourceGroupId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1") + .withTargetNetworkId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1"))) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsDeleteSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsDeleteSamples.java new file mode 100644 index 000000000000..6c9c0975efe6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsDeleteSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationMigrationItems Delete. */ +public final class ReplicationMigrationItemsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Delete.json + */ + /** + * Sample code: Delete the migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deleteTheMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .delete( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + null, + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsGetSamples.java new file mode 100644 index 000000000000..a66b3b252a9a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationMigrationItems Get. */ +public final class ReplicationMigrationItemsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Get.json + */ + /** + * Sample code: Gets the details of a migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .getWithResponse( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.java new file mode 100644 index 000000000000..40ffb6625f32 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListByReplicationProte.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationMigrationItems ListByReplicationProtectionContainers. */ +public final class ReplicationMigrationItemsListByReplicationProte { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of migration items in the protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfMigrationItemsInTheProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .listByReplicationProtectionContainers( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + null, + null, + null, + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListSamples.java new file mode 100644 index 000000000000..7c3fd1d59347 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationMigrationItems List. */ +public final class ReplicationMigrationItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_List.json + */ + /** + * Sample code: Gets the list of migration items in the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfMigrationItemsInTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationMigrationItems().list("migrationvault", "resourcegroup1", null, null, null, Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsMigrateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsMigrateSamples.java new file mode 100644 index 000000000000..d14f967ce076 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsMigrateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrateInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtMigrateInput; + +/** Samples for ReplicationMigrationItems Migrate. */ +public final class ReplicationMigrationItemsMigrateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Migrate.json + */ + /** + * Sample code: Migrate item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void migrateItem(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .migrate( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new MigrateInput() + .withProperties( + new MigrateInputProperties() + .withProviderSpecificDetails(new VMwareCbtMigrateInput().withPerformShutdown("true"))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.java new file mode 100644 index 000000000000..a609ef0b9745 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsPauseReplicationSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PauseReplicationInputProperties; + +/** Samples for ReplicationMigrationItems PauseReplication. */ +public final class ReplicationMigrationItemsPauseReplicationSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_PauseReplication.json + */ + /** + * Sample code: Pause replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void pauseReplication( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .pauseReplication( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new PauseReplicationInput() + .withProperties(new PauseReplicationInputProperties().withInstanceType("VMwareCbt")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.java new file mode 100644 index 000000000000..420b000a16d5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResumeReplicationSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeReplicationInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResumeReplicationInput; + +/** Samples for ReplicationMigrationItems ResumeReplication. */ +public final class ReplicationMigrationItemsResumeReplicationSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ResumeReplication.json + */ + /** + * Sample code: Resume replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resumeReplication( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .resumeReplication( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new ResumeReplicationInput() + .withProperties( + new ResumeReplicationInputProperties() + .withProviderSpecificDetails( + new VMwareCbtResumeReplicationInput().withDeleteMigrationResources("false"))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResyncSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResyncSamples.java new file mode 100644 index 000000000000..3ca737ea0bf0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsResyncSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResyncInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtResyncInput; + +/** Samples for ReplicationMigrationItems Resync. */ +public final class ReplicationMigrationItemsResyncSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Resync.json + */ + /** + * Sample code: Resynchronizes replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resynchronizesReplication( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .resync( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new ResyncInput() + .withProperties( + new ResyncInputProperties() + .withProviderSpecificDetails(new VMwareCbtResyncInput().withSkipCbtReset("true"))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.java new file mode 100644 index 000000000000..ef34b882172b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateCleanupSamp.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInputProperties; + +/** Samples for ReplicationMigrationItems TestMigrateCleanup. */ +public final class ReplicationMigrationItemsTestMigrateCleanupSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json + */ + /** + * Sample code: Test migrate cleanup. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void testMigrateCleanup( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .testMigrateCleanup( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new TestMigrateCleanupInput() + .withProperties(new TestMigrateCleanupInputProperties().withComments("Test Failover Cleanup")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateSamples.java new file mode 100644 index 000000000000..9f4d3ad8b0e0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsTestMigrateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtTestMigrateInput; + +/** Samples for ReplicationMigrationItems TestMigrate. */ +public final class ReplicationMigrationItemsTestMigrateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrate.json + */ + /** + * Sample code: Test migrate item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void testMigrateItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationMigrationItems() + .testMigrate( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + new TestMigrateInput() + .withProperties( + new TestMigrateInputProperties() + .withProviderSpecificDetails( + new VMwareCbtTestMigrateInput() + .withRecoveryPointId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/9e737191-317e-43d0-8c83-e32ac3b34686") + .withNetworkId( + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1"))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsUpdateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsUpdateSamples.java new file mode 100644 index 000000000000..cec8ae8b6c25 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationMigrationItemsUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMigrationItemInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMwareCbtUpdateMigrationItemInput; + +/** Samples for ReplicationMigrationItems Update. */ +public final class ReplicationMigrationItemsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Update.json + */ + /** + * Sample code: Updates migration item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesMigrationItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + MigrationItem resource = + manager + .replicationMigrationItems() + .getWithResponse( + "migrationvault", + "resourcegroup1", + "vmwarefabric1", + "vmwareContainer1", + "virtualmachine1", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateMigrationItemInputProperties() + .withProviderSpecificDetails(new VMwareCbtUpdateMigrationItemInput())) + .apply(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsCreateSamples.java new file mode 100644 index 000000000000..bd69152b397e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsCreateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateNetworkMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureCreateNetworkMappingInput; + +/** Samples for ReplicationNetworkMappings Create. */ +public final class ReplicationNetworkMappingsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Create.json + */ + /** + * Sample code: Creates network mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createsNetworkMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworkMappings() + .define("corpe2amap") + .withExistingReplicationNetwork( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06") + .withProperties( + new CreateNetworkMappingInputProperties() + .withRecoveryFabricName("Microsoft Azure") + .withRecoveryNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai") + .withFabricSpecificDetails(new VmmToAzureCreateNetworkMappingInput())) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsDeleteSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsDeleteSamples.java new file mode 100644 index 000000000000..d51c80d7a79c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsDeleteSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworkMappings Delete. */ +public final class ReplicationNetworkMappingsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Delete.json + */ + /** + * Sample code: Delete network mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deleteNetworkMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworkMappings() + .delete( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06", + "corpe2amap", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetSamples.java new file mode 100644 index 000000000000..c51d62a3f21f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworkMappings Get. */ +public final class ReplicationNetworkMappingsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Get.json + */ + /** + * Sample code: Gets network mapping by name. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsNetworkMappingByName( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworkMappings() + .getWithResponse( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06", + "corpe2amap", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java new file mode 100644 index 000000000000..0df14178bf26 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListByReplicationNetw.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworkMappings ListByReplicationNetworks. */ +public final class ReplicationNetworkMappingsListByReplicationNetw { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json + */ + /** + * Sample code: Gets all the network mappings under a network. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAllTheNetworkMappingsUnderANetwork( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworkMappings() + .listByReplicationNetworks( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListSamples.java new file mode 100644 index 000000000000..6d99ce9c82a1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworkMappings List. */ +public final class ReplicationNetworkMappingsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_List.json + */ + /** + * Sample code: Gets all the network mappings under a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAllTheNetworkMappingsUnderAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationNetworkMappings().list("srce2avaultbvtaC27", "srcBvte2a14C27", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsUpdateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsUpdateSamples.java new file mode 100644 index 000000000000..a51b152571a0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworkMappingsUpdateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateNetworkMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VmmToAzureUpdateNetworkMappingInput; + +/** Samples for ReplicationNetworkMappings Update. */ +public final class ReplicationNetworkMappingsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Update.json + */ + /** + * Sample code: Updates network mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesNetworkMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + NetworkMapping resource = + manager + .replicationNetworkMappings() + .getWithResponse( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "e2267b5c-2650-49bd-ab3f-d66aae694c06", + "corpe2amap", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateNetworkMappingInputProperties() + .withRecoveryFabricName("Microsoft Azure") + .withRecoveryNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai2") + .withFabricSpecificDetails(new VmmToAzureUpdateNetworkMappingInput())) + .apply(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksGetSamples.java new file mode 100644 index 000000000000..ebaf1f21def6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksGetSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworks Get. */ +public final class ReplicationNetworksGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_Get.json + */ + /** + * Sample code: Gets a network with specified server id and network name. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsANetworkWithSpecifiedServerIdAndNetworkName( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworks() + .getWithResponse( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + "93ce99d7-1219-4914-aa61-73fe5023988e", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.java new file mode 100644 index 000000000000..32f98a8ffae6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListByReplicationFabricsSamp.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworks ListByReplicationFabrics. */ +public final class ReplicationNetworksListByReplicationFabricsSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of networks under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfNetworksUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationNetworks() + .listByReplicationFabrics( + "srce2avaultbvtaC27", + "srcBvte2a14C27", + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListSamples.java new file mode 100644 index 000000000000..7f18011d3503 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationNetworksListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationNetworks List. */ +public final class ReplicationNetworksListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_List.json + */ + /** + * Sample code: Gets the list of networks. View-only API. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfNetworksViewOnlyAPI( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationNetworks().list("srce2avaultbvtaC27", "srcBvte2a14C27", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesCreateSamples.java new file mode 100644 index 000000000000..8f431509e29f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesCreateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreatePolicyInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePolicyInput; + +/** Samples for ReplicationPolicies Create. */ +public final class ReplicationPoliciesCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Create.json + */ + /** + * Sample code: Creates the policy. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createsThePolicy( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationPolicies() + .define("protectionprofile1") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new CreatePolicyInputProperties().withProviderSpecificInput(new HyperVReplicaAzurePolicyInput())) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesDeleteSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesDeleteSamples.java new file mode 100644 index 000000000000..d0dd5dc12b1c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesDeleteSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationPolicies Delete. */ +public final class ReplicationPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Delete.json + */ + /** + * Sample code: Delete the policy. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deleteThePolicy( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationPolicies().delete("vault1", "resourceGroupPS1", "protectionprofile1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesGetSamples.java new file mode 100644 index 000000000000..62e9bb68b00b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationPolicies Get. */ +public final class ReplicationPoliciesGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Get.json + */ + /** + * Sample code: Gets the requested policy. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheRequestedPolicy( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationPolicies().getWithResponse("vault1", "resourceGroupPS1", "protectionprofile1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesListSamples.java new file mode 100644 index 000000000000..494a0c11c396 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationPolicies List. */ +public final class ReplicationPoliciesListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_List.json + */ + /** + * Sample code: Gets the list of replication policies. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfReplicationPolicies( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationPolicies().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesUpdateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesUpdateSamples.java new file mode 100644 index 000000000000..ca61406f11cb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationPoliciesUpdateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePolicyInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Policy; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdatePolicyInputProperties; + +/** Samples for ReplicationPolicies Update. */ +public final class ReplicationPoliciesUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Update.json + */ + /** + * Sample code: Updates the policy. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesThePolicy( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + Policy resource = + manager + .replicationPolicies() + .getWithResponse("vault1", "resourceGroupPS1", "protectionprofile1", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdatePolicyInputProperties().withReplicationProviderSettings(new HyperVReplicaAzurePolicyInput())) + .apply(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetSamples.java new file mode 100644 index 000000000000..f30d1c03f86d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectableItems Get. */ +public final class ReplicationProtectableItemsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_Get.json + */ + /** + * Sample code: Gets the details of a protectable item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAProtectableItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectableItems() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "c0c14913-3d7a-48ea-9531-cc99e0e686e6", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.java new file mode 100644 index 000000000000..2e70d089902d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectableItemsListByReplicationPro.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectableItems ListByReplicationProtectionContainers. */ +public final class ReplicationProtectableItemsListByReplicationPro { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of protectable items. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfProtectableItems( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectableItems() + .listByReplicationProtectionContainers( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + null, + null, + null, + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsAddDisksSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsAddDisksSamples.java new file mode 100644 index 000000000000..fbd1a3746379 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsAddDisksSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AAddDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AVmDiskInputDetails; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddDisksInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationProtectedItems AddDisks. */ +public final class ReplicationProtectedItemsAddDisksSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_AddDisks.json + */ + /** + * Sample code: Add disk(s) for protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addDiskSForProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .addDisks( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new AddDisksInput() + .withProperties( + new AddDisksInputProperties() + .withProviderSpecificDetails( + new A2AAddDisksInput() + .withVmDisks( + Arrays + .asList( + new A2AVmDiskInputDetails() + .withDiskUri( + "https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd") + .withRecoveryAzureStorageAccountId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/recoveryResource/providers/Microsoft.Storage/storageAccounts/recoverystorage") + .withPrimaryStagingAzureStorageAccountId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/primaryResource/providers/Microsoft.Storage/storageAccounts/vmcachestorage"))))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.java new file mode 100644 index 000000000000..8a55301a6f2d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsApplyRecoveryPointSamp.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ApplyRecoveryPointInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureApplyRecoveryPointInput; + +/** Samples for ReplicationProtectedItems ApplyRecoveryPoint. */ +public final class ReplicationProtectedItemsApplyRecoveryPointSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json + */ + /** + * Sample code: Change or apply recovery point. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void changeOrApplyRecoveryPoint( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .applyRecoveryPoint( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new ApplyRecoveryPointInput() + .withProperties( + new ApplyRecoveryPointInputProperties() + .withRecoveryPointId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/e4d05fe9-5dfd-47be-b50b-aad306b2802d") + .withProviderSpecificDetails(new HyperVReplicaAzureApplyRecoveryPointInput())), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsCreateSamples.java new file mode 100644 index 000000000000..5c0d62ba4f6e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsCreateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EnableProtectionInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureEnableProtectionInput; + +/** Samples for ReplicationProtectedItems Create. */ +public final class ReplicationProtectedItemsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Create.json + */ + /** + * Sample code: Enables protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void enablesProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .define("f8491e4f-817a-40dd-a90c-af773978c75b") + .withExistingReplicationProtectionContainer( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179") + .withProperties( + new EnableProtectionInputProperties() + .withPolicyId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1") + .withProtectableItemId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b") + .withProviderSpecificDetails(new HyperVReplicaAzureEnableProtectionInput())) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsDeleteSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsDeleteSamples.java new file mode 100644 index 000000000000..bd6e5ba9603a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsDeleteSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DisableProtectionProviderSpecificInput; + +/** Samples for ReplicationProtectedItems Delete. */ +public final class ReplicationProtectedItemsDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Delete.json + */ + /** + * Sample code: Disables protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void disablesProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .delete( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "c0c14913-3d7a-48ea-9531-cc99e0e686e6", + new DisableProtectionInput() + .withProperties( + new DisableProtectionInputProperties() + .withReplicationProviderInput(new DisableProtectionProviderSpecificInput())), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.java new file mode 100644 index 000000000000..bcbbd49ffcea --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCancelSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems FailoverCancel. */ +public final class ReplicationProtectedItemsFailoverCancelSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCancel.json + */ + /** + * Sample code: Execute cancel failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeCancelFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .failoverCancel( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.java new file mode 100644 index 000000000000..6fa4bc1382e9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsFailoverCommitSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems FailoverCommit. */ +public final class ReplicationProtectedItemsFailoverCommitSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCommit.json + */ + /** + * Sample code: Execute commit failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeCommitFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .failoverCommit( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsGetSamples.java new file mode 100644 index 000000000000..4881f40a337e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems Get. */ +public final class ReplicationProtectedItemsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Get.json + */ + /** + * Sample code: Gets the details of a Replication protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.java new file mode 100644 index 000000000000..a6fa57bf15aa --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListByReplicationProte.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems ListByReplicationProtectionContainers. */ +public final class ReplicationProtectedItemsListByReplicationProte { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of Replication protected items. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfReplicationProtectedItems( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .listByReplicationProtectionContainers( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListSamples.java new file mode 100644 index 000000000000..c313dea44477 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems List. */ +public final class ReplicationProtectedItemsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_List.json + */ + /** + * Sample code: Gets the list of replication protected items. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfReplicationProtectedItems( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectedItems().list("vault1", "resourceGroupPS1", null, null, Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.java new file mode 100644 index 000000000000..78fa475e5ae5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPlannedFailoverSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzurePlannedFailoverProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PlannedFailoverInputProperties; + +/** Samples for ReplicationProtectedItems PlannedFailover. */ +public final class ReplicationProtectedItemsPlannedFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_PlannedFailover.json + */ + /** + * Sample code: Execute planned failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executePlannedFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .plannedFailover( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new PlannedFailoverInput() + .withProperties( + new PlannedFailoverInputProperties() + .withFailoverDirection("PrimaryToRecovery") + .withProviderSpecificDetails(new HyperVReplicaAzurePlannedFailoverProviderInput())), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPurgeSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPurgeSamples.java new file mode 100644 index 000000000000..1beacb43d9da --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsPurgeSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems Purge. */ +public final class ReplicationProtectedItemsPurgeSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Purge.json + */ + /** + * Sample code: Purges protection. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgesProtection( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .purge( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "c0c14913-3d7a-48ea-9531-cc99e0e686e6", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRemoveDisksSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRemoveDisksSamples.java new file mode 100644 index 000000000000..0b064dd1c881 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRemoveDisksSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARemoveDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveDisksInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationProtectedItems RemoveDisks. */ +public final class ReplicationProtectedItemsRemoveDisksSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RemoveDisks.json + */ + /** + * Sample code: Removes disk(s). + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void removesDiskS( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .removeDisks( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new RemoveDisksInput() + .withProperties( + new RemoveDisksInputProperties() + .withProviderSpecificDetails( + new A2ARemoveDisksInput() + .withVmDisksUris( + Arrays.asList("https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd")))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.java new file mode 100644 index 000000000000..80af52eb74e7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsRepairReplicationSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectedItems RepairReplication. */ +public final class ReplicationProtectedItemsRepairReplicationSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RepairReplication.json + */ + /** + * Sample code: Resynchronize or repair replication. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resynchronizeOrRepairReplication( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .repairReplication( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsReprotectSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsReprotectSamples.java new file mode 100644 index 000000000000..3709d17c7418 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsReprotectSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureReprotectInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReverseReplicationInputProperties; + +/** Samples for ReplicationProtectedItems Reprotect. */ +public final class ReplicationProtectedItemsReprotectSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Reprotect.json + */ + /** + * Sample code: Execute Reverse Replication\Reprotect. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeReverseReplicationReprotect( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .reprotect( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new ReverseReplicationInput() + .withProperties( + new ReverseReplicationInputProperties() + .withFailoverDirection("PrimaryToRecovery") + .withProviderSpecificDetails(new HyperVReplicaAzureReprotectInput())), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.java new file mode 100644 index 000000000000..ccdadfb127eb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsResolveHealthErrorsSam.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthError; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResolveHealthInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationProtectedItems ResolveHealthErrors. */ +public final class ReplicationProtectedItemsResolveHealthErrorsSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json + */ + /** + * Sample code: Resolve health errors. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void resolveHealthErrors( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .resolveHealthErrors( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new ResolveHealthInput() + .withProperties( + new ResolveHealthInputProperties() + .withHealthErrors(Arrays.asList(new ResolveHealthError().withHealthErrorId("3:8020")))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.java new file mode 100644 index 000000000000..10660830c660 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsSwitchProviderSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProviderInputProperties; + +/** Samples for ReplicationProtectedItems SwitchProvider. */ +public final class ReplicationProtectedItemsSwitchProviderSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_SwitchProvider.json + */ + /** + * Sample code: Execute switch provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeSwitchProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .switchProvider( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new SwitchProviderInput() + .withProperties( + new SwitchProviderInputProperties() + .withTargetInstanceType("InMageRcm") + .withProviderSpecificDetails( + new InMageAzureV2SwitchProviderInput() + .withTargetVaultId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault2") + .withTargetFabricId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2") + .withTargetApplianceId("5efaa202-e958-435e-8171-706bf735fcc4"))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.java new file mode 100644 index 000000000000..d5d5a27b596d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverCleanupSam.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverCleanupInputProperties; + +/** Samples for ReplicationProtectedItems TestFailoverCleanup. */ +public final class ReplicationProtectedItemsTestFailoverCleanupSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json + */ + /** + * Sample code: Execute test failover cleanup. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeTestFailoverCleanup( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .testFailoverCleanup( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new TestFailoverCleanupInput() + .withProperties(new TestFailoverCleanupInputProperties().withComments("Test Failover Cleanup")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverSamples.java new file mode 100644 index 000000000000..b1a7559cbaf0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsTestFailoverSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureTestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInputProperties; + +/** Samples for ReplicationProtectedItems TestFailover. */ +public final class ReplicationProtectedItemsTestFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailover.json + */ + /** + * Sample code: Execute test failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeTestFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .testFailover( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new TestFailoverInput() + .withProperties( + new TestFailoverInputProperties() + .withFailoverDirection("PrimaryToRecovery") + .withNetworkType("VmNetworkAsInput") + .withNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai") + .withProviderSpecificDetails(new HyperVReplicaAzureTestFailoverInput())), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.java new file mode 100644 index 000000000000..cd79ac64769d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUnplannedFailoverSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInputProperties; + +/** Samples for ReplicationProtectedItems UnplannedFailover. */ +public final class ReplicationProtectedItemsUnplannedFailoverSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UnplannedFailover.json + */ + /** + * Sample code: Execute unplanned failover. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeUnplannedFailover( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .unplannedFailover( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + new UnplannedFailoverInput() + .withProperties( + new UnplannedFailoverInputProperties() + .withFailoverDirection("PrimaryToRecovery") + .withSourceSiteOperations("NotRequired") + .withProviderSpecificDetails(new HyperVReplicaAzureUnplannedFailoverInput())), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.java new file mode 100644 index 000000000000..fe95bab7211c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateApplianceSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.InMageRcmUpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties; + +/** Samples for ReplicationProtectedItems UpdateAppliance. */ +public final class ReplicationProtectedItemsUpdateApplianceSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateAppliance.json + */ + /** + * Sample code: Updates appliance for replication protected Item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesApplianceForReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .updateAppliance( + "Ayan-0106-SA-Vault", + "Ayan-0106-SA-RG", + "Ayan-0106-SA-Vaultreplicationfabric", + "Ayan-0106-SA-Vaultreplicationcontainer", + "idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f", + new UpdateApplianceForReplicationProtectedItemInput() + .withProperties( + new UpdateApplianceForReplicationProtectedItemInputProperties() + .withTargetApplianceId("") + .withProviderSpecificDetails( + new InMageRcmUpdateApplianceForReplicationProtectedItemInput().withRunAsAccountId(""))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.java new file mode 100644 index 000000000000..bfeb7d52cfaf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateMobilityServiceS.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequestProperties; + +/** Samples for ReplicationProtectedItems UpdateMobilityService. */ +public final class ReplicationProtectedItemsUpdateMobilityServiceS { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateMobilityService.json + */ + /** + * Sample code: Update the mobility service on a protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updateTheMobilityServiceOnAProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectedItems() + .updateMobilityService( + "WCUSVault", + "wcusValidations", + "WIN-JKKJ31QI8U2", + "cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0", + "79dd20ab-2b40-11e7-9791-0050568f387e", + new UpdateMobilityServiceRequest() + .withProperties(new UpdateMobilityServiceRequestProperties().withRunAsAccountId("2")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateSamples.java new file mode 100644 index 000000000000..92e454939c34 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectedItemsUpdateSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.HyperVReplicaAzureUpdateReplicationProtectedItemInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.IpConfigInputDetails; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LicenseType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VMNicInputDetails; +import java.util.Arrays; + +/** Samples for ReplicationProtectedItems Update. */ +public final class ReplicationProtectedItemsUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Update.json + */ + /** + * Sample code: Updates the replication protected Item settings. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesTheReplicationProtectedItemSettings( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + ReplicationProtectedItem resource = + manager + .replicationProtectedItems() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "f8491e4f-817a-40dd-a90c-af773978c75b", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateReplicationProtectedItemInputProperties() + .withRecoveryAzureVMName("vm1") + .withRecoveryAzureVMSize("Basic_A0") + .withSelectedRecoveryAzureNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai") + .withVmNics( + Arrays + .asList( + new VMNicInputDetails() + .withNicId( + "TWljcm9zb2Z0OkY4NDkxRTRGLTgxN0EtNDBERC1BOTBDLUFGNzczOTc4Qzc1Qlw3NjAwMzMxRS03NDk4LTQ0QTQtQjdDNy0xQjY1NkJDREQ1MkQ=") + .withIpConfigs( + Arrays + .asList( + new IpConfigInputDetails() + .withIpConfigName("ipconfig1") + .withIsPrimary(true) + .withRecoverySubnetName("subnet1") + .withRecoveryStaticIpAddress("10.0.2.46"))) + .withSelectionType("SelectedByUser"))) + .withLicenseType(LicenseType.WINDOWS_SERVER) + .withProviderSpecificDetails(new HyperVReplicaAzureUpdateReplicationProtectedItemInput())) + .apply(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.java new file mode 100644 index 000000000000..f2a37ac40bc7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsCreateSam.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput; + +/** Samples for ReplicationProtectionContainerMappings Create. */ +public final class ReplicationProtectionContainerMappingsCreateSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Create.json + */ + /** + * Sample code: Create protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .define("cloud1protectionprofile1") + .withExistingReplicationProtectionContainer( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179") + .withProperties( + new CreateProtectionContainerMappingInputProperties() + .withTargetProtectionContainerId("Microsoft Azure") + .withPolicyId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1") + .withProviderSpecificInput(new ReplicationProviderSpecificContainerMappingInput())) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java new file mode 100644 index 000000000000..6e2c388da50a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsDeleteSam.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput; + +/** Samples for ReplicationProtectionContainerMappings Delete. */ +public final class ReplicationProtectionContainerMappingsDeleteSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Delete.json + */ + /** + * Sample code: Remove protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void removeProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .delete( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "cloud1protectionprofile1", + new RemoveProtectionContainerMappingInput() + .withProperties( + new RemoveProtectionContainerMappingInputProperties() + .withProviderSpecificInput(new ReplicationProviderContainerUnmappingInput())), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.java new file mode 100644 index 000000000000..3b909887810f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainerMappings Get. */ +public final class ReplicationProtectionContainerMappingsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Get.json + */ + /** + * Sample code: Gets a protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsAProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "cloud1protectionprofile1", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.java new file mode 100644 index 000000000000..4f26612759ce --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListByRep.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainerMappings ListByReplicationProtectionContainers. */ +public final class ReplicationProtectionContainerMappingsListByRep { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json + */ + /** + * Sample code: Gets the list of protection container mappings for a protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfProtectionContainerMappingsForAProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .listByReplicationProtectionContainers( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.java new file mode 100644 index 000000000000..8c389d6ec587 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsListSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainerMappings List. */ +public final class ReplicationProtectionContainerMappingsListSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_List.json + */ + /** + * Sample code: Gets the list of all protection container mappings in a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfAllProtectionContainerMappingsInAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainerMappings().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.java new file mode 100644 index 000000000000..da44cb07d4a0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsPurgeSamp.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainerMappings Purge. */ +public final class ReplicationProtectionContainerMappingsPurgeSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Purge.json + */ + /** + * Sample code: Purge protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgeProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainerMappings() + .purge( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "cloud1protectionprofile1", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.java new file mode 100644 index 000000000000..13a396ff6e8f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainerMappingsUpdateSam.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2AUpdateContainerMappingInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AgentAutoUpdateStatus; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMapping; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties; + +/** Samples for ReplicationProtectionContainerMappings Update. */ +public final class ReplicationProtectionContainerMappingsUpdateSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Update.json + */ + /** + * Sample code: Update protection container mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updateProtectionContainerMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + ProtectionContainerMapping resource = + manager + .replicationProtectionContainerMappings() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "cloud1", + "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", + "cloud1protectionprofile1", + Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateProtectionContainerMappingInputProperties() + .withProviderSpecificInput( + new A2AUpdateContainerMappingInput() + .withAgentAutoUpdateStatus(AgentAutoUpdateStatus.ENABLED) + .withAutomationAccountArmId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1"))) + .apply(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersCreateSamples.java new file mode 100644 index 000000000000..49174fb5eab1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersCreateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionContainerInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerCreationInput; +import java.util.Arrays; + +/** Samples for ReplicationProtectionContainers Create. */ +public final class ReplicationProtectionContainersCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Create.json + */ + /** + * Sample code: Create a protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createAProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .define("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179") + .withExistingReplicationFabric("vault1", "resourceGroupPS1", "cloud1") + .withProperties( + new CreateProtectionContainerInputProperties() + .withProviderSpecificInput(Arrays.asList(new ReplicationProviderSpecificContainerCreationInput()))) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDeleteSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDeleteSamples.java new file mode 100644 index 000000000000..b19f58c87111 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDeleteSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainers Delete. */ +public final class ReplicationProtectionContainersDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Delete.json + */ + /** + * Sample code: Removes a protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void removesAProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .delete("vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java new file mode 100644 index 000000000000..3caff406f902 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersDiscoverProtecta.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.DiscoverProtectableItemRequestProperties; + +/** Samples for ReplicationProtectionContainers DiscoverProtectableItem. */ +public final class ReplicationProtectionContainersDiscoverProtecta { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json + */ + /** + * Sample code: Adds a protectable item to the replication protection container. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addsAProtectableItemToTheReplicationProtectionContainer( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .discoverProtectableItem( + "MadhaviVault", + "MadhaviVRG", + "V2A-W2K12-660", + "cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c", + new DiscoverProtectableItemRequest() + .withProperties( + new DiscoverProtectableItemRequestProperties() + .withFriendlyName("Test") + .withIpAddress("10.150.2.3") + .withOsType("Windows")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersGetSamples.java new file mode 100644 index 000000000000..6ad1d269c918 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainers Get. */ +public final class ReplicationProtectionContainersGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Get.json + */ + /** + * Sample code: Gets the protection container details. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheProtectionContainerDetails( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .getWithResponse( + "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.java new file mode 100644 index 000000000000..484c8280968d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListByReplicatio.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainers ListByReplicationFabrics. */ +public final class ReplicationProtectionContainersListByReplicatio { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of protection container for a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfProtectionContainerForAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListSamples.java new file mode 100644 index 000000000000..d49c9b13d974 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionContainers List. */ +public final class ReplicationProtectionContainersListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_List.json + */ + /** + * Sample code: Gets the list of all protection containers in a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfAllProtectionContainersInAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionContainers().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.java new file mode 100644 index 000000000000..0cba88661f9f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionContainersSwitchProtection.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ASwitchProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SwitchProtectionInputProperties; + +/** Samples for ReplicationProtectionContainers SwitchProtection. */ +public final class ReplicationProtectionContainersSwitchProtection { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_SwitchProtection.json + */ + /** + * Sample code: Switches protection from one container to another or one replication provider to another. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionContainers() + .switchProtection( + "priyanponeboxvault", + "priyanprg", + "CentralUSCanSite", + "CentralUSCancloud", + new SwitchProtectionInput() + .withProperties( + new SwitchProtectionInputProperties() + .withProviderSpecificDetails(new A2ASwitchProtectionInput())), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsCreateSamples.java new file mode 100644 index 000000000000..39bf2370bff3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsCreateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACreateProtectionIntentInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARecoveryAvailabilityType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProperties; + +/** Samples for ReplicationProtectionIntents Create. */ +public final class ReplicationProtectionIntentsCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Create.json + */ + /** + * Sample code: Create protection intent Resource. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createProtectionIntentResource( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationProtectionIntents() + .define("vm1") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new CreateProtectionIntentProperties() + .withProviderSpecificDetails( + new A2ACreateProtectionIntentInput() + .withFabricObjectId( + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne/providers/Microsoft.Compute/virtualMachines/vmPpgAv5") + .withPrimaryLocation("eastUs2") + .withRecoveryLocation("westus2") + .withRecoverySubscriptionId("ed5bcdf6-d61e-47bd-8ea9-f2bd379a2640") + .withRecoveryAvailabilityType(A2ARecoveryAvailabilityType.SINGLE) + .withRecoveryResourceGroupId( + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne-asr"))) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetSamples.java new file mode 100644 index 000000000000..5048bc79f8d4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionIntents Get. */ +public final class ReplicationProtectionIntentsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Get.json + */ + /** + * Sample code: Gets the details of a Replication protection intent item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAReplicationProtectionIntentItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionIntents().getWithResponse("vault1", "resourceGroupPS1", "vm1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsListSamples.java new file mode 100644 index 000000000000..a0761bd3906e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationProtectionIntentsListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationProtectionIntents List. */ +public final class ReplicationProtectionIntentsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_List.json + */ + /** + * Sample code: Gets the list of replication protection intent objects. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfReplicationProtectionIntentObjects( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationProtectionIntents().list("2007vttp", "resourceGroupPS1", null, null, Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansCreateSamples.java new file mode 100644 index 000000000000..0fc803515db8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansCreateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateRecoveryPlanInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FailoverDeploymentModel; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroup; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProtectedItem; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans Create. */ +public final class ReplicationRecoveryPlansCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Create.json + */ + /** + * Sample code: Creates a recovery plan with the given details. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createsARecoveryPlanWithTheGivenDetails( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .define("RPtest1") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new CreateRecoveryPlanInputProperties() + .withPrimaryFabricId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1") + .withRecoveryFabricId("Microsoft Azure") + .withFailoverDeploymentModel(FailoverDeploymentModel.RESOURCE_MANAGER) + .withGroups( + Arrays + .asList( + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.BOOT) + .withReplicationProtectedItems( + Arrays + .asList( + new RecoveryPlanProtectedItem() + .withId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b") + .withVirtualMachineId("f8491e4f-817a-40dd-a90c-af773978c75b"))) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList())))) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansDeleteSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansDeleteSamples.java new file mode 100644 index 000000000000..5eac8a879ca8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansDeleteSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans Delete. */ +public final class ReplicationRecoveryPlansDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Delete.json + */ + /** + * Sample code: Deletes the specified recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deletesTheSpecifiedRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().delete("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansFailoverCancelSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansFailoverCancelSamples.java new file mode 100644 index 000000000000..136ecb55dda3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansFailoverCancelSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans FailoverCancel. */ +public final class ReplicationRecoveryPlansFailoverCancelSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCancel.json + */ + /** + * Sample code: Execute cancel failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeCancelFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().failoverCancel("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansFailoverCommitSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansFailoverCommitSamples.java new file mode 100644 index 000000000000..9f59d31a3332 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansFailoverCommitSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans FailoverCommit. */ +public final class ReplicationRecoveryPlansFailoverCommitSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCommit.json + */ + /** + * Sample code: Execute commit failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeCommitFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().failoverCommit("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansGetSamples.java new file mode 100644 index 000000000000..cbca500d8441 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans Get. */ +public final class ReplicationRecoveryPlansGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Get.json + */ + /** + * Sample code: Gets the requested recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheRequestedRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().getWithResponse("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansListSamples.java new file mode 100644 index 000000000000..072cca695194 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans List. */ +public final class ReplicationRecoveryPlansListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_List.json + */ + /** + * Sample code: Gets the list of recovery plans. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRecoveryPlans( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.java new file mode 100644 index 000000000000..ffccd5ea6195 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansPlannedFailoverSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans PlannedFailover. */ +public final class ReplicationRecoveryPlansPlannedFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_PlannedFailover.json + */ + /** + * Sample code: Execute planned failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executePlannedFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .plannedFailover( + "vault1", + "resourceGroupPS1", + "RPtest1", + new RecoveryPlanPlannedFailoverInput() + .withProperties( + new RecoveryPlanPlannedFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) + .withProviderSpecificDetails( + Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansReprotectSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansReprotectSamples.java new file mode 100644 index 000000000000..d1737811f2ea --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansReprotectSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryPlans Reprotect. */ +public final class ReplicationRecoveryPlansReprotectSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Reprotect.json + */ + /** + * Sample code: Execute reprotect of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeReprotectOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryPlans().reprotect("vault1", "resourceGroupPS1", "RPtest1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java new file mode 100644 index 000000000000..34b5f3c59b72 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverCleanupSamp.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties; + +/** Samples for ReplicationRecoveryPlans TestFailoverCleanup. */ +public final class ReplicationRecoveryPlansTestFailoverCleanupSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json + */ + /** + * Sample code: Execute test failover cleanup of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeTestFailoverCleanupOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .testFailoverCleanup( + "vault1", + "resourceGroupPS1", + "RPtest1", + new RecoveryPlanTestFailoverCleanupInput() + .withProperties( + new RecoveryPlanTestFailoverCleanupInputProperties().withComments("Test Failover Cleanup")), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverSamples.java new file mode 100644 index 000000000000..52cfea49b417 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansTestFailoverSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans TestFailover. */ +public final class ReplicationRecoveryPlansTestFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailover.json + */ + /** + * Sample code: Execute test failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeTestFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .testFailover( + "vault1", + "resourceGroupPS1", + "RPtest1", + new RecoveryPlanTestFailoverInput() + .withProperties( + new RecoveryPlanTestFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) + .withNetworkType("VmNetworkAsInput") + .withNetworkId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai") + .withProviderSpecificDetails( + Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java new file mode 100644 index 000000000000..fcaf46b44219 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUnplannedFailoverSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PossibleOperationsDirections; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanHyperVReplicaAzureFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SourceSiteOperations; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans UnplannedFailover. */ +public final class ReplicationRecoveryPlansUnplannedFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json + */ + /** + * Sample code: Execute unplanned failover of the recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void executeUnplannedFailoverOfTheRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryPlans() + .unplannedFailover( + "vault1", + "resourceGroupPS1", + "RPtest1", + new RecoveryPlanUnplannedFailoverInput() + .withProperties( + new RecoveryPlanUnplannedFailoverInputProperties() + .withFailoverDirection(PossibleOperationsDirections.PRIMARY_TO_RECOVERY) + .withSourceSiteOperations(SourceSiteOperations.REQUIRED) + .withProviderSpecificDetails( + Arrays.asList(new RecoveryPlanHyperVReplicaAzureFailoverInput()))), + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUpdateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUpdateSamples.java new file mode 100644 index 000000000000..e159515fa840 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryPlansUpdateSamples.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlan; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroup; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanGroupType; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProtectedItem; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateRecoveryPlanInputProperties; +import java.util.Arrays; + +/** Samples for ReplicationRecoveryPlans Update. */ +public final class ReplicationRecoveryPlansUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Update.json + */ + /** + * Sample code: Updates the given recovery plan. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesTheGivenRecoveryPlan( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + RecoveryPlan resource = + manager + .replicationRecoveryPlans() + .getWithResponse("vault1", "resourceGroupPS1", "RPtest1", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new UpdateRecoveryPlanInputProperties() + .withGroups( + Arrays + .asList( + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.SHUTDOWN) + .withReplicationProtectedItems(Arrays.asList()) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList()), + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.FAILOVER) + .withReplicationProtectedItems(Arrays.asList()) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList()), + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.BOOT) + .withReplicationProtectedItems( + Arrays + .asList( + new RecoveryPlanProtectedItem() + .withId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b") + .withVirtualMachineId("f8491e4f-817a-40dd-a90c-af773978c75b"))) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList()), + new RecoveryPlanGroup() + .withGroupType(RecoveryPlanGroupType.BOOT) + .withReplicationProtectedItems( + Arrays + .asList( + new RecoveryPlanProtectedItem() + .withId( + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6") + .withVirtualMachineId("c0c14913-3d7a-48ea-9531-cc99e0e686e6"))) + .withStartGroupActions(Arrays.asList()) + .withEndGroupActions(Arrays.asList())))) + .apply(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.java new file mode 100644 index 000000000000..8c9cc0c342db --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersCreateSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.IdentityProviderInput; + +/** Samples for ReplicationRecoveryServicesProviders Create. */ +public final class ReplicationRecoveryServicesProvidersCreateSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Create.json + */ + /** + * Sample code: Adds a recovery services provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addsARecoveryServicesProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .define("vmwareprovider1") + .withExistingReplicationFabric("migrationvault", "resourcegroup1", "vmwarefabric1") + .withProperties( + new AddRecoveryServicesProviderInputProperties() + .withMachineName("vmwareprovider1") + .withAuthenticationIdentityInput( + new IdentityProviderInput() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("f66fce08-c0c6-47a1-beeb-0ede5ea94f90") + .withObjectId("141360b8-5686-4240-a027-5e24e6affeba") + .withAudience("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874") + .withAadAuthority("https://login.microsoftonline.com")) + .withResourceAccessIdentityInput( + new IdentityProviderInput() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("f66fce08-c0c6-47a1-beeb-0ede5ea94f90") + .withObjectId("141360b8-5686-4240-a027-5e24e6affeba") + .withAudience("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874") + .withAadAuthority("https://login.microsoftonline.com"))) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.java new file mode 100644 index 000000000000..73b81d04125f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersDeleteSampl.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders Delete. */ +public final class ReplicationRecoveryServicesProvidersDeleteSampl { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Delete.json + */ + /** + * Sample code: Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is + * unsupported. To maintain backward compatibility for released clients the object "deleteRspInput" is used (if the + * object is empty we assume that it is old client and continue the old behavior). + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void + deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .delete("vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.java new file mode 100644 index 000000000000..8e798f21d37d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders Get. */ +public final class ReplicationRecoveryServicesProvidersGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Get.json + */ + /** + * Sample code: Gets the details of a recovery services provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfARecoveryServicesProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .getWithResponse( + "vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.java new file mode 100644 index 000000000000..04c55161ec4f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListByRepli.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders ListByReplicationFabrics. */ +public final class ReplicationRecoveryServicesProvidersListByRepli { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of registered recovery services providers for the fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .listByReplicationFabrics("vault1", "resourceGroupPS1", "cloud1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.java new file mode 100644 index 000000000000..9b7362e32717 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders List. */ +public final class ReplicationRecoveryServicesProvidersListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_List.json + */ + /** + * Sample code: Gets the list of registered recovery services providers in the vault. This is a view only api. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationRecoveryServicesProviders().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.java new file mode 100644 index 000000000000..c5fb18eef6af --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersPurgeSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders Purge. */ +public final class ReplicationRecoveryServicesProvidersPurgeSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Purge.json + */ + /** + * Sample code: Purges recovery service provider from fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void purgesRecoveryServiceProviderFromFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .purge("vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.java new file mode 100644 index 000000000000..c953ca1ef1d8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationRecoveryServicesProvidersRefreshProv.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationRecoveryServicesProviders RefreshProvider. */ +public final class ReplicationRecoveryServicesProvidersRefreshProv { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json + */ + /** + * Sample code: Refresh details from the recovery services provider. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void refreshDetailsFromTheRecoveryServicesProvider( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationRecoveryServicesProviders() + .refreshProvider( + "vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsCreateS.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsCreateS.java new file mode 100644 index 000000000000..795ad842cc99 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsCreateS.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageMappingInputProperties; + +/** Samples for ReplicationStorageClassificationMappings Create. */ +public final class ReplicationStorageClassificationMappingsCreateS { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Create.json + */ + /** + * Sample code: Create storage classification mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void createStorageClassificationMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassificationMappings() + .define("testStorageMapping") + .withExistingReplicationStorageClassification( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09") + .withProperties( + new StorageMappingInputProperties() + .withTargetStorageClassificationId( + "/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09")) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsDeleteS.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsDeleteS.java new file mode 100644 index 000000000000..f54cbbf03e94 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsDeleteS.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassificationMappings Delete. */ +public final class ReplicationStorageClassificationMappingsDeleteS { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Delete.json + */ + /** + * Sample code: Delete a storage classification mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void deleteAStorageClassificationMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassificationMappings() + .delete( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09", + "testStorageMapping", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsGetSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsGetSamp.java new file mode 100644 index 000000000000..c85494b2b775 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsGetSamp.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassificationMappings Get. */ +public final class ReplicationStorageClassificationMappingsGetSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Get.json + */ + /** + * Sample code: Gets the details of a storage classification mapping. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAStorageClassificationMapping( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassificationMappings() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09", + "testStorageMapping", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsListByR.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsListByR.java new file mode 100644 index 000000000000..eea061b9718b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsListByR.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassificationMappings ListByReplicationStorageClassifications. */ +public final class ReplicationStorageClassificationMappingsListByR { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json + */ + /** + * Sample code: Gets the list of storage classification mappings objects under a storage. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationMappingsObjectsUnderAStorage( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassificationMappings() + .listByReplicationStorageClassifications( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsListSam.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsListSam.java new file mode 100644 index 000000000000..ea860f27c03a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationMappingsListSam.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassificationMappings List. */ +public final class ReplicationStorageClassificationMappingsListSam { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_List.json + */ + /** + * Sample code: Gets the list of storage classification mappings objects under a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationMappingsObjectsUnderAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationStorageClassificationMappings().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsGetSamples.java new file mode 100644 index 000000000000..26f97048b16d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsGetSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassifications Get. */ +public final class ReplicationStorageClassificationsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_Get.json + */ + /** + * Sample code: Gets the details of a storage classification. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAStorageClassification( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassifications() + .getWithResponse( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + "8891569e-aaef-4a46-a4a0-78c14f2d7b09", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsListByReplicat.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsListByReplicat.java new file mode 100644 index 000000000000..620c9e8e5a4f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsListByReplicat.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassifications ListByReplicationFabrics. */ +public final class ReplicationStorageClassificationsListByReplicat { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of storage classification objects under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationObjectsUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationStorageClassifications() + .listByReplicationFabrics( + "vault1", + "resourceGroupPS1", + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsListSamples.java new file mode 100644 index 000000000000..0ef7b6cd3d71 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationStorageClassificationsListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationStorageClassifications List. */ +public final class ReplicationStorageClassificationsListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_List.json + */ + /** + * Sample code: Gets the list of storage classification objects under a vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfStorageClassificationObjectsUnderAVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationStorageClassifications().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultHealthGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultHealthGetSamples.java new file mode 100644 index 000000000000..06e1bcc561cc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultHealthGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationVaultHealth Get. */ +public final class ReplicationVaultHealthGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Get.json + */ + /** + * Sample code: Gets the health summary for the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheHealthSummaryForTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationVaultHealths().getWithResponse("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultHealthRefreshSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultHealthRefreshSamples.java new file mode 100644 index 000000000000..742069e21dbd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultHealthRefreshSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationVaultHealth Refresh. */ +public final class ReplicationVaultHealthRefreshSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Refresh.json + */ + /** + * Sample code: Refreshes health summary of the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void refreshesHealthSummaryOfTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationVaultHealths().refresh("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingCreateSamples.java new file mode 100644 index 000000000000..5d65360667a5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingCreateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInputProperties; + +/** Samples for ReplicationVaultSetting Create. */ +public final class ReplicationVaultSettingCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Create.json + */ + /** + * Sample code: Updates vault setting. A vault setting object is a singleton per vault and it is always present by + * default. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationVaultSettings() + .define("default") + .withExistingVault("vault1", "resourceGroupPS1") + .withProperties( + new VaultSettingCreationInputProperties() + .withMigrationSolutionId( + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.Migrate/MigrateProjects/resourceGroupPS1-MigrateProject/Solutions/Servers-Migration-ServerMigration")) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingGetSamples.java new file mode 100644 index 000000000000..b34accc67d07 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationVaultSetting Get. */ +public final class ReplicationVaultSettingGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Get.json + */ + /** + * Sample code: Gets the vault setting. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheVaultSetting( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationVaultSettings().getWithResponse("vault1", "resourceGroupPS1", "default", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingListSamples.java new file mode 100644 index 000000000000..bad0f84124da --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationVaultSettingListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationVaultSetting List. */ +public final class ReplicationVaultSettingListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_List.json + */ + /** + * Sample code: Gets the list of vault setting. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfVaultSetting( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationVaultSettings().list("vault1", "resourceGroupPS1", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersCreateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersCreateSamples.java new file mode 100644 index 000000000000..207a47a72792 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersCreateSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AddVCenterRequestProperties; + +/** Samples for ReplicationvCenters Create. */ +public final class ReplicationvCentersCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Create.json + */ + /** + * Sample code: Add vCenter. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void addVCenter(com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationvCenters() + .define("esx-78") + .withExistingReplicationFabric("MadhaviVault", "MadhaviVRG", "MadhaviFabric") + .withProperties( + new AddVCenterRequestProperties() + .withFriendlyName("esx-78") + .withIpAddress("inmtest78") + .withProcessServerId("5A720CAB-39CB-F445-BD1662B0B33164B5") + .withPort("443") + .withRunAsAccountId("2")) + .create(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersDeleteSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersDeleteSamples.java new file mode 100644 index 000000000000..1fd9f3ddcbc1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersDeleteSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationvCenters Delete. */ +public final class ReplicationvCentersDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Delete.json + */ + /** + * Sample code: Remove vCenter operation. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void removeVCenterOperation( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationvCenters().delete("MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersGetSamples.java new file mode 100644 index 000000000000..a7f8497ffc4a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationvCenters Get. */ +public final class ReplicationvCentersGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Get.json + */ + /** + * Sample code: Gets the details of a vCenter. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDetailsOfAVCenter( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationvCenters() + .getWithResponse("MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.java new file mode 100644 index 000000000000..80e77bd60a69 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListByReplicationFabricsSamp.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationvCenters ListByReplicationFabrics. */ +public final class ReplicationvCentersListByReplicationFabricsSamp { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_ListByReplicationFabrics.json + */ + /** + * Sample code: Gets the list of vCenter registered under a fabric. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfVCenterRegisteredUnderAFabric( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .replicationvCenters() + .listByReplicationFabrics("MadhaviVault", "MadhaviVRG", "MadhaviFabric", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListSamples.java new file mode 100644 index 000000000000..0bfda49e5d30 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersListSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for ReplicationvCenters List. */ +public final class ReplicationvCentersListSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_List.json + */ + /** + * Sample code: Gets the list of vCenter registered under the vault. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfVCenterRegisteredUnderTheVault( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.replicationvCenters().list("MadhaviVault", "MadhaviVRG", Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersUpdateSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersUpdateSamples.java new file mode 100644 index 000000000000..b78c274f8ac1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/ReplicationvCentersUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateVCenterRequestProperties; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenter; + +/** Samples for ReplicationvCenters Update. */ +public final class ReplicationvCentersUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Update.json + */ + /** + * Sample code: Update vCenter operation. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void updateVCenterOperation( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + VCenter resource = + manager + .replicationvCenters() + .getWithResponse("MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", Context.NONE) + .getValue(); + resource.update().withProperties(new UpdateVCenterRequestProperties().withIpAddress("10.150.109.25")).apply(); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/SupportedOperatingSystemsOperationGetSamples.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/SupportedOperatingSystemsOperationGetSamples.java new file mode 100644 index 000000000000..5d66a5e8bee6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/SupportedOperatingSystemsOperationGetSamples.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for SupportedOperatingSystemsOperation Get. */ +public final class SupportedOperatingSystemsOperationGetSamples { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/SupportedOperatingSystems_Get.json + */ + /** + * Sample code: Gets the data of supported operating systems by SRS. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheDataOfSupportedOperatingSystemsBySRS( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager.supportedOperatingSystemsOperations().getWithResponse("vault1", "resourceGroupPS1", null, Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.java new file mode 100644 index 000000000000..8096bca5f7ef --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/samples/java/com/azure/resourcemanager/recoveryservicessiterecovery/generated/TargetComputeSizesListByReplicationProtectedIte.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.recoveryservicessiterecovery.generated; + +import com.azure.core.util.Context; + +/** Samples for TargetComputeSizes ListByReplicationProtectedItems. */ +public final class TargetComputeSizesListByReplicationProtectedIte { + /* + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json + */ + /** + * Sample code: Gets the list of target compute sizes for the replication protected item. + * + * @param manager Entry point to SiteRecoveryManager. + */ + public static void getsTheListOfTargetComputeSizesForTheReplicationProtectedItem( + com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) { + manager + .targetComputeSizes() + .listByReplicationProtectedItems( + "avraiMgDiskVault", + "avraiMgDiskVaultRG", + "asr-a2a-default-centraluseuap", + "asr-a2a-default-centraluseuap-container", + "468c912d-b1ab-4ea2-97eb-4b5095155db2", + Context.NONE); + } +} diff --git a/sdk/recoveryservicessiterecovery/ci.yml b/sdk/recoveryservicessiterecovery/ci.yml new file mode 100644 index 000000000000..d3925cf1f278 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/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/recoveryservicessiterecovery/ci.yml + - sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/ + exclude: + - sdk/recoveryservicessiterecovery/pom.xml + - sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicessiterecovery/ci.yml + - sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/ + exclude: + - sdk/recoveryservicessiterecovery/pom.xml + - sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml + +parameters: + - name: release_azureresourcemanagerrecoveryservicessiterecovery + displayName: azure-resourcemanager-recoveryservicessiterecovery + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recoveryservicessiterecovery + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-recoveryservicessiterecovery + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerrecoveryservicessiterecovery + releaseInBatch: ${{ parameters.release_azureresourcemanagerrecoveryservicessiterecovery }} diff --git a/sdk/recoveryservicessiterecovery/pom.xml b/sdk/recoveryservicessiterecovery/pom.xml new file mode 100644 index 000000000000..853c4dccc16a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-recoveryservicessiterecovery-service + pom + 1.0.0 + + + azure-resourcemanager-recoveryservicessiterecovery + +