From b69e086f65eb53ba83fe98496b889ad28565f3aa Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 22 Apr 2021 13:41:18 +0000 Subject: [PATCH] CodeGen from PR 13889 in Azure/azure-rest-api-specs Merge c390e767eac05bd1bde66ec2e771cb5278ef189f into 4328af2265396d332b54464b62b8561ed6f44cae --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 99 + .../pom.xml | 67 + .../SiteRecoveryManager.java | 550 ++ .../fluent/MigrationRecoveryPointsClient.java | 107 + .../fluent/OperationsClient.java | 39 + .../fluent/RecoveryPointsClient.java | 107 + .../ReplicationAlertSettingsClient.java | 110 + ...ionEligibilityResultsOperationsClient.java | 74 + .../fluent/ReplicationEventsClient.java | 73 + .../fluent/ReplicationFabricsClient.java | 528 ++ .../fluent/ReplicationJobsClient.java | 330 + .../ReplicationLogicalNetworksClient.java | 79 + .../ReplicationMigrationItemsClient.java | 727 ++ .../ReplicationNetworkMappingsClient.java | 401 + .../fluent/ReplicationNetworksClient.java | 105 + .../fluent/ReplicationPoliciesClient.java | 263 + .../ReplicationProtectableItemsClient.java | 98 + .../ReplicationProtectedItemsClient.java | 1665 ++++ ...tionProtectionContainerMappingsClient.java | 503 + ...ReplicationProtectionContainersClient.java | 450 + .../ReplicationProtectionIntentsClient.java | 111 + .../ReplicationRecoveryPlansClient.java | 716 ++ ...cationRecoveryServicesProvidersClient.java | 390 + ...onStorageClassificationMappingsClient.java | 312 + ...plicationStorageClassificationsClient.java | 112 + .../fluent/ReplicationVaultHealthsClient.java | 99 + .../ReplicationVaultSettingsClient.java | 110 + .../fluent/ReplicationvCentersClient.java | 347 + .../fluent/SiteRecoveryManagementClient.java | 235 + ...ortedOperatingSystemsOperationsClient.java | 44 + .../fluent/TargetComputeSizesClient.java | 58 + .../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 | 176 + .../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 + ...tionEligibilityResultsCollectionInner.java | 55 + .../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 | 178 + .../implementation/JobImpl.java | 50 + .../implementation/LogicalNetworkImpl.java | 50 + .../implementation/MigrationItemImpl.java | 279 + .../MigrationRecoveryPointImpl.java | 50 + .../MigrationRecoveryPointsClientImpl.java | 716 ++ .../MigrationRecoveryPointsImpl.java | 122 + .../implementation/NetworkImpl.java | 50 + .../implementation/NetworkMappingImpl.java | 188 + .../implementation/OperationsClientImpl.java | 319 + .../OperationsDiscoveryImpl.java | 46 + .../implementation/OperationsImpl.java | 48 + .../implementation/PolicyImpl.java | 161 + .../implementation/ProtectableItemImpl.java | 50 + .../ProtectionContainerImpl.java | 185 + .../ProtectionContainerMappingImpl.java | 222 + .../implementation/RecoveryPlanImpl.java | 236 + .../implementation/RecoveryPointImpl.java | 50 + .../RecoveryPointsClientImpl.java | 729 ++ .../implementation/RecoveryPointsImpl.java | 127 + .../RecoveryServicesProviderImpl.java | 157 + .../ReplicationAlertSettingsClientImpl.java | 726 ++ .../ReplicationAlertSettingsImpl.java | 135 + ...ationEligibilityResultsCollectionImpl.java | 48 + .../ReplicationEligibilityResultsImpl.java | 46 + ...ligibilityResultsOperationsClientImpl.java | 401 + ...ationEligibilityResultsOperationsImpl.java | 89 + .../ReplicationEventsClientImpl.java | 543 ++ .../implementation/ReplicationEventsImpl.java | 73 + .../ReplicationFabricsClientImpl.java | 2550 +++++ .../ReplicationFabricsImpl.java | 238 + .../ReplicationJobsClientImpl.java | 1692 ++++ .../implementation/ReplicationJobsImpl.java | 154 + .../ReplicationLogicalNetworksClientImpl.java | 556 ++ .../ReplicationLogicalNetworksImpl.java | 81 + .../ReplicationMigrationItemsClientImpl.java | 3620 +++++++ .../ReplicationMigrationItemsImpl.java | 534 ++ .../ReplicationNetworkMappingsClientImpl.java | 2063 ++++ .../ReplicationNetworkMappingsImpl.java | 318 + .../ReplicationNetworksClientImpl.java | 822 ++ .../ReplicationNetworksImpl.java | 87 + .../ReplicationPoliciesClientImpl.java | 1380 +++ .../ReplicationPoliciesImpl.java | 197 + ...ReplicationProtectableItemsClientImpl.java | 687 ++ .../ReplicationProtectableItemsImpl.java | 104 + .../ReplicationProtectedItemImpl.java | 511 + .../ReplicationProtectedItemsClientImpl.java | 8330 +++++++++++++++++ .../ReplicationProtectedItemsImpl.java | 899 ++ ...ProtectionContainerMappingsClientImpl.java | 2578 +++++ ...cationProtectionContainerMappingsImpl.java | 277 + ...icationProtectionContainersClientImpl.java | 2349 +++++ .../ReplicationProtectionContainersImpl.java | 278 + .../ReplicationProtectionIntentImpl.java | 130 + ...eplicationProtectionIntentsClientImpl.java | 733 ++ .../ReplicationProtectionIntentsImpl.java | 141 + .../ReplicationRecoveryPlansClientImpl.java | 3317 +++++++ .../ReplicationRecoveryPlansImpl.java | 359 + ...onRecoveryServicesProvidersClientImpl.java | 2100 +++++ ...licationRecoveryServicesProvidersImpl.java | 213 + ...orageClassificationMappingsClientImpl.java | 1842 ++++ ...tionStorageClassificationMappingsImpl.java | 398 + ...ationStorageClassificationsClientImpl.java | 849 ++ ...ReplicationStorageClassificationsImpl.java | 96 + .../ReplicationVaultHealthsClientImpl.java | 483 + .../ReplicationVaultHealthsImpl.java | 80 + .../ReplicationVaultSettingsClientImpl.java | 726 ++ .../ReplicationVaultSettingsImpl.java | 135 + .../ReplicationvCentersClientImpl.java | 1853 ++++ .../ReplicationvCentersImpl.java | 248 + .../SiteRecoveryManagementClientBuilder.java | 146 + .../SiteRecoveryManagementClientImpl.java | 657 ++ .../StorageClassificationImpl.java | 50 + .../StorageClassificationMappingImpl.java | 161 + .../SupportedOperatingSystemsImpl.java | 50 + ...dOperatingSystemsOperationsClientImpl.java | 227 + ...pportedOperatingSystemsOperationsImpl.java | 62 + .../implementation/TargetComputeSizeImpl.java | 46 + .../TargetComputeSizesClientImpl.java | 446 + .../TargetComputeSizesImpl.java | 71 + .../implementation/Utils.java | 204 + .../implementation/VCenterImpl.java | 168 + .../VaultHealthDetailsImpl.java | 50 + .../implementation/VaultSettingImpl.java | 129 + .../implementation/package-info.java | 6 + .../models/A2AAddDisksInput.java | 89 + .../models/A2AApplyRecoveryPointInput.java | 29 + .../models/A2AContainerCreationInput.java | 29 + .../models/A2AContainerMappingInput.java | 82 + .../A2ACreateProtectionIntentInput.java | 597 ++ .../models/A2AEnableProtectionInput.java | 404 + .../models/A2AEventDetails.java | 186 + .../models/A2AFailoverProviderInput.java | 87 + .../models/A2APolicyCreationInput.java | 144 + .../models/A2APolicyDetails.java | 161 + .../models/A2AProtectedDiskDetails.java | 580 ++ .../A2AProtectedManagedDiskDetails.java | 717 ++ .../A2AProtectionContainerMappingDetails.java | 134 + .../A2AProtectionIntentDiskInputDetails.java | 116 + ...otectionIntentManagedDiskInputDetails.java | 232 + .../models/A2ARecoveryAvailabilityType.java | 37 + .../models/A2ARecoveryPointDetails.java | 83 + .../models/A2ARemoveDisksInput.java | 83 + .../models/A2AReplicationDetails.java | 1079 +++ .../models/A2AReplicationIntentDetails.java | 613 ++ .../models/A2AReprotectInput.java | 190 + .../models/A2ARpRecoveryPointType.java | 41 + .../models/A2ASwitchProtectionInput.java | 300 + .../models/A2ATestFailoverInput.java | 87 + .../models/A2AUnplannedFailoverInput.java | 88 + .../models/A2AUnprotectedDiskDetails.java | 50 + .../A2AUpdateContainerMappingInput.java | 82 + ...2AUpdateReplicationProtectedItemInput.java | 222 + .../models/A2AVmDiskDetails.java | 102 + .../models/A2AVmDiskInputDetails.java | 102 + .../models/A2AVmManagedDiskDetails.java | 209 + .../models/A2AVmManagedDiskInputDetails.java | 216 + .../models/A2AVmManagedDiskUpdateDetails.java | 183 + .../models/AddDisksInput.java | 53 + .../models/AddDisksInputProperties.java | 60 + .../models/AddDisksProviderSpecificInput.java | 33 + .../AddRecoveryServicesProviderInput.java | 58 + ...coveryServicesProviderInputProperties.java | 184 + .../models/AddVCenterRequest.java | 53 + .../models/AddVCenterRequestProperties.java | 154 + .../models/AgentAutoUpdateStatus.java | 34 + .../models/AgentDetails.java | 103 + .../models/AgentDiskDetails.java | 99 + .../models/AgentUpgradeBlockedReason.java | 73 + .../models/AgentVersionStatus.java | 43 + .../models/Alert.java | 134 + .../models/AlertCollection.java | 81 + .../models/AlertProperties.java | 103 + .../AlternateLocationRecoveryOption.java | 34 + .../models/ApplyRecoveryPointInput.java | 53 + .../ApplyRecoveryPointInputProperties.java | 80 + ...plyRecoveryPointProviderSpecificInput.java | 38 + .../models/AsrJobDetails.java | 37 + .../models/AsrTask.java | 357 + .../models/AutoProtectionOfDataDisk.java | 34 + .../AutoProtectionOfDataDiskStatus.java | 34 + .../models/AutomationRunbookTaskDetails.java | 264 + .../models/AzureFabricCreationInput.java | 56 + .../models/AzureFabricSpecificDetails.java | 83 + ...AzureToAzureCreateNetworkMappingInput.java | 56 + .../AzureToAzureNetworkMappingSettings.java | 82 + ...AzureToAzureUpdateNetworkMappingInput.java | 56 + .../AzureToAzureVmSyncedConfigDetails.java | 81 + .../models/AzureVmDiskDetails.java | 258 + .../models/ComputeSizeErrorDetails.java | 76 + .../models/ConfigurationSettings.java | 38 + .../models/ConfigureAlertRequest.java | 53 + .../ConfigureAlertRequestProperties.java | 103 + .../models/ConsistencyCheckTaskDetails.java | 60 + .../models/CreateNetworkMappingInput.java | 53 + .../CreateNetworkMappingInputProperties.java | 106 + .../models/CreatePolicyInput.java | 53 + .../models/CreatePolicyInputProperties.java | 53 + .../CreateProtectionContainerInput.java | 53 + ...ateProtectionContainerInputProperties.java | 55 + ...CreateProtectionContainerMappingInput.java | 54 + ...ectionContainerMappingInputProperties.java | 108 + .../models/CreateProtectionIntentInput.java | 53 + .../CreateProtectionIntentProperties.java | 58 + ...otectionIntentProviderSpecificDetails.java | 34 + .../models/CreateRecoveryPlanInput.java | 58 + .../CreateRecoveryPlanInputProperties.java | 180 + .../models/CurrentJobDetails.java | 103 + .../models/CurrentScenarioDetails.java | 103 + .../models/DataStore.java | 154 + .../models/DataSyncStatus.java | 34 + .../models/DisableProtectionInput.java | 53 + .../DisableProtectionInputProperties.java | 84 + ...isableProtectionProviderSpecificInput.java | 33 + .../models/DisableProtectionReason.java | 34 + .../DiscoverProtectableItemRequest.java | 53 + ...coverProtectableItemRequestProperties.java | 102 + .../models/DiskAccountType.java | 37 + .../models/DiskDetails.java | 128 + .../models/DiskEncryptionInfo.java | 82 + .../models/DiskEncryptionKeyInfo.java | 76 + .../models/DiskType.java | 37 + .../models/DiskVolumeDetails.java | 76 + .../models/Display.java | 178 + .../models/DraDetails.java | 119 + .../models/EnableMigrationInput.java | 57 + .../EnableMigrationInputProperties.java | 91 + .../EnableMigrationProviderSpecificInput.java | 33 + .../models/EnableProtectionInput.java | 53 + .../EnableProtectionInputProperties.java | 113 + ...EnableProtectionProviderSpecificInput.java | 40 + .../models/EncryptionDetails.java | 103 + .../models/EthernetAddressType.java | 34 + .../models/Event.java | 52 + .../models/EventCollection.java | 81 + .../models/EventProperties.java | 300 + .../models/EventProviderSpecificDetails.java | 41 + .../models/EventSpecificDetails.java | 33 + .../models/ExistingProtectionProfile.java | 62 + .../ExistingRecoveryAvailabilitySet.java | 59 + ...istingRecoveryProximityPlacementGroup.java | 60 + .../models/ExistingRecoveryResourceGroup.java | 56 + .../ExistingRecoveryVirtualNetwork.java | 91 + .../models/ExistingStorageAccount.java | 62 + .../models/ExportJobDetails.java | 90 + .../models/Fabric.java | 236 + .../models/FabricCollection.java | 81 + .../models/FabricCreationInput.java | 53 + .../models/FabricCreationInputProperties.java | 53 + .../models/FabricProperties.java | 245 + .../FabricReplicationGroupTaskDetails.java | 111 + ...bricSpecificCreateNetworkMappingInput.java | 37 + .../models/FabricSpecificCreationInput.java | 37 + .../models/FabricSpecificDetails.java | 40 + ...bricSpecificUpdateNetworkMappingInput.java | 37 + .../models/FailoverDeploymentModel.java | 37 + .../models/FailoverJobDetails.java | 69 + .../models/FailoverProcessServerRequest.java | 53 + ...ailoverProcessServerRequestProperties.java | 155 + ...iloverReplicationProtectedItemDetails.java | 259 + .../models/GroupTaskDetails.java | 70 + .../models/HealthError.java | 430 + .../models/HealthErrorCategory.java | 49 + .../HealthErrorCustomerResolvability.java | 34 + .../models/HealthErrorSummary.java | 216 + .../models/HyperVReplica2012EventDetails.java | 134 + .../HyperVReplica2012R2EventDetails.java | 134 + ...rVReplicaAzureApplyRecoveryPointInput.java | 108 + ...perVReplicaAzureEnableProtectionInput.java | 511 + .../HyperVReplicaAzureEventDetails.java | 108 + ...perVReplicaAzureFailbackProviderInput.java | 109 + ...perVReplicaAzureFailoverProviderInput.java | 137 + .../HyperVReplicaAzurePolicyDetails.java | 199 + .../models/HyperVReplicaAzurePolicyInput.java | 175 + .../HyperVReplicaAzureReplicationDetails.java | 734 ++ .../HyperVReplicaAzureReprotectInput.java | 186 + ...HyperVReplicaAzureRpRecoveryPointType.java | 39 + .../HyperVReplicaAzureTestFailoverInput.java | 137 + ...erVReplicaAzureUnplannedFailoverInput.java | 137 + ...reUpdateReplicationProtectedItemInput.java | 196 + .../models/HyperVReplicaBaseEventDetails.java | 134 + .../HyperVReplicaBasePolicyDetails.java | 297 + .../HyperVReplicaBaseReplicationDetails.java | 224 + .../HyperVReplicaBluePolicyDetails.java | 323 + .../models/HyperVReplicaBluePolicyInput.java | 320 + .../HyperVReplicaBlueReplicationDetails.java | 224 + .../models/HyperVReplicaPolicyDetails.java | 297 + .../models/HyperVReplicaPolicyInput.java | 294 + .../HyperVReplicaReplicationDetails.java | 224 + .../models/HyperVSiteDetails.java | 29 + .../models/HyperVVirtualMachineDetails.java | 228 + .../models/IdentityProviderDetails.java | 170 + .../models/IdentityProviderInput.java | 197 + .../models/InMageAgentDetails.java | 129 + .../InMageAzureV2ApplyRecoveryPointInput.java | 56 + .../models/InMageAzureV2DiskInputDetails.java | 128 + .../InMageAzureV2EnableProtectionInput.java | 564 ++ .../models/InMageAzureV2EventDetails.java | 215 + .../InMageAzureV2FailoverProviderInput.java | 85 + .../InMageAzureV2ManagedDiskDetails.java | 102 + .../models/InMageAzureV2PolicyDetails.java | 161 + .../models/InMageAzureV2PolicyInput.java | 170 + .../InMageAzureV2ProtectedDiskDetails.java | 415 + .../InMageAzureV2RecoveryPointDetails.java | 56 + .../InMageAzureV2ReplicationDetails.java | 1468 +++ .../models/InMageAzureV2ReprotectInput.java | 213 + .../InMageAzureV2TestFailoverInput.java | 85 + .../InMageAzureV2UnplannedFailoverInput.java | 85 + ...V2UpdateReplicationProtectedItemInput.java | 167 + .../models/InMageBasePolicyDetails.java | 135 + ...isableProtectionProviderSpecificInput.java | 60 + .../models/InMageDiskDetails.java | 184 + .../models/InMageDiskExclusionInput.java | 84 + .../InMageDiskSignatureExclusionOptions.java | 52 + .../models/InMageEnableProtectionInput.java | 324 + .../models/InMageFailoverProviderInput.java | 91 + .../models/InMagePolicyDetails.java | 135 + .../models/InMagePolicyInput.java | 144 + .../models/InMageProtectedDiskDetails.java | 415 + ...geRcmAgentUpgradeBlockingErrorDetails.java | 115 + .../InMageRcmApplyRecoveryPointInput.java | 56 + .../models/InMageRcmDiskInput.java | 128 + .../models/InMageRcmDisksDefaultInput.java | 102 + .../InMageRcmEnableProtectionInput.java | 506 + .../models/InMageRcmEventDetails.java | 45 + .../models/InMageRcmFabricCreationInput.java | 137 + .../InMageRcmFabricSpecificDetails.java | 262 + ...InMageRcmLastAgentUpgradeErrorDetails.java | 115 + .../models/InMageRcmMobilityAgentDetails.java | 161 + .../models/InMageRcmNicDetails.java | 219 + .../models/InMageRcmNicInput.java | 206 + .../models/InMageRcmPolicyCreationInput.java | 138 + .../models/InMageRcmPolicyDetails.java | 92 + .../models/InMageRcmProtectedDiskDetails.java | 159 + .../models/InMageRcmRecoveryPointDetails.java | 45 + .../models/InMageRcmReplicationDetails.java | 719 ++ .../models/InMageRcmTestFailoverInput.java | 85 + .../InMageRcmUnplannedFailoverInput.java | 85 + ...cmUpdateReplicationProtectedItemInput.java | 323 + .../models/InMageReplicationDetails.java | 1031 ++ .../models/InMageReprotectInput.java | 265 + .../models/InMageTestFailoverInput.java | 91 + .../models/InMageUnplannedFailoverInput.java | 91 + .../models/InMageV2RpRecoveryPointType.java | 41 + .../models/InMageVolumeExclusionOptions.java | 88 + .../models/InconsistentVmDetails.java | 130 + .../models/InitialReplicationDetails.java | 77 + .../models/InlineWorkflowTaskDetails.java | 64 + .../models/InnerHealthError.java | 342 + .../models/InputEndpoint.java | 128 + .../models/IpConfig.java | 103 + .../models/Job.java | 52 + .../models/JobCollection.java | 81 + .../models/JobDetails.java | 70 + .../models/JobEntity.java | 180 + .../models/JobErrorDetails.java | 161 + .../models/JobProperties.java | 409 + .../models/JobQueryParameter.java | 154 + .../models/JobStatusEventDetails.java | 134 + .../models/JobTaskDetails.java | 59 + .../models/KeyEncryptionKeyInfo.java | 76 + .../models/LicenseType.java | 37 + .../models/LogicalNetwork.java | 52 + .../models/LogicalNetworkCollection.java | 81 + .../models/LogicalNetworkProperties.java | 136 + .../models/ManualActionTaskDetails.java | 108 + .../models/MasterTargetServer.java | 512 + .../models/MigrateInput.java | 57 + .../models/MigrateInputProperties.java | 58 + .../models/MigrateProviderSpecificInput.java | 33 + .../models/MigrationItem.java | 246 + .../models/MigrationItemCollection.java | 81 + .../models/MigrationItemOperation.java | 40 + .../models/MigrationItemProperties.java | 243 + .../MigrationProviderSpecificSettings.java | 33 + .../models/MigrationRecoveryPoint.java | 53 + .../MigrationRecoveryPointCollection.java | 81 + .../MigrationRecoveryPointProperties.java | 55 + .../models/MigrationRecoveryPointType.java | 37 + .../models/MigrationRecoveryPoints.java | 100 + .../models/MigrationState.java | 61 + .../models/MobilityAgentUpgradeState.java | 40 + .../models/MobilityServiceUpdate.java | 102 + .../models/MultiVmGroupCreateOption.java | 34 + .../models/MultiVmSyncPointOption.java | 35 + .../models/MultiVmSyncStatus.java | 34 + .../models/Network.java | 52 + .../models/NetworkCollection.java | 81 + .../models/NetworkMapping.java | 174 + .../models/NetworkMappingCollection.java | 85 + .../NetworkMappingFabricSpecificSettings.java | 37 + .../models/NetworkMappingProperties.java | 262 + .../models/NetworkProperties.java | 132 + .../models/NewProtectionProfile.java | 175 + .../models/NewRecoveryVirtualNetwork.java | 87 + .../models/OSDetails.java | 180 + .../models/OSDiskDetails.java | 102 + .../models/OSVersionWrapper.java | 76 + .../models/Operations.java | 34 + .../models/OperationsDiscovery.java | 58 + .../models/OperationsDiscoveryCollection.java | 81 + .../models/PlannedFailoverInput.java | 53 + .../PlannedFailoverInputProperties.java | 80 + .../models/Policy.java | 171 + .../models/PolicyCollection.java | 81 + .../models/PolicyProperties.java | 79 + .../models/PolicyProviderSpecificDetails.java | 45 + .../models/PolicyProviderSpecificInput.java | 42 + .../models/PossibleOperationsDirections.java | 34 + .../models/PresenceStatus.java | 37 + .../models/ProcessServer.java | 889 ++ .../models/ProcessServerDetails.java | 300 + .../models/ProtectableItem.java | 52 + .../models/ProtectableItemCollection.java | 81 + .../models/ProtectableItemProperties.java | 212 + .../models/ProtectionContainer.java | 201 + .../models/ProtectionContainerCollection.java | 81 + ...tectionContainerFabricSpecificDetails.java | 39 + .../models/ProtectionContainerMapping.java | 196 + .../ProtectionContainerMappingCollection.java | 81 + .../ProtectionContainerMappingProperties.java | 320 + ...ntainerMappingProviderSpecificDetails.java | 37 + .../models/ProtectionContainerProperties.java | 210 + .../models/ProtectionHealth.java | 40 + .../ProtectionProfileCustomDetails.java | 36 + .../models/ProviderError.java | 154 + .../models/ProviderSpecificFailoverInput.java | 39 + .../ProviderSpecificRecoveryPointDetails.java | 37 + .../models/PushInstallerDetails.java | 119 + .../RcmAzureMigrationPolicyDetails.java | 162 + .../models/RcmProxyDetails.java | 119 + .../RecoveryAvailabilitySetCustomDetails.java | 33 + .../models/RecoveryPlan.java | 306 + .../models/RecoveryPlanA2ADetails.java | 82 + .../models/RecoveryPlanA2AFailoverInput.java | 119 + .../models/RecoveryPlanA2AInput.java | 82 + .../models/RecoveryPlanAction.java | 154 + .../models/RecoveryPlanActionDetails.java | 39 + .../models/RecoveryPlanActionLocation.java | 34 + ...eryPlanAutomationRunbookActionDetails.java | 115 + .../models/RecoveryPlanCollection.java | 81 + .../models/RecoveryPlanGroup.java | 143 + .../models/RecoveryPlanGroupTaskDetails.java | 116 + .../models/RecoveryPlanGroupType.java | 37 + ...ryPlanHyperVReplicaAzureFailbackInput.java | 97 + ...ryPlanHyperVReplicaAzureFailoverInput.java | 136 + ...ecoveryPlanInMageAzureV2FailoverInput.java | 123 + .../RecoveryPlanInMageFailoverInput.java | 62 + .../RecoveryPlanInMageRcmFailoverInput.java | 85 + .../RecoveryPlanManualActionDetails.java | 56 + .../RecoveryPlanPlannedFailoverInput.java | 58 + ...eryPlanPlannedFailoverInputProperties.java | 89 + .../models/RecoveryPlanPointType.java | 40 + .../models/RecoveryPlanProperties.java | 440 + .../models/RecoveryPlanProtectedItem.java | 76 + .../RecoveryPlanProviderSpecificDetails.java | 33 + ...veryPlanProviderSpecificFailoverInput.java | 40 + .../RecoveryPlanProviderSpecificInput.java | 33 + .../RecoveryPlanScriptActionDetails.java | 120 + .../RecoveryPlanShutdownGroupTaskDetails.java | 116 + .../RecoveryPlanTestFailoverCleanupInput.java | 59 + ...lanTestFailoverCleanupInputProperties.java | 51 + .../models/RecoveryPlanTestFailoverInput.java | 58 + ...coveryPlanTestFailoverInputProperties.java | 173 + .../RecoveryPlanUnplannedFailoverInput.java | 58 + ...yPlanUnplannedFailoverInputProperties.java | 124 + .../models/RecoveryPoint.java | 52 + .../models/RecoveryPointCollection.java | 81 + .../models/RecoveryPointProperties.java | 107 + .../models/RecoveryPointSyncType.java | 34 + .../models/RecoveryPointType.java | 37 + .../models/RecoveryPoints.java | 100 + ...yProximityPlacementGroupCustomDetails.java | 34 + .../RecoveryResourceGroupCustomDetails.java | 33 + .../models/RecoveryServicesProvider.java | 178 + .../RecoveryServicesProviderCollection.java | 81 + .../RecoveryServicesProviderProperties.java | 456 + .../RecoveryVirtualNetworkCustomDetails.java | 36 + .../models/RemoveDisksInput.java | 53 + .../models/RemoveDisksInputProperties.java | 61 + .../RemoveDisksProviderSpecificInput.java | 33 + ...RemoveProtectionContainerMappingInput.java | 54 + ...ectionContainerMappingInputProperties.java | 55 + .../models/RenewCertificateInput.java | 53 + .../RenewCertificateInputProperties.java | 50 + .../models/ReplicationAgentDetails.java | 119 + .../models/ReplicationAlertSettings.java | 96 + .../models/ReplicationEligibilityResults.java | 46 + ...plicationEligibilityResultsCollection.java | 27 + ...eplicationEligibilityResultsErrorInfo.java | 99 + ...plicationEligibilityResultsOperations.java | 63 + ...plicationEligibilityResultsProperties.java | 69 + .../models/ReplicationEvents.java | 65 + .../models/ReplicationFabrics.java | 270 + .../models/ReplicationGroupDetails.java | 29 + .../models/ReplicationJobs.java | 180 + .../models/ReplicationLogicalNetworks.java | 71 + .../models/ReplicationMigrationItems.java | 371 + .../models/ReplicationNetworkMappings.java | 202 + .../models/ReplicationNetworks.java | 95 + .../models/ReplicationPolicies.java | 141 + .../models/ReplicationProtectableItems.java | 91 + .../models/ReplicationProtectedItem.java | 445 + .../ReplicationProtectedItemCollection.java | 81 + .../ReplicationProtectedItemOperation.java | 67 + .../ReplicationProtectedItemProperties.java | 749 ++ .../models/ReplicationProtectedItems.java | 784 ++ ...eplicationProtectionContainerMappings.java | 229 + .../ReplicationProtectionContainers.java | 248 + .../models/ReplicationProtectionIntent.java | 135 + ...ReplicationProtectionIntentCollection.java | 81 + ...ReplicationProtectionIntentProperties.java | 140 + ...tectionIntentProviderSpecificSettings.java | 34 + .../models/ReplicationProtectionIntents.java | 96 + ...cationProviderContainerUnmappingInput.java | 50 + ...roviderSpecificContainerCreationInput.java | 37 + ...ProviderSpecificContainerMappingInput.java | 37 + .../ReplicationProviderSpecificSettings.java | 42 + ...erSpecificUpdateContainerMappingInput.java | 34 + .../models/ReplicationRecoveryPlans.java | 343 + .../ReplicationRecoveryServicesProviders.java | 212 + ...licationStorageClassificationMappings.java | 206 + .../ReplicationStorageClassifications.java | 101 + .../models/ReplicationVaultHealths.java | 61 + .../models/ReplicationVaultSettings.java | 96 + .../models/ReplicationvCenters.java | 174 + .../models/ReprotectAgentDetails.java | 119 + .../models/ResolveHealthError.java | 50 + .../models/ResolveHealthInput.java | 53 + .../models/ResolveHealthInputProperties.java | 54 + .../models/ResourceHealthSummary.java | 81 + .../models/ResumeJobParams.java | 53 + .../models/ResumeJobParamsProperties.java | 50 + .../models/ResyncState.java | 37 + .../models/RetentionVolume.java | 128 + .../models/ReverseReplicationInput.java | 53 + .../ReverseReplicationInputProperties.java | 80 + ...verseReplicationProviderSpecificInput.java | 38 + .../models/RpInMageRecoveryPointType.java | 37 + .../models/RunAsAccount.java | 76 + .../models/SanEnableProtectionInput.java | 29 + .../models/ScriptActionTaskDetails.java | 134 + .../models/ServiceError.java | 154 + .../models/SetMultiVmSyncStatus.java | 34 + .../models/Severity.java | 40 + .../models/SourceSiteOperations.java | 34 + .../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 | 69 + .../models/SupportedOperatingSystems.java | 53 + .../SupportedOperatingSystemsOperations.java | 36 + .../models/SwitchProtectionInput.java | 53 + .../SwitchProtectionInputProperties.java | 80 + .../models/SwitchProtectionJobDetails.java | 64 + ...SwitchProtectionProviderSpecificInput.java | 33 + .../models/TargetComputeSize.java | 46 + .../models/TargetComputeSizeCollection.java | 81 + .../models/TargetComputeSizeProperties.java | 267 + .../models/TargetComputeSizes.java | 53 + .../models/TaskTypeDetails.java | 42 + .../models/TestFailoverCleanupInput.java | 58 + .../TestFailoverCleanupInputProperties.java | 50 + .../models/TestFailoverInput.java | 53 + .../models/TestFailoverInputProperties.java | 158 + .../models/TestFailoverJobDetails.java | 199 + .../TestFailoverProviderSpecificInput.java | 39 + .../models/TestMigrateCleanupInput.java | 58 + .../TestMigrateCleanupInputProperties.java | 50 + .../models/TestMigrateInput.java | 57 + .../models/TestMigrateInputProperties.java | 59 + .../TestMigrateProviderSpecificInput.java | 33 + .../models/TestMigrationState.java | 44 + .../models/UnplannedFailoverInput.java | 53 + .../UnplannedFailoverInputProperties.java | 106 + ...nplannedFailoverProviderSpecificInput.java | 39 + .../models/UpdateMigrationItemInput.java | 53 + .../UpdateMigrationItemInputProperties.java | 60 + ...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 | 55 + .../models/UpdateRecoveryPlanInput.java | 53 + .../UpdateRecoveryPlanInputProperties.java | 54 + .../UpdateReplicationProtectedItemInput.java | 54 + ...plicationProtectedItemInputProperties.java | 302 + ...ReplicationProtectedItemProviderInput.java | 40 + .../models/UpdateVCenterRequest.java | 53 + .../UpdateVCenterRequestProperties.java | 154 + .../models/VCenter.java | 172 + .../models/VCenterCollection.java | 81 + .../models/VCenterProperties.java | 315 + .../models/VMNicDetails.java | 745 ++ .../models/VMNicInputDetails.java | 507 + .../VMwareCbtContainerCreationInput.java | 29 + .../VMwareCbtContainerMappingInput.java | 225 + .../models/VMwareCbtDiskInput.java | 176 + .../models/VMwareCbtEnableMigrationInput.java | 382 + .../models/VMwareCbtMigrateInput.java | 62 + .../models/VMwareCbtMigrationDetails.java | 378 + .../models/VMwareCbtNicDetails.java | 214 + .../models/VMwareCbtNicInput.java | 164 + .../models/VMwareCbtPolicyCreationInput.java | 112 + .../models/VMwareCbtProtectedDiskDetails.java | 185 + ...eCbtProtectionContainerMappingDetails.java | 121 + .../models/VMwareCbtTestMigrateInput.java | 94 + .../VMwareCbtUpdateMigrationItemInput.java | 243 + .../models/VMwareDetails.java | 876 ++ .../models/VMwareV2FabricCreationInput.java | 94 + .../models/VMwareV2FabricSpecificDetails.java | 90 + .../models/VMwareVirtualMachineDetails.java | 303 + .../models/VaultHealthDetails.java | 53 + .../models/VaultHealthProperties.java | 141 + .../models/VaultSetting.java | 137 + .../models/VaultSettingCollection.java | 81 + .../models/VaultSettingCreationInput.java | 58 + .../VaultSettingCreationInputProperties.java | 56 + .../models/VaultSettingProperties.java | 50 + .../models/VersionDetails.java | 103 + .../models/VirtualMachineTaskDetails.java | 111 + .../models/VmEncryptionType.java | 37 + .../models/VmNicUpdatesTaskDetails.java | 108 + .../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 | 228 + .../models/VmwareCbtPolicyDetails.java | 111 + .../models/package-info.java | 6 + .../package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/recoveryservicessiterecovery/ci.yml | 33 + sdk/recoveryservicessiterecovery/pom.xml | 53 + 675 files changed, 132263 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/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/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/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/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/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/A2AFailoverProviderInput.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/A2AVmDiskDetails.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/A2AVmManagedDiskDetails.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/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/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/AutoProtectionOfDataDiskStatus.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/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/DiskType.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/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/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/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/HyperVReplicaAzureFailoverProviderInput.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/InMageAzureV2FailoverProviderInput.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/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/InMageFailoverProviderInput.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/InMageRcmApplyRecoveryPointInput.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/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/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/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/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/IpConfig.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/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/MultiVmSyncStatus.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/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/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/ProviderSpecificFailoverInput.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/RcmAzureMigrationPolicyDetails.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/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/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/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/SanEnableProtectionInput.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/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/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/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/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/VMwareCbtTestMigrateInput.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/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/ci.yml create mode 100644 sdk/recoveryservicessiterecovery/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index c037b72906bba..56d9602445c28 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -277,6 +277,7 @@ com.azure.resourcemanager:azure-resourcemanager-datalakestore;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-iotcentral;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-labservices;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-vmwarecloudsimple;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-recoveryservicessiterecovery;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index 911b8d8d0264a..a972ee99246ca 100644 --- a/pom.xml +++ b/pom.xml @@ -737,6 +737,7 @@ sdk/powerbidedicated sdk/quantum sdk/recoveryservices + 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 0000000000000..e3629a8d9d6d3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-04-22) + +- Azure Resource Manager SiteRecovery client library for Java. This package contains Microsoft Azure SDK for SiteRecovery Management SDK. Package tag package-2021-03. 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 0000000000000..52e23b11e4d43 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/README.md @@ -0,0 +1,99 @@ +# 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-2021-03. 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] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +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 + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml new file mode 100644 index 0000000000000..a830642201811 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml @@ -0,0 +1,67 @@ + + 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-2021-03. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.15.0 + + + com.azure + azure-core-management + 1.2.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + 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 0000000000000..5787366bec684 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/SiteRecoveryManager.java @@ -0,0 +1,550 @@ +// Copyright (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.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.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.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.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; + +/** Entry point to SiteRecoveryManager. */ +public final class SiteRecoveryManager { + private Operations operations; + + private ReplicationAlertSettings replicationAlertSettings; + + 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 ReplicationProtectionIntents replicationProtectionIntents; + + private ReplicationRecoveryServicesProviders replicationRecoveryServicesProviders; + + private ReplicationStorageClassifications replicationStorageClassifications; + + private ReplicationStorageClassificationMappings replicationStorageClassificationMappings; + + private ReplicationvCenters replicationvCenters; + + private ReplicationJobs replicationJobs; + + private ReplicationPolicies replicationPolicies; + + 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); + } + + /** + * 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 final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of 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 (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new SiteRecoveryManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of ReplicationAlertSettings. */ + public ReplicationAlertSettings replicationAlertSettings() { + if (this.replicationAlertSettings == null) { + this.replicationAlertSettings = + new ReplicationAlertSettingsImpl(clientObject.getReplicationAlertSettings(), this); + } + return replicationAlertSettings; + } + + /** @return Resource collection API of ReplicationEligibilityResultsOperations. */ + public ReplicationEligibilityResultsOperations replicationEligibilityResultsOperations() { + if (this.replicationEligibilityResultsOperations == null) { + this.replicationEligibilityResultsOperations = + new ReplicationEligibilityResultsOperationsImpl( + clientObject.getReplicationEligibilityResultsOperations(), this); + } + return replicationEligibilityResultsOperations; + } + + /** @return Resource collection API of ReplicationEvents. */ + public ReplicationEvents replicationEvents() { + if (this.replicationEvents == null) { + this.replicationEvents = new ReplicationEventsImpl(clientObject.getReplicationEvents(), this); + } + return replicationEvents; + } + + /** @return Resource collection API of ReplicationFabrics. */ + public ReplicationFabrics replicationFabrics() { + if (this.replicationFabrics == null) { + this.replicationFabrics = new ReplicationFabricsImpl(clientObject.getReplicationFabrics(), this); + } + return replicationFabrics; + } + + /** @return Resource collection API of ReplicationLogicalNetworks. */ + public ReplicationLogicalNetworks replicationLogicalNetworks() { + if (this.replicationLogicalNetworks == null) { + this.replicationLogicalNetworks = + new ReplicationLogicalNetworksImpl(clientObject.getReplicationLogicalNetworks(), this); + } + return replicationLogicalNetworks; + } + + /** @return Resource collection API of ReplicationNetworks. */ + public ReplicationNetworks replicationNetworks() { + if (this.replicationNetworks == null) { + this.replicationNetworks = new ReplicationNetworksImpl(clientObject.getReplicationNetworks(), this); + } + return replicationNetworks; + } + + /** @return Resource collection API of ReplicationNetworkMappings. */ + public ReplicationNetworkMappings replicationNetworkMappings() { + if (this.replicationNetworkMappings == null) { + this.replicationNetworkMappings = + new ReplicationNetworkMappingsImpl(clientObject.getReplicationNetworkMappings(), this); + } + return replicationNetworkMappings; + } + + /** @return Resource collection API of ReplicationProtectionContainers. */ + public ReplicationProtectionContainers replicationProtectionContainers() { + if (this.replicationProtectionContainers == null) { + this.replicationProtectionContainers = + new ReplicationProtectionContainersImpl(clientObject.getReplicationProtectionContainers(), this); + } + return replicationProtectionContainers; + } + + /** @return Resource collection API of ReplicationMigrationItems. */ + public ReplicationMigrationItems replicationMigrationItems() { + if (this.replicationMigrationItems == null) { + this.replicationMigrationItems = + new ReplicationMigrationItemsImpl(clientObject.getReplicationMigrationItems(), this); + } + return replicationMigrationItems; + } + + /** @return Resource collection API of MigrationRecoveryPoints. */ + public MigrationRecoveryPoints migrationRecoveryPoints() { + if (this.migrationRecoveryPoints == null) { + this.migrationRecoveryPoints = + new MigrationRecoveryPointsImpl(clientObject.getMigrationRecoveryPoints(), this); + } + return migrationRecoveryPoints; + } + + /** @return Resource collection API of ReplicationProtectableItems. */ + public ReplicationProtectableItems replicationProtectableItems() { + if (this.replicationProtectableItems == null) { + this.replicationProtectableItems = + new ReplicationProtectableItemsImpl(clientObject.getReplicationProtectableItems(), this); + } + return replicationProtectableItems; + } + + /** @return Resource collection API of ReplicationProtectedItems. */ + public ReplicationProtectedItems replicationProtectedItems() { + if (this.replicationProtectedItems == null) { + this.replicationProtectedItems = + new ReplicationProtectedItemsImpl(clientObject.getReplicationProtectedItems(), this); + } + return replicationProtectedItems; + } + + /** @return Resource collection API of RecoveryPoints. */ + public RecoveryPoints recoveryPoints() { + if (this.recoveryPoints == null) { + this.recoveryPoints = new RecoveryPointsImpl(clientObject.getRecoveryPoints(), this); + } + return recoveryPoints; + } + + /** @return Resource collection API of TargetComputeSizes. */ + public TargetComputeSizes targetComputeSizes() { + if (this.targetComputeSizes == null) { + this.targetComputeSizes = new TargetComputeSizesImpl(clientObject.getTargetComputeSizes(), this); + } + return targetComputeSizes; + } + + /** @return Resource collection API of ReplicationProtectionContainerMappings. */ + public ReplicationProtectionContainerMappings replicationProtectionContainerMappings() { + if (this.replicationProtectionContainerMappings == null) { + this.replicationProtectionContainerMappings = + new ReplicationProtectionContainerMappingsImpl( + clientObject.getReplicationProtectionContainerMappings(), this); + } + return replicationProtectionContainerMappings; + } + + /** @return Resource collection API of ReplicationProtectionIntents. */ + public ReplicationProtectionIntents replicationProtectionIntents() { + if (this.replicationProtectionIntents == null) { + this.replicationProtectionIntents = + new ReplicationProtectionIntentsImpl(clientObject.getReplicationProtectionIntents(), this); + } + return replicationProtectionIntents; + } + + /** @return Resource collection API of ReplicationRecoveryServicesProviders. */ + public ReplicationRecoveryServicesProviders replicationRecoveryServicesProviders() { + if (this.replicationRecoveryServicesProviders == null) { + this.replicationRecoveryServicesProviders = + new ReplicationRecoveryServicesProvidersImpl( + clientObject.getReplicationRecoveryServicesProviders(), this); + } + return replicationRecoveryServicesProviders; + } + + /** @return Resource collection API of ReplicationStorageClassifications. */ + public ReplicationStorageClassifications replicationStorageClassifications() { + if (this.replicationStorageClassifications == null) { + this.replicationStorageClassifications = + new ReplicationStorageClassificationsImpl(clientObject.getReplicationStorageClassifications(), this); + } + return replicationStorageClassifications; + } + + /** @return Resource collection API of ReplicationStorageClassificationMappings. */ + public ReplicationStorageClassificationMappings replicationStorageClassificationMappings() { + if (this.replicationStorageClassificationMappings == null) { + this.replicationStorageClassificationMappings = + new ReplicationStorageClassificationMappingsImpl( + clientObject.getReplicationStorageClassificationMappings(), this); + } + return replicationStorageClassificationMappings; + } + + /** @return Resource collection API of ReplicationvCenters. */ + public ReplicationvCenters replicationvCenters() { + if (this.replicationvCenters == null) { + this.replicationvCenters = new ReplicationvCentersImpl(clientObject.getReplicationvCenters(), this); + } + return replicationvCenters; + } + + /** @return Resource collection API of ReplicationJobs. */ + public ReplicationJobs replicationJobs() { + if (this.replicationJobs == null) { + this.replicationJobs = new ReplicationJobsImpl(clientObject.getReplicationJobs(), this); + } + return replicationJobs; + } + + /** @return Resource collection API of ReplicationPolicies. */ + public ReplicationPolicies replicationPolicies() { + if (this.replicationPolicies == null) { + this.replicationPolicies = new ReplicationPoliciesImpl(clientObject.getReplicationPolicies(), this); + } + return replicationPolicies; + } + + /** @return Resource collection API of ReplicationRecoveryPlans. */ + public ReplicationRecoveryPlans replicationRecoveryPlans() { + if (this.replicationRecoveryPlans == null) { + this.replicationRecoveryPlans = + new ReplicationRecoveryPlansImpl(clientObject.getReplicationRecoveryPlans(), this); + } + return replicationRecoveryPlans; + } + + /** @return Resource collection API of SupportedOperatingSystemsOperations. */ + public SupportedOperatingSystemsOperations supportedOperatingSystemsOperations() { + if (this.supportedOperatingSystemsOperations == null) { + this.supportedOperatingSystemsOperations = + new SupportedOperatingSystemsOperationsImpl( + clientObject.getSupportedOperatingSystemsOperations(), this); + } + return supportedOperatingSystemsOperations; + } + + /** @return Resource collection API of ReplicationVaultHealths. */ + public ReplicationVaultHealths replicationVaultHealths() { + if (this.replicationVaultHealths == null) { + this.replicationVaultHealths = + new ReplicationVaultHealthsImpl(clientObject.getReplicationVaultHealths(), this); + } + return replicationVaultHealths; + } + + /** @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 0000000000000..cee8501bd2de6 --- /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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName, + Context context); +} 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 0000000000000..1fb894cbc6fc9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/OperationsClient.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.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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..4f6d213d454ec --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/RecoveryPointsClient.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.RecoveryPointInner; + +/** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */ +public interface RecoveryPointsClient { + /** + * 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's 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * 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's 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * 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's 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); + + /** + * 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's 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName, + Context context); +} 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 0000000000000..94aff61757642 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationAlertSettingsClient.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.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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String alertSettingName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceName, + String resourceGroupName, + String alertSettingName, + ConfigureAlertRequest request, + 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 0000000000000..405885374fc10 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEligibilityResultsOperationsClient.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.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 { + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualMachineName, Context context); +} 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 0000000000000..4ee1853f91f7a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationEventsClient.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.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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String eventName, Context context); +} 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 0000000000000..e07bf0a894fe3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationFabricsClient.java @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if 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) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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) + SyncPoller, FabricInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input); + + /** + * 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) + SyncPoller, FabricInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurge(String resourceName, String resourceGroupName, String fabricName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurge( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, FabricInner> beginCheckConsistency( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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) + SyncPoller, FabricInner> beginCheckConsistency( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginMigrateToAad( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginMigrateToAad( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, FabricInner> beginReassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest); + + /** + * 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) + SyncPoller, FabricInner> beginReassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceName, String resourceGroupName, String fabricName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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 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) + SyncPoller, FabricInner> beginRenewCertificate( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate); + + /** + * 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) + SyncPoller, FabricInner> beginRenewCertificate( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context); + + /** + * 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 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 0000000000000..4ade3c3481c00 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationJobsClient.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * 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) + SyncPoller, JobInner> beginCancel( + String resourceName, String resourceGroupName, String jobName); + + /** + * 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) + SyncPoller, JobInner> beginCancel( + String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, JobInner> beginRestart( + String resourceName, String resourceGroupName, String jobName); + + /** + * 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) + SyncPoller, JobInner> beginRestart( + String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, JobInner> beginResume( + String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams); + + /** + * 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) + SyncPoller, JobInner> beginResume( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, JobInner> beginExport( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter); + + /** + * 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) + SyncPoller, JobInner> beginExport( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context); + + /** + * 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); + + /** + * 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 0000000000000..c3d672254a407 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationLogicalNetworksClient.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.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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName, Context context); +} 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 0000000000000..d5665bdb23b6f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationMigrationItemsClient.java @@ -0,0 +1,727 @@ +// Copyright (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.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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context); + + /** + * 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) + SyncPoller, MigrationItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input); + + /** + * 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) + SyncPoller, MigrationItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption, + Context context); + + /** + * 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 com.azure.core.management.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); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, MigrationItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input); + + /** + * 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) + SyncPoller, MigrationItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, MigrationItemInner> beginMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput); + + /** + * 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) + SyncPoller, MigrationItemInner> beginMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, MigrationItemInner> beginTestMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput); + + /** + * 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) + SyncPoller, MigrationItemInner> beginTestMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, MigrationItemInner> beginTestMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput); + + /** + * 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) + SyncPoller, MigrationItemInner> beginTestMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput, + Context context); + + /** + * 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); + + /** + * 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. + */ + @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 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. + */ + @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/ReplicationNetworkMappingsClient.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworkMappingsClient.java new file mode 100644 index 0000000000000..305c9ca08a0b4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworkMappingsClient.java @@ -0,0 +1,401 @@ +// Copyright (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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context); + + /** + * 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) + SyncPoller, NetworkMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input); + + /** + * 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) + SyncPoller, NetworkMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, NetworkMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input); + + /** + * 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) + SyncPoller, NetworkMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..3b5e320ce6f40 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationNetworksClient.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.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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..bd12cf31af41c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationPoliciesClient.java @@ -0,0 +1,263 @@ +// Copyright (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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String policyName, Context context); + + /** + * 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) + SyncPoller, PolicyInner> beginCreate( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input); + + /** + * 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) + SyncPoller, PolicyInner> beginCreate( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceName, String resourceGroupName, String policyName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String policyName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, PolicyInner> beginUpdate( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input); + + /** + * 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) + SyncPoller, PolicyInner> beginUpdate( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input, Context context); + + /** + * 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); + + /** + * 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 0000000000000..987c62090054f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectableItemsClient.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName, + Context context); +} 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 0000000000000..febe6503827bb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectedItemsClient.java @@ -0,0 +1,1665 @@ +// Copyright (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.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginAddDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginAddDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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's 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) + SyncPoller, ReplicationProtectedItemInner> beginApplyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput); + + /** + * 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's 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) + SyncPoller, ReplicationProtectedItemInner> beginApplyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput, + Context context); + + /** + * 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's 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); + + /** + * 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's 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); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginFailoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginFailoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationProtectedItemInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput); + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationProtectedItemInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context); + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput); + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + DisableProtectionInput disableProtectionInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginRemoveDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginRemoveDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginRepairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginRepairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationProtectedItemInner> beginReprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput); + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationProtectedItemInner> beginReprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput, + Context context); + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput); + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput, + Context context); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginResolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginResolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 failoverInput 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) + SyncPoller, ReplicationProtectedItemInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput failoverInput); + + /** + * 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 failoverInput 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) + SyncPoller, ReplicationProtectedItemInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput failoverInput, + Context context); + + /** + * 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 failoverInput 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 failoverInput); + + /** + * 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 failoverInput 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 failoverInput, + Context context); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput); + + /** + * 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) + SyncPoller, ReplicationProtectedItemInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationProtectedItemInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput); + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplicationProtectedItemInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context); + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput); + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationProtectedItemInner unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context); + + /** + * 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 replicationProtectedItemName 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) + SyncPoller, ReplicationProtectedItemInner> beginUpdateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest); + + /** + * 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 replicationProtectedItemName 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) + SyncPoller, ReplicationProtectedItemInner> beginUpdateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context); + + /** + * 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 replicationProtectedItemName 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 replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest); + + /** + * 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 replicationProtectedItemName 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 replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..cd2999cf4a396 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainerMappingsClient.java @@ -0,0 +1,503 @@ +// Copyright (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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context); + + /** + * 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) + SyncPoller, ProtectionContainerMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput); + + /** + * 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) + SyncPoller, ProtectionContainerMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, ProtectionContainerMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput); + + /** + * 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) + SyncPoller, ProtectionContainerMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + RemoveProtectionContainerMappingInput removalInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..65247c9009a69 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionContainersClient.java @@ -0,0 +1,450 @@ +// Copyright (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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * 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) + SyncPoller, ProtectionContainerInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput); + + /** + * 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) + SyncPoller, ProtectionContainerInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, ProtectionContainerInner> beginDiscoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest); + + /** + * 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) + SyncPoller, ProtectionContainerInner> beginDiscoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, ProtectionContainerInner> beginSwitchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput); + + /** + * 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) + SyncPoller, ProtectionContainerInner> beginSwitchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..68e8e7b7d6e6a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationProtectionIntentsClient.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.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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceName, String resourceGroupName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String intentObjectName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceName, + String resourceGroupName, + String intentObjectName, + CreateProtectionIntentInput input, + Context context); +} 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 0000000000000..304105b4437fa --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryPlansClient.java @@ -0,0 +1,716 @@ +// Copyright (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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * 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) + SyncPoller, RecoveryPlanInner> beginCreate( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input); + + /** + * 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) + SyncPoller, RecoveryPlanInner> beginCreate( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + CreateRecoveryPlanInput input, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, RecoveryPlanInner> beginUpdate( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input); + + /** + * 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) + SyncPoller, RecoveryPlanInner> beginUpdate( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + UpdateRecoveryPlanInput input, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * The operation to commit the fail over 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) + SyncPoller, RecoveryPlanInner> beginFailoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * The operation to commit the fail over 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) + SyncPoller, RecoveryPlanInner> beginFailoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * The operation to commit the fail over 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); + + /** + * The operation to commit the fail over 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); + + /** + * 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) + SyncPoller, RecoveryPlanInner> beginPlannedFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanPlannedFailoverInput input); + + /** + * 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) + SyncPoller, RecoveryPlanInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, RecoveryPlanInner> beginReprotect( + String resourceName, String resourceGroupName, String recoveryPlanName); + + /** + * 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) + SyncPoller, RecoveryPlanInner> beginReprotect( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 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) + SyncPoller, RecoveryPlanInner> beginTestFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input); + + /** + * 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 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) + SyncPoller, RecoveryPlanInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context); + + /** + * 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 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); + + /** + * 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 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); + + /** + * 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 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) + SyncPoller, RecoveryPlanInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input); + + /** + * 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 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) + SyncPoller, RecoveryPlanInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context); + + /** + * 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 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); + + /** + * 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 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); + + /** + * The operation to start 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 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) + SyncPoller, RecoveryPlanInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input); + + /** + * The operation to start 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 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) + SyncPoller, RecoveryPlanInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context); + + /** + * The operation to start 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 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 unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input); + + /** + * The operation to start 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 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 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 0000000000000..fed75799c38a9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationRecoveryServicesProvidersClient.java @@ -0,0 +1,390 @@ +// Copyright (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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * 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) + SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput); + + /** + * 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) + SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurge( + String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPurge( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * 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) + SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String providerName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..ef3d11c96349c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationMappingsClient.java @@ -0,0 +1,312 @@ +// Copyright (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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationStorageClassifications( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationStorageClassifications( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context); + + /** + * 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) + SyncPoller, StorageClassificationMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput); + + /** + * 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) + SyncPoller, StorageClassificationMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..90010d674d002 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationStorageClassificationsClient.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.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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..b2f11f4ab5ae5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultHealthsClient.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.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 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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) + 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 vault health details definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 0000000000000..449c2f403cbfe --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationVaultSettingsClient.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.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. 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String vaultSettingName, Context context); + + /** + * 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); + + /** + * 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) + Response createWithResponse( + 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 0000000000000..7e0582ea1766a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/ReplicationvCentersClient.java @@ -0,0 +1,347 @@ +// Copyright (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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String vCenterName, Context context); + + /** + * 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) + SyncPoller, VCenterInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String vCenterName, + AddVCenterRequest addVCenterRequest); + + /** + * 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) + SyncPoller, VCenterInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String vCenterName, + AddVCenterRequest addVCenterRequest, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String vCenterName); + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String vCenterName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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) + SyncPoller, VCenterInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String vCenterName, + UpdateVCenterRequest updateVCenterRequest); + + /** + * 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) + SyncPoller, VCenterInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String vCenterName, + UpdateVCenterRequest updateVCenterRequest, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + @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 0000000000000..5f75ca3e5480e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SiteRecoveryManagementClient.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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 ReplicationProtectionIntentsClient object to access its operations. + * + * @return the ReplicationProtectionIntentsClient object. + */ + ReplicationProtectionIntentsClient getReplicationProtectionIntents(); + + /** + * 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 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 0000000000000..7385f722e9537 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/SupportedOperatingSystemsOperationsClient.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.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 OSes 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 OSes by SRS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportedOperatingSystemsInner get(String resourceName, String resourceGroupName); + + /** + * Gets the data of supported OSes 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 OSes by SRS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceName, String resourceGroupName, Context context); +} 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 0000000000000..08be1129b978c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/TargetComputeSizesClient.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.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 { + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * 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. + */ + @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 0000000000000..7e2b4fcc9886d --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.AlertProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Implements the Alert class. */ +@Fluent +public final class AlertInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertInner.class); + + /* + * Alert related data. + */ + @JsonProperty(value = "properties") + private AlertProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..a86eb4e3335c7 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.EventProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Implements the Event class. */ +@Fluent +public final class EventInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventInner.class); + + /* + * Event related data. + */ + @JsonProperty(value = "properties") + private EventProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..a2cafd92c12c9 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.FabricProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Fabric definition. */ +@Fluent +public final class FabricInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricInner.class); + + /* + * Fabric related data. + */ + @JsonProperty(value = "properties") + private FabricProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..da16f53480148 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Job details. */ +@Fluent +public final class JobInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobInner.class); + + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private JobProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..b4f2a3baada1c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.LogicalNetworkProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Logical network data model. */ +@Fluent +public final class LogicalNetworkInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogicalNetworkInner.class); + + /* + * The Logical Network Properties. + */ + @JsonProperty(value = "properties") + private LogicalNetworkProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..8d4a54a99477e --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationItemProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Migration item. */ +@Fluent +public final class MigrationItemInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationItemInner.class); + + /* + * The migration item properties. + */ + @JsonProperty(value = "properties") + private MigrationItemProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..eb11916280a87 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.MigrationRecoveryPointProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery point for a migration item. */ +@Fluent +public final class MigrationRecoveryPointInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationRecoveryPointInner.class); + + /* + * Recovery point properties. + */ + @JsonProperty(value = "properties") + private MigrationRecoveryPointProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..4980471179688 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network model. */ +@Fluent +public final class NetworkInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInner.class); + + /* + * The Network Properties. + */ + @JsonProperty(value = "properties") + private NetworkProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..ed94066a2fb11 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.NetworkMappingProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkMappingInner.class); + + /* + * The Network Mapping Properties. + */ + @JsonProperty(value = "properties") + private NetworkMappingProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..6af3e27a3fcaf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/OperationsDiscoveryInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.Display; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operations discovery class. */ +@Fluent +public final class OperationsDiscoveryInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDiscoveryInner.class); + + /* + * 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; + + /** + * 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 0000000000000..e2171d8cd5a6a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.PolicyProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection profile details. */ +@Fluent +public final class PolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyInner.class); + + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private PolicyProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..6f01e19e6880a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectableItemProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication protected item. */ +@Fluent +public final class ProtectableItemInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectableItemInner.class); + + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ProtectableItemProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..17b2baff3f1ee --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection container details. */ +@Fluent +public final class ProtectionContainerInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerInner.class); + + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ProtectionContainerProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..b2d3847396e54 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ProtectionContainerMappingProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection container mapping object. */ +@Fluent +public final class ProtectionContainerMappingInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerMappingInner.class); + + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ProtectionContainerMappingProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..83e30868a484b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPlanProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan details. */ +@Fluent +public final class RecoveryPlanInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanInner.class); + + /* + * The custom details. + */ + @JsonProperty(value = "properties") + private RecoveryPlanProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..131e432b5037f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryPointProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base class representing a recovery point. */ +@Fluent +public final class RecoveryPointInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointInner.class); + + /* + * Recovery point related data. + */ + @JsonProperty(value = "properties") + private RecoveryPointProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the properties property: Recovery point related data. + * + * @return the properties value. + */ + public RecoveryPointProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Recovery point related data. + * + * @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 0000000000000..06cc81c55f92c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.RecoveryServicesProviderProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Provider details. */ +@Fluent +public final class RecoveryServicesProviderInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryServicesProviderInner.class); + + /* + * Provider properties. + */ + @JsonProperty(value = "properties") + private RecoveryServicesProviderProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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/ReplicationEligibilityResultsCollectionInner.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsCollectionInner.java new file mode 100644 index 0000000000000..bfce30fc5332a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/fluent/models/ReplicationEligibilityResultsCollectionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication eligibility results collection response model. */ +@Fluent +public final class ReplicationEligibilityResultsCollectionInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ReplicationEligibilityResultsCollectionInner.class); + + /* + * The replication eligibility results details. + */ + @JsonProperty(value = "value") + private List value; + + /** + * 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 0000000000000..42f249b002f31 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationEligibilityResultsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication eligibility results response model. */ +@Immutable +public final class ReplicationEligibilityResultsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationEligibilityResultsInner.class); + + /* + * 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; + + /** + * 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 0000000000000..1dfe4a67c466f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectedItemProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication protected item. */ +@Fluent +public final class ReplicationProtectedItemInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationProtectedItemInner.class); + + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ReplicationProtectedItemProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..b50de8ec4b76e --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.ReplicationProtectionIntentProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication protection intent. */ +@Fluent +public final class ReplicationProtectionIntentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationProtectionIntentInner.class); + + /* + * The custom data. + */ + @JsonProperty(value = "properties") + private ReplicationProtectionIntentProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..d216997016719 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage object definition. */ +@Fluent +public final class StorageClassificationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageClassificationInner.class); + + /* + * Properties of the storage object. + */ + @JsonProperty(value = "properties") + private StorageClassificationProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..d81f5afaf6c13 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.StorageClassificationMappingProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage mapping object. */ +@Fluent +public final class StorageClassificationMappingInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageClassificationMappingInner.class); + + /* + * Properties of the storage mapping object. + */ + @JsonProperty(value = "properties") + private StorageClassificationMappingProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..789caff4fbdce --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.SupportedOSProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response object for supported operating systems API. */ +@Fluent +public final class SupportedOperatingSystemsInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedOperatingSystemsInner.class); + + /* + * Properties model for supported OS API. + */ + @JsonProperty(value = "properties") + private SupportedOSProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the properties property: Properties model for supported OS API. + * + * @return the properties value. + */ + public SupportedOSProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties model for supported OS API. + * + * @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 0000000000000..ac931c8a3ca4e --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TargetComputeSizeProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents applicable recovery vm sizes. */ +@Fluent +public final class TargetComputeSizeInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetComputeSizeInner.class); + + /* + * 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; + + /** + * 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 0000000000000..cec806c2b7c35 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VCenterProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** vCenter definition. */ +@Fluent +public final class VCenterInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VCenterInner.class); + + /* + * VCenter related data. + */ + @JsonProperty(value = "properties") + private VCenterProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..090863fd05bee --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultHealthProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault health details definition. */ +@Fluent +public final class VaultHealthDetailsInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultHealthDetailsInner.class); + + /* + * The vault health related data. + */ + @JsonProperty(value = "properties") + private VaultHealthProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..a93954764791c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault setting. */ +@Fluent +public final class VaultSettingInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultSettingInner.class); + + /* + * The vault setting properties. + */ + @JsonProperty(value = "properties") + private VaultSettingProperties properties; + + /* + * Resource Location + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..3c738e004489a --- /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 0000000000000..530afe9a082d9 --- /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 0000000000000..cbcddef106d28 --- /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 0000000000000..667334a1f756a --- /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 0000000000000..082d4c74a9285 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/FabricImpl.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.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() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationFabrics() + .getWithResponse(resourceName, resourceGroupName, fabricName, Context.NONE) + .getValue(); + return this; + } + + public Fabric refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationFabrics() + .getWithResponse(resourceName, resourceGroupName, fabricName, 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 0000000000000..8f795d88ba01a --- /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 0000000000000..590a548327028 --- /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 0000000000000..acbf802a18554 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationItemImpl.java @@ -0,0 +1,279 @@ +// Copyright (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.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 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 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 0000000000000..94d7563b71c42 --- /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 0000000000000..8e9f6bbe77266 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsClientImpl.java @@ -0,0 +1,716 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(MigrationRecoveryPointsClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName) + .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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of migration recovery points. + */ + @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 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. + */ + @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 0000000000000..d90fc1acea49f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/MigrationRecoveryPointsImpl.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { + @JsonIgnore private 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 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; + } + } + + 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; + } + } + + 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 0000000000000..213bca89a0414 --- /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 0000000000000..8ffb777b1aeae --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/NetworkMappingImpl.java @@ -0,0 +1,188 @@ +// Copyright (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 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 0000000000000..f716159186085 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsClientImpl.java @@ -0,0 +1,319 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + @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 0000000000000..f9fc5e2319562 --- /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 0000000000000..eb7c63f56daea --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/OperationsImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.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 0000000000000..0e3d3c1ffb3b3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/PolicyImpl.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.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 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 0000000000000..72b2669f2affc --- /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 0000000000000..40736062caf5d --- /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 0000000000000..f35abfbf61e19 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ProtectionContainerMappingImpl.java @@ -0,0 +1,222 @@ +// Copyright (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 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 0000000000000..b848bc6c94f3a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPlanImpl.java @@ -0,0 +1,236 @@ +// Copyright (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 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 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 0000000000000..a638df994b463 --- /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 0000000000000..63215eedf8f1a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsClientImpl.java @@ -0,0 +1,729 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(RecoveryPointsClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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())); + } + + /** + * 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's 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. + */ + @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)); + } + + /** + * 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's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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)); + } + + /** + * 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's 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. + */ + @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)); + } + + /** + * 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's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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)); + } + + /** + * 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's 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. + */ + @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 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's 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) + 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())); + } + + /** + * 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's 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. + */ + @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); + } + + /** + * 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's 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) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName) { + return getWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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's 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 getAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName) + .block(); + } + + /** + * 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's 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. + */ + @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of recovery point details. + */ + @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 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. + */ + @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 0000000000000..a19d5408586a4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/RecoveryPointsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RecoveryPointsImpl implements RecoveryPoints { + @JsonIgnore private 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 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; + } + } + + 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; + } + } + + 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 0000000000000..4743b041845ed --- /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 0000000000000..9234086a97e0d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsClientImpl.java @@ -0,0 +1,726 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(ReplicationAlertSettingsClientImpl.class); + + /** 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") + private 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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, context)); + } + + /** + * 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) + 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 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. + */ + @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 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) + private Mono getAsync(String resourceName, String resourceGroupName, String alertSettingName) { + return getWithResponseAsync(resourceName, resourceGroupName, alertSettingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, alertSettingName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String alertSettingName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, alertSettingName, context).block(); + } + + /** + * 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) + 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())); + } + + /** + * 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. + */ + @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); + } + + /** + * 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) + private Mono createAsync( + String resourceName, String resourceGroupName, String alertSettingName, ConfigureAlertRequest request) { + return createWithResponseAsync(resourceName, resourceGroupName, alertSettingName, request) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createAsync(resourceName, resourceGroupName, alertSettingName, request).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of alerts. + */ + @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 0000000000000..3b1a6a67be760 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationAlertSettingsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationAlertSettingsImpl implements ReplicationAlertSettings { + @JsonIgnore private 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 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 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 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/ReplicationEligibilityResultsCollectionImpl.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsCollectionImpl.java new file mode 100644 index 0000000000000..c7b6fd4cc2814 --- /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 0000000000000..0f58240e1ceee --- /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 0000000000000..0cbbe391859be --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsClientImpl.java @@ -0,0 +1,401 @@ +// Copyright (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.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 reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ReplicationEligibilityResultsOperationsClient. + */ +public final class ReplicationEligibilityResultsOperationsClientImpl + implements ReplicationEligibilityResultsOperationsClient { + private final ClientLogger logger = new ClientLogger(ReplicationEligibilityResultsOperationsClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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) + 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())); + } + + /** + * 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. + */ + @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); + } + + /** + * 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) + private Mono listAsync( + String resourceGroupName, String virtualMachineName) { + return listWithResponseAsync(resourceGroupName, virtualMachineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listAsync(resourceGroupName, virtualMachineName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String virtualMachineName, Context context) { + return listWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * 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) + 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())); + } + + /** + * 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. + */ + @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); + } + + /** + * 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) + private Mono getAsync(String resourceGroupName, String virtualMachineName) { + return getWithResponseAsync(resourceGroupName, virtualMachineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, virtualMachineName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualMachineName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); + } +} 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 0000000000000..efef6f1880157 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEligibilityResultsOperationsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationEligibilityResultsOperationsImpl implements ReplicationEligibilityResultsOperations { + @JsonIgnore private 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 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 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 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; + } + } + + 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; + } + } + + 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 0000000000000..ba694a8c777cf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsClientImpl.java @@ -0,0 +1,543 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(ReplicationEventsClientImpl.class); + + /** 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") + private 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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceName, String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, filter, context)); + } + + /** + * 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) + 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())); + } + + /** + * 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. + */ + @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); + } + + /** + * 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) + private Mono getAsync(String resourceName, String resourceGroupName, String eventName) { + return getWithResponseAsync(resourceName, resourceGroupName, eventName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, eventName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String eventName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, eventName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of fabric details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of fabric details. + */ + @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 0000000000000..a379603cb11fd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationEventsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationEventsImpl implements ReplicationEvents { + @JsonIgnore private 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 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; + } + } + + 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; + } + } + + 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 0000000000000..547467cec4f49 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationFabricsClientImpl.java @@ -0,0 +1,2550 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationFabricsClientImpl.class); + + /** 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") + private 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, + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @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 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) + private Mono> getWithResponseAsync( + 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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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) + private Mono> getWithResponseAsync( + 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 + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + accept, + context); + } + + /** + * 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) + private Mono getAsync(String resourceName, String resourceGroupName, String fabricName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) { + return getAsync(resourceName, resourceGroupName, fabricName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, context).block(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, FabricInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, input).getSyncPoller(); + } + + /** + * 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 SyncPoller, FabricInner> beginCreate( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input, Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, input, context).getSyncPoller(); + } + + /** + * 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) + private Mono createAsync( + String resourceName, String resourceGroupName, String fabricName, FabricCreationInput input) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPurge( + String resourceName, String resourceGroupName, String fabricName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPurge( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, context).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeAsync(String resourceName, String resourceGroupName, String fabricName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, FabricInner> beginCheckConsistency( + String resourceName, String resourceGroupName, String fabricName) { + return beginCheckConsistencyAsync(resourceName, resourceGroupName, fabricName).getSyncPoller(); + } + + /** + * 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 SyncPoller, FabricInner> beginCheckConsistency( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginCheckConsistencyAsync(resourceName, resourceGroupName, fabricName, context).getSyncPoller(); + } + + /** + * 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) + private Mono checkConsistencyAsync(String resourceName, String resourceGroupName, String fabricName) { + return beginCheckConsistencyAsync(resourceName, resourceGroupName, fabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + private Mono checkConsistencyAsync( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginCheckConsistencyAsync(resourceName, resourceGroupName, fabricName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginMigrateToAad( + String resourceName, String resourceGroupName, String fabricName) { + return beginMigrateToAadAsync(resourceName, resourceGroupName, fabricName).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginMigrateToAad( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginMigrateToAadAsync(resourceName, resourceGroupName, fabricName, context).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateToAadAsync(String resourceName, String resourceGroupName, String fabricName) { + return beginMigrateToAadAsync(resourceName, resourceGroupName, fabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, FabricInner> beginReassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest) { + return beginReassociateGatewayAsync(resourceName, resourceGroupName, fabricName, failoverProcessServerRequest) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, FabricInner> beginReassociateGateway( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest, + Context context) { + return beginReassociateGatewayAsync( + resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, context) + .getSyncPoller(); + } + + /** + * 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) + private Mono reassociateGatewayAsync( + String resourceName, + String resourceGroupName, + String fabricName, + FailoverProcessServerRequest failoverProcessServerRequest) { + return beginReassociateGatewayAsync(resourceName, resourceGroupName, fabricName, failoverProcessServerRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, context).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceName, String resourceGroupName, String fabricName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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 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) + 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 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) + 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 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) + 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, Context.NONE); + } + + /** + * 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) + 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 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 SyncPoller, FabricInner> beginRenewCertificate( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate) { + return beginRenewCertificateAsync(resourceName, resourceGroupName, fabricName, renewCertificate) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, FabricInner> beginRenewCertificate( + String resourceName, + String resourceGroupName, + String fabricName, + RenewCertificateInput renewCertificate, + Context context) { + return beginRenewCertificateAsync(resourceName, resourceGroupName, fabricName, renewCertificate, context) + .getSyncPoller(); + } + + /** + * 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) + private Mono renewCertificateAsync( + String resourceName, String resourceGroupName, String fabricName, RenewCertificateInput renewCertificate) { + return beginRenewCertificateAsync(resourceName, resourceGroupName, fabricName, renewCertificate) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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 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 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of fabric details. + */ + @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 0000000000000..3f948ab95eccf --- /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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationFabricsImpl implements ReplicationFabrics { + @JsonIgnore private 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 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 Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceName, resourceGroupName, fabricName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FabricImpl(inner.getValue(), 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))); + } + return this.getWithResponse(resourceName, resourceGroupName, fabricName, 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))); + } + return this.getWithResponse(resourceName, resourceGroupName, fabricName, 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 0000000000000..c2195da7a347e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsClientImpl.java @@ -0,0 +1,1692 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationJobsClientImpl.class); + + /** 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") + private 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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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) + 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())); + } + + /** + * 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. + */ + @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); + } + + /** + * 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) + private Mono getAsync(String resourceName, String resourceGroupName, String jobName) { + return getWithResponseAsync(resourceName, resourceGroupName, jobName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, jobName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String jobName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, jobName, context).block(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, JobInner> beginCancel( + String resourceName, String resourceGroupName, String jobName) { + return beginCancelAsync(resourceName, resourceGroupName, jobName).getSyncPoller(); + } + + /** + * 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 SyncPoller, JobInner> beginCancel( + String resourceName, String resourceGroupName, String jobName, Context context) { + return beginCancelAsync(resourceName, resourceGroupName, jobName, context).getSyncPoller(); + } + + /** + * 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) + private Mono cancelAsync(String resourceName, String resourceGroupName, String jobName) { + return beginCancelAsync(resourceName, resourceGroupName, jobName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + private Mono cancelAsync(String resourceName, String resourceGroupName, String jobName, Context context) { + return beginCancelAsync(resourceName, resourceGroupName, jobName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, JobInner> beginRestart( + String resourceName, String resourceGroupName, String jobName) { + return beginRestartAsync(resourceName, resourceGroupName, jobName).getSyncPoller(); + } + + /** + * 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 SyncPoller, JobInner> beginRestart( + String resourceName, String resourceGroupName, String jobName, Context context) { + return beginRestartAsync(resourceName, resourceGroupName, jobName, context).getSyncPoller(); + } + + /** + * 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) + private Mono restartAsync(String resourceName, String resourceGroupName, String jobName) { + return beginRestartAsync(resourceName, resourceGroupName, jobName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + private Mono restartAsync( + String resourceName, String resourceGroupName, String jobName, Context context) { + return beginRestartAsync(resourceName, resourceGroupName, jobName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, JobInner> beginResume( + String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams) { + return beginResumeAsync(resourceName, resourceGroupName, jobName, resumeJobParams).getSyncPoller(); + } + + /** + * 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 SyncPoller, JobInner> beginResume( + String resourceName, + String resourceGroupName, + String jobName, + ResumeJobParams resumeJobParams, + Context context) { + return beginResumeAsync(resourceName, resourceGroupName, jobName, resumeJobParams, context).getSyncPoller(); + } + + /** + * 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) + private Mono resumeAsync( + String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams) { + return beginResumeAsync(resourceName, resourceGroupName, jobName, resumeJobParams) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, JobInner> beginExport( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter) { + return beginExportAsync(resourceName, resourceGroupName, jobQueryParameter).getSyncPoller(); + } + + /** + * 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 SyncPoller, JobInner> beginExport( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context) { + return beginExportAsync(resourceName, resourceGroupName, jobQueryParameter, context).getSyncPoller(); + } + + /** + * 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) + private Mono exportAsync( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter) { + return beginExportAsync(resourceName, resourceGroupName, jobQueryParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + private Mono exportAsync( + String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context) { + return beginExportAsync(resourceName, resourceGroupName, jobQueryParameter, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of jobs. + */ + @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 0000000000000..eab6ca5e16517 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationJobsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationJobsImpl implements ReplicationJobs { + @JsonIgnore private 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 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 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 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 0000000000000..fe549373523d1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksClientImpl.java @@ -0,0 +1,556 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(ReplicationLogicalNetworksClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, logicalNetworkName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, logicalNetworkName).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of logical networks. + */ + @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 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. + */ + @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 0000000000000..d5ea02ff42576 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationLogicalNetworksImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationLogicalNetworksImpl implements ReplicationLogicalNetworks { + @JsonIgnore private 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 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; + } + } + + 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; + } + } + + 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 0000000000000..e82178c2f0218 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsClientImpl.java @@ -0,0 +1,3620 @@ +// Copyright (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.logging.ClientLogger; +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.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 { + private final ClientLogger logger = new ClientLogger(ReplicationMigrationItemsClientImpl.class); + + /** 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") + private 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, + @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}/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("$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 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. + */ + @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 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 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. + */ + @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 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 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. + */ + @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 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 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) + 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. + */ + @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. + */ + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName) + .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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, context) + .block(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, MigrationItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + EnableMigrationInput input) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption) { + return beginDeleteAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, deleteOption) + .getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption) { + deleteAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, deleteOption) + .block(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, MigrationItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + UpdateMigrationItemInput input) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, MigrationItemInner> beginMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + MigrateInput migrateInput) { + return beginMigrateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrateInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, MigrationItemInner> beginTestMigrate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateInput testMigrateInput) { + return beginTestMigrateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, MigrationItemInner> beginTestMigrateCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + TestMigrateCleanupInput testMigrateCleanupInput) { + return beginTestMigrateCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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 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. + */ + @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 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 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. + */ + @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 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 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. + */ + @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 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. + */ + @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 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 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. + */ + @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 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. + */ + @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 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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return migration item collection. + */ + @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 0000000000000..4ed848ddaa6b3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationMigrationItemsImpl.java @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.ReplicationMigrationItems; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestMigrateInput; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationMigrationItemsImpl implements ReplicationMigrationItems { + @JsonIgnore private 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, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, resourceGroupName, fabricName, protectionContainerName, context); + return Utils.mapPage(inner, inner1 -> new MigrationItemImpl(inner1, this.manager())); + } + + 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 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 void delete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String deleteOption) { + this + .serviceClient() + .delete( + resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, deleteOption); + } + + 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 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 filter, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, skipToken, 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 0000000000000..b07235ff94c9e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsClientImpl.java @@ -0,0 +1,2063 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationNetworkMappingsClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName) { + return new PagedIterable<>( + listByReplicationNetworksAsync(resourceName, resourceGroupName, fabricName, networkName)); + } + + /** + * 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, NetworkMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + CreateNetworkMappingInput input) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName) + .getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, NetworkMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + UpdateNetworkMappingInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network mappings. + */ + @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 0000000000000..78dfb2bb40b58 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworkMappingsImpl.java @@ -0,0 +1,318 @@ +// Copyright (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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationNetworkMappingsImpl implements ReplicationNetworkMappings { + @JsonIgnore private 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 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 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 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 0000000000000..6391f61b90db5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksClientImpl.java @@ -0,0 +1,822 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(ReplicationNetworksClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String networkName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, networkName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, networkName).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of networks. + */ + @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 0000000000000..dcb1a4a51c51f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationNetworksImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationNetworksImpl implements ReplicationNetworks { + @JsonIgnore private 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 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 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 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 0000000000000..893b833589a17 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesClientImpl.java @@ -0,0 +1,1380 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationPoliciesClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, context)); + } + + /** + * 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) + 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 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. + */ + @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 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) + private Mono getAsync(String resourceName, String resourceGroupName, String policyName) { + return getWithResponseAsync(resourceName, resourceGroupName, policyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, policyName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String policyName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, policyName, context).block(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, PolicyInner> beginCreate( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input) { + return beginCreateAsync(resourceName, resourceGroupName, policyName, input).getSyncPoller(); + } + + /** + * 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 SyncPoller, PolicyInner> beginCreate( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input, Context context) { + return beginCreateAsync(resourceName, resourceGroupName, policyName, input, context).getSyncPoller(); + } + + /** + * 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) + private Mono createAsync( + String resourceName, String resourceGroupName, String policyName, CreatePolicyInput input) { + return beginCreateAsync(resourceName, resourceGroupName, policyName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String policyName) { + return beginDeleteAsync(resourceName, resourceGroupName, policyName).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String policyName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, policyName, context).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceName, String resourceGroupName, String policyName) { + return beginDeleteAsync(resourceName, resourceGroupName, policyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, PolicyInner> beginUpdate( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, policyName, input).getSyncPoller(); + } + + /** + * 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 SyncPoller, PolicyInner> beginUpdate( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input, Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, policyName, input, context).getSyncPoller(); + } + + /** + * 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) + private Mono updateAsync( + String resourceName, String resourceGroupName, String policyName, UpdatePolicyInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, policyName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Profile Collection details. + */ + @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 0000000000000..ff1fd752d623e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationPoliciesImpl.java @@ -0,0 +1,197 @@ +// Copyright (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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationPoliciesImpl implements ReplicationPolicies { + @JsonIgnore private 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 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 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 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 0000000000000..3bc817444d9bc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsClientImpl.java @@ -0,0 +1,687 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(ReplicationProtectableItemsClientImpl.class); + + /** 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") + private 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, + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + 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, + 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())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByReplicationProtectionContainersSinglePageAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + 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, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, filter), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + final String filter = null; + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, filter), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationProtectionContainersAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listByReplicationProtectionContainersSinglePageAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, filter, context), + nextLink -> listByReplicationProtectionContainersNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + final String filter = null; + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, filter)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + Context context) { + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, filter, context)); + } + + /** + * 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) + 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())); + } + + /** + * 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. + */ + @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); + } + + /** + * 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) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, protectableItemName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, protectableItemName) + .block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protectable item collection. + */ + @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 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. + */ + @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 0000000000000..7be5ae78622fb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectableItemsImpl.java @@ -0,0 +1,104 @@ +// Copyright (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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationProtectableItemsImpl implements ReplicationProtectableItems { + @JsonIgnore private 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, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByReplicationProtectionContainers( + resourceName, resourceGroupName, fabricName, protectionContainerName, filter, context); + return Utils.mapPage(inner, inner1 -> new ProtectableItemImpl(inner1, this.manager())); + } + + 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; + } + } + + 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; + } + } + + 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 0000000000000..4f45bc213f6a4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemImpl.java @@ -0,0 +1,511 @@ +// Copyright (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.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +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 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 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 rrInput) { + return serviceManager + .replicationProtectedItems() + .reprotect( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput); + } + + public ReplicationProtectedItem reprotect(ReverseReplicationInput rrInput, Context context) { + return serviceManager + .replicationProtectedItems() + .reprotect( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput, + 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 testFailover(TestFailoverInput failoverInput) { + return serviceManager + .replicationProtectedItems() + .testFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput); + } + + public ReplicationProtectedItem testFailover(TestFailoverInput failoverInput, Context context) { + return serviceManager + .replicationProtectedItems() + .testFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + 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 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 0000000000000..d8fd562ba76a9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsClientImpl.java @@ -0,0 +1,8330 @@ +// Copyright (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.logging.ClientLogger; +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.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationProtectedItemsClientImpl.class); + + /** 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") + private 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}/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 rrInput, + @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}/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 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}" + + "/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/{replicationProtectedItemName}" + + "/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("replicationProtectedItemName") String replicationProtectedItemName, + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return getWithResponseAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + EnableProtectionInput input) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginPurgeAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UpdateReplicationProtectedItemInput updateProtectionInput) { + return beginUpdateAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> beginAddDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + AddDisksInput addDisksInput) { + return beginAddDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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's 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) + 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())); + } + + /** + * 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's 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) + 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); + } + + /** + * 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's 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) + 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, + Context.NONE); + } + + /** + * 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's 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) + 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); + } + + /** + * 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's 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 SyncPoller, ReplicationProtectedItemInner> beginApplyRecoveryPoint( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ApplyRecoveryPointInput applyRecoveryPointInput) { + return beginApplyRecoveryPointAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput) + .getSyncPoller(); + } + + /** + * 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's 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 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(); + } + + /** + * 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's 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) + 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); + } + + /** + * 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's 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) + 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); + } + + /** + * 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's 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(); + } + + /** + * 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's 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> beginFailoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginFailoverCommitAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> beginFailoverCommit( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginFailoverCommitAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .getSyncPoller(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 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 replication protected item. + */ + @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())); + } + + /** + * 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 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 replication protected item. + */ + @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); + } + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 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 replication protected item. + */ + @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); + } + + /** + * 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 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 replication protected item. + */ + @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); + } + + /** + * 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 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 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(); + } + + /** + * 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 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 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> beginRemoveDisks( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + RemoveDisksInput removeDisksInput) { + return beginRemoveDisksAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> beginRepairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName) { + return beginRepairReplicationAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> beginRepairReplication( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context) { + return beginRepairReplicationAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + context) + .getSyncPoller(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reprotectWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and 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 (rrInput == null) { + return Mono.error(new IllegalArgumentException("Parameter rrInput is required and cannot be null.")); + } else { + rrInput.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, + rrInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reprotectWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput, + 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 (rrInput == null) { + return Mono.error(new IllegalArgumentException("Parameter rrInput is required and cannot be null.")); + } else { + rrInput.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, + rrInput, + accept, + context); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ReplicationProtectedItemInner> beginReprotectAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput) { + Mono>> mono = + reprotectWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + Context.NONE); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ReplicationProtectedItemInner> beginReprotectAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reprotectWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ReplicationProtectedItemInner> beginReprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput) { + return beginReprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput) + .getSyncPoller(); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ReplicationProtectedItemInner> beginReprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput, + Context context) { + return beginReprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput, + context) + .getSyncPoller(); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reprotectAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput) { + return beginReprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reprotectAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput, + Context context) { + return beginReprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput) { + return reprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput) + .block(); + } + + /** + * 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 rrInput 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationProtectedItemInner reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput, + Context context) { + return reprotectAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput, + context) + .block(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> + beginResolveHealthErrors( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ResolveHealthInput resolveHealthInput) { + return beginResolveHealthErrorsAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 failoverInput 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) + private Mono>> testFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput 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 + .testFailover( + 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())); + } + + /** + * 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 failoverInput 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) + private Mono>> testFailoverWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput 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 + .testFailover( + this.client.getEndpoint(), + this.client.getApiVersion(), + resourceName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + accept, + context); + } + + /** + * 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 failoverInput 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) + private PollerFlux, ReplicationProtectedItemInner> beginTestFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput failoverInput) { + Mono>> mono = + testFailoverWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + Context.NONE); + } + + /** + * 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 failoverInput 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) + private PollerFlux, ReplicationProtectedItemInner> beginTestFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput failoverInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + testFailoverWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * 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 failoverInput 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 SyncPoller, ReplicationProtectedItemInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput failoverInput) { + return beginTestFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput) + .getSyncPoller(); + } + + /** + * 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 failoverInput 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 SyncPoller, ReplicationProtectedItemInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput failoverInput, + Context context) { + return beginTestFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context) + .getSyncPoller(); + } + + /** + * 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 failoverInput 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) + private Mono testFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput failoverInput) { + return beginTestFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 failoverInput 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) + private Mono testFailoverAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput failoverInput, + Context context) { + return beginTestFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 failoverInput 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 failoverInput) { + return testFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput) + .block(); + } + + /** + * 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 failoverInput 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 failoverInput, + Context context) { + return testFailoverAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + context) + .block(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ReplicationProtectedItemInner> + beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverCleanupInput cleanupInput) { + return beginTestFailoverCleanupAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 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 replication protected item. + */ + @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())); + } + + /** + * 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 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 replication protected item. + */ + @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); + } + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 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 replication protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 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 replication protected item. + */ + @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); + } + + /** + * 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 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 replication protected item. + */ + @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); + } + + /** + * 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 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 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(); + } + + /** + * 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 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 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(); + } + + /** + * 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 replicationProtectedItemName 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) + private Mono>> updateMobilityServiceWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + 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 (replicationProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicationProtectedItemName 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, + replicationProtectedItemName, + updateMobilityServiceRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 replicationProtectedItemName 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) + private Mono>> updateMobilityServiceWithResponseAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + 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 (replicationProtectedItemName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicationProtectedItemName 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, + replicationProtectedItemName, + updateMobilityServiceRequest, + accept, + context); + } + + /** + * 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 replicationProtectedItemName 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) + private PollerFlux, ReplicationProtectedItemInner> + beginUpdateMobilityServiceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + Mono>> mono = + updateMobilityServiceWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + updateMobilityServiceRequest); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + Context.NONE); + } + + /** + * 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 replicationProtectedItemName 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) + private PollerFlux, ReplicationProtectedItemInner> + beginUpdateMobilityServiceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateMobilityServiceWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + updateMobilityServiceRequest, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationProtectedItemInner.class, + ReplicationProtectedItemInner.class, + context); + } + + /** + * 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 replicationProtectedItemName 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 SyncPoller, ReplicationProtectedItemInner> + beginUpdateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + return beginUpdateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + updateMobilityServiceRequest) + .getSyncPoller(); + } + + /** + * 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 replicationProtectedItemName 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 SyncPoller, ReplicationProtectedItemInner> + beginUpdateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + return beginUpdateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + updateMobilityServiceRequest, + context) + .getSyncPoller(); + } + + /** + * 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 replicationProtectedItemName 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) + private Mono updateMobilityServiceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + return beginUpdateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + updateMobilityServiceRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 replicationProtectedItemName 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) + private Mono updateMobilityServiceAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + return beginUpdateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + updateMobilityServiceRequest, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 replicationProtectedItemName 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 replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + return updateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + updateMobilityServiceRequest) + .block(); + } + + /** + * 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 replicationProtectedItemName 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 replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + return updateMobilityServiceAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + updateMobilityServiceRequest, + context) + .block(); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return replication protected item collection. + */ + @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 0000000000000..8656728746af0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectedItemsImpl.java @@ -0,0 +1,899 @@ +// Copyright (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.TestFailoverCleanupInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.TestFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UnplannedFailoverInput; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationProtectedItemsImpl implements ReplicationProtectedItems { + @JsonIgnore private 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 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 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 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 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 rrInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .reprotect( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput); + 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 rrInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .reprotect( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + rrInput, + 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 testFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + TestFailoverInput failoverInput) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .testFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput); + 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 failoverInput, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .testFailover( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput, + 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 updateMobilityService( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .updateMobilityService( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + 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 replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context) { + ReplicationProtectedItemInner inner = + this + .serviceClient() + .updateMobilityService( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicationProtectedItemName, + 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 0000000000000..f0a466ea6d261 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsClientImpl.java @@ -0,0 +1,2578 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationProtectionContainerMappingsClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return new PagedIterable<>( + listByReplicationProtectionContainersAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName)); + } + + /** + * 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ProtectionContainerMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + CreateProtectionContainerMappingInput creationInput) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, creationInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPurge( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName) + .getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ProtectionContainerMappingInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + UpdateProtectionContainerMappingInput updateInput) { + return beginUpdateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection container mapping collection class. + */ + @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 0000000000000..e8ea366442b73 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainerMappingsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationProtectionContainerMappingsImpl implements ReplicationProtectionContainerMappings { + @JsonIgnore private 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 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 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 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 0000000000000..4d133211b8a82 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersClientImpl.java @@ -0,0 +1,2349 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationProtectionContainersClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, protectionContainerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, protectionContainerName).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ProtectionContainerInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, ProtectionContainerInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + CreateProtectionContainerInput creationInput, + Context context) { + return beginCreateAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput, context) + .getSyncPoller(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ProtectionContainerInner> beginDiscoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest) { + return beginDiscoverProtectableItemAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, ProtectionContainerInner> beginDiscoverProtectableItem( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + DiscoverProtectableItemRequest discoverProtectableItemRequest, + Context context) { + return beginDiscoverProtectableItemAsync( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest, + context) + .getSyncPoller(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, protectionContainerName, context) + .getSyncPoller(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, ProtectionContainerInner> beginSwitchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput) { + return beginSwitchProtectionAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, ProtectionContainerInner> beginSwitchProtection( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + SwitchProtectionInput switchInput, + Context context) { + return beginSwitchProtectionAsync( + resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, context) + .getSyncPoller(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return protection Container collection. + */ + @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 0000000000000..d9bec04800135 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionContainersImpl.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationProtectionContainersImpl implements ReplicationProtectionContainers { + @JsonIgnore private 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 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 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 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 0000000000000..8be7ce13bb41b --- /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 0000000000000..bbaf5395f607a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsClientImpl.java @@ -0,0 +1,733 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(ReplicationProtectionIntentsClientImpl.class); + + /** 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") + private 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, + @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 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. + */ + @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 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 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. + */ + @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 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, String resourceGroupName, String intentObjectName) { + return getWithResponseAsync(resourceName, resourceGroupName, intentObjectName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, intentObjectName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String intentObjectName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, intentObjectName, context).block(); + } + + /** + * 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) + 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())); + } + + /** + * 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. + */ + @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); + } + + /** + * 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) + private Mono createAsync( + String resourceName, String resourceGroupName, String intentObjectName, CreateProtectionIntentInput input) { + return createWithResponseAsync(resourceName, resourceGroupName, intentObjectName, input) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createAsync(resourceName, resourceGroupName, intentObjectName, input).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return replication protection intent objects collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return replication protection intent objects collection. + */ + @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 0000000000000..c63e243a85397 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationProtectionIntentsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationProtectionIntentsImpl implements ReplicationProtectionIntents { + @JsonIgnore private 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, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ReplicationProtectionIntentImpl(inner1, this.manager())); + } + + 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 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 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 0000000000000..49d88ec25e19b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansClientImpl.java @@ -0,0 +1,3317 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationRecoveryPlansClientImpl.class); + + /** 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") + private 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}/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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, context)); + } + + /** + * 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) + 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 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. + */ + @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 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) + private Mono getAsync(String resourceName, String resourceGroupName, String recoveryPlanName) { + return getWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, recoveryPlanName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, recoveryPlanName, context).block(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, RecoveryPlanInner> beginCreate( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input) { + return beginCreateAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * 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 SyncPoller, RecoveryPlanInner> beginCreate( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + CreateRecoveryPlanInput input, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, recoveryPlanName, input, context).getSyncPoller(); + } + + /** + * 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) + private Mono createAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, CreateRecoveryPlanInput input) { + return beginCreateAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginDeleteAsync(resourceName, resourceGroupName, recoveryPlanName).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, recoveryPlanName, context).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginDeleteAsync(resourceName, resourceGroupName, recoveryPlanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, RecoveryPlanInner> beginUpdate( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * 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 SyncPoller, RecoveryPlanInner> beginUpdate( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + UpdateRecoveryPlanInput input, + Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, recoveryPlanName, input, context).getSyncPoller(); + } + + /** + * 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) + private Mono updateAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, UpdateRecoveryPlanInput input) { + return beginUpdateAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * The operation to commit the fail over 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) + 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())); + } + + /** + * The operation to commit the fail over 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) + 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); + } + + /** + * The operation to commit the fail over 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) + 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, Context.NONE); + } + + /** + * The operation to commit the fail over 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) + 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); + } + + /** + * The operation to commit the fail over 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 SyncPoller, RecoveryPlanInner> beginFailoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginFailoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName).getSyncPoller(); + } + + /** + * The operation to commit the fail over 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 SyncPoller, RecoveryPlanInner> beginFailoverCommit( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginFailoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName, context).getSyncPoller(); + } + + /** + * The operation to commit the fail over 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) + private Mono failoverCommitAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginFailoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to commit the fail over 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) + private Mono failoverCommitAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginFailoverCommitAsync(resourceName, resourceGroupName, recoveryPlanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to commit the fail over 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(); + } + + /** + * The operation to commit the fail over 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, RecoveryPlanInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input) { + return beginPlannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * 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 SyncPoller, RecoveryPlanInner> beginPlannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input, + Context context) { + return beginPlannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .getSyncPoller(); + } + + /** + * 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) + private Mono plannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanPlannedFailoverInput input) { + return beginPlannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, RecoveryPlanInner> beginReprotect( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginReprotectAsync(resourceName, resourceGroupName, recoveryPlanName).getSyncPoller(); + } + + /** + * 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 SyncPoller, RecoveryPlanInner> beginReprotect( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginReprotectAsync(resourceName, resourceGroupName, recoveryPlanName, context).getSyncPoller(); + } + + /** + * 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) + private Mono reprotectAsync( + String resourceName, String resourceGroupName, String recoveryPlanName) { + return beginReprotectAsync(resourceName, resourceGroupName, recoveryPlanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + private Mono reprotectAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context) { + return beginReprotectAsync(resourceName, resourceGroupName, recoveryPlanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 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) + 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())); + } + + /** + * 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 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) + 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); + } + + /** + * 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 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) + 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, Context.NONE); + } + + /** + * 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 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) + 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); + } + + /** + * 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 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 SyncPoller, RecoveryPlanInner> beginTestFailover( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input) { + return beginTestFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * 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 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 SyncPoller, RecoveryPlanInner> beginTestFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverInput input, + Context context) { + return beginTestFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .getSyncPoller(); + } + + /** + * 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 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) + private Mono testFailoverAsync( + String resourceName, String resourceGroupName, String recoveryPlanName, RecoveryPlanTestFailoverInput input) { + return beginTestFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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) + 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); + } + + /** + * 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 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(); + } + + /** + * 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 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(); + } + + /** + * 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 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) + 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())); + } + + /** + * 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 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) + 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); + } + + /** + * 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 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) + 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, Context.NONE); + } + + /** + * 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 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) + 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); + } + + /** + * 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 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 SyncPoller, RecoveryPlanInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input) { + return beginTestFailoverCleanupAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * 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 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 SyncPoller, RecoveryPlanInner> beginTestFailoverCleanup( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input, + Context context) { + return beginTestFailoverCleanupAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .getSyncPoller(); + } + + /** + * 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 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) + private Mono testFailoverCleanupAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanTestFailoverCleanupInput input) { + return beginTestFailoverCleanupAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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) + 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); + } + + /** + * 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 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(); + } + + /** + * 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 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(); + } + + /** + * The operation to start 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 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) + 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())); + } + + /** + * The operation to start 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 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) + 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); + } + + /** + * The operation to start 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 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) + 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, Context.NONE); + } + + /** + * The operation to start 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 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) + 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); + } + + /** + * The operation to start 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 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 SyncPoller, RecoveryPlanInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input) { + return beginUnplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).getSyncPoller(); + } + + /** + * The operation to start 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 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 SyncPoller, RecoveryPlanInner> beginUnplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context) { + return beginUnplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input, context) + .getSyncPoller(); + } + + /** + * The operation to start 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 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) + private Mono unplannedFailoverAsync( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input) { + return beginUnplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to start 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 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) + 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); + } + + /** + * The operation to start 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 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 unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input) { + return unplannedFailoverAsync(resourceName, resourceGroupName, recoveryPlanName, input).block(); + } + + /** + * The operation to start 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 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 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recovery plan collection details. + */ + @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 0000000000000..a7f8d6362d575 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryPlansImpl.java @@ -0,0 +1,359 @@ +// Copyright (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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { + @JsonIgnore private 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 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 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 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 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 0000000000000..4db8df44c506f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersClientImpl.java @@ -0,0 +1,2100 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationRecoveryServicesProvidersClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, providerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, providerName).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, RecoveryServicesProviderInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String providerName, + AddRecoveryServicesProviderInput addProviderInput, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, providerName, addProviderInput, context) + .getSyncPoller(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPurge( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPurge( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return beginPurgeAsync(resourceName, resourceGroupName, fabricName, providerName, context).getSyncPoller(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); + } + + /** + * 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 SyncPoller, RecoveryServicesProviderInner> beginRefreshProvider( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName, context) + .getSyncPoller(); + } + + /** + * 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) + private Mono refreshProviderAsync( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginRefreshProviderAsync(resourceName, resourceGroupName, fabricName, providerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String providerName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, providerName, context).getSyncPoller(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of providers. + */ + @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 0000000000000..d5ad472fae179 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationRecoveryServicesProvidersImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationRecoveryServicesProvidersImpl implements ReplicationRecoveryServicesProviders { + @JsonIgnore private 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 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 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 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 0000000000000..b493bc5f4c577 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsClientImpl.java @@ -0,0 +1,1842 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationStorageClassificationMappingsClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationStorageClassifications( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + return new PagedIterable<>( + listByReplicationStorageClassificationsAsync( + resourceName, resourceGroupName, fabricName, storageClassificationName)); + } + + /** + * 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + return getWithResponseAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName) + .block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, + Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, StorageClassificationMappingInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + StorageClassificationMappingInput pairingInput) { + return beginCreateAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput) + .getSyncPoller(); + } + + /** + * 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 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(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName) { + return beginDeleteAsync( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName) + .getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage mapping details. + */ + @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 0000000000000..32261a7d5f86b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationMappingsImpl.java @@ -0,0 +1,398 @@ +// Copyright (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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationStorageClassificationMappingsImpl implements ReplicationStorageClassificationMappings { + @JsonIgnore + private 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 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 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 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 0000000000000..7365fad21b1b5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsClientImpl.java @@ -0,0 +1,849 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(ReplicationStorageClassificationsClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, storageClassificationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, storageClassificationName).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of storage details. + */ + @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 0000000000000..98170be528b06 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationStorageClassificationsImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationStorageClassificationsImpl implements ReplicationStorageClassifications { + @JsonIgnore private 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 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 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 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 0000000000000..2ea3fe6470818 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsClientImpl.java @@ -0,0 +1,483 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationVaultHealthsClientImpl.class); + + /** 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") + private 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 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) + 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 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. + */ + @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 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) + private Mono getAsync(String resourceName, String resourceGroupName) { + return getWithResponseAsync(resourceName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + 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. + */ + @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 vault health details definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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) + 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 vault health details definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 vault health details definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + */ + @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. + */ + @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 0000000000000..bdcbd090e78b1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultHealthsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationVaultHealthsImpl implements ReplicationVaultHealths { + @JsonIgnore private 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 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 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 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 0000000000000..6e5ca868ec570 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsClientImpl.java @@ -0,0 +1,726 @@ +// Copyright (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.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.VaultSettingCollection; +import com.azure.resourcemanager.recoveryservicessiterecovery.models.VaultSettingCreationInput; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationVaultSettingsClientImpl.class); + + /** 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") + private 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. 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. + */ + @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. 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. + */ + @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. 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. + */ + @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. 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. + */ + @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. 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName, context)); + } + + /** + * 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) + 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. 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. + */ + @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. 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) + private Mono getAsync(String resourceName, String resourceGroupName, String vaultSettingName) { + return getWithResponseAsync(resourceName, resourceGroupName, vaultSettingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, vaultSettingName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, String vaultSettingName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, vaultSettingName, context).block(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + private Mono createAsync( + String resourceName, String resourceGroupName, String vaultSettingName, VaultSettingCreationInput input) { + return createWithResponseAsync(resourceName, resourceGroupName, vaultSettingName, input) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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(); + } + + /** + * 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 Response createWithResponse( + String resourceName, + String resourceGroupName, + String vaultSettingName, + VaultSettingCreationInput input, + Context context) { + return createWithResponseAsync(resourceName, resourceGroupName, vaultSettingName, input, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault setting collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault setting collection. + */ + @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 0000000000000..163f4a1e5fa69 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationVaultSettingsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationVaultSettingsImpl implements ReplicationVaultSettings { + @JsonIgnore private 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 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 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 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 0000000000000..deae0ddc2b9ee --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersClientImpl.java @@ -0,0 +1,1853 @@ +// Copyright (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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ReplicationvCentersClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByReplicationFabricsAsync( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listByReplicationFabricsSinglePageAsync(resourceName, resourceGroupName, fabricName), + nextLink -> listByReplicationFabricsNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName) { + return new PagedIterable<>(listByReplicationFabricsAsync(resourceName, resourceGroupName, fabricName)); + } + + /** + * 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. + */ + @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 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) + 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 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. + */ + @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 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) + private Mono getAsync( + String resourceName, String resourceGroupName, String fabricName, String vCenterName) { + return getWithResponseAsync(resourceName, resourceGroupName, fabricName, vCenterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceName, resourceGroupName, fabricName, vCenterName).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, VCenterInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String vCenterName, + AddVCenterRequest addVCenterRequest) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, vCenterName, addVCenterRequest) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, VCenterInner> beginCreate( + String resourceName, + String resourceGroupName, + String fabricName, + String vCenterName, + AddVCenterRequest addVCenterRequest, + Context context) { + return beginCreateAsync(resourceName, resourceGroupName, fabricName, vCenterName, addVCenterRequest, context) + .getSyncPoller(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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 completion. + */ + @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())); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String vCenterName) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, vCenterName).getSyncPoller(); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceName, String resourceGroupName, String fabricName, String vCenterName, Context context) { + return beginDeleteAsync(resourceName, resourceGroupName, fabricName, vCenterName, context).getSyncPoller(); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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 completion. + */ + @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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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) + 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())); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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, Context.NONE); + } + + /** + * 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) + 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); + } + + /** + * 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 SyncPoller, VCenterInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String vCenterName, + UpdateVCenterRequest updateVCenterRequest) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, vCenterName, updateVCenterRequest) + .getSyncPoller(); + } + + /** + * 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 SyncPoller, VCenterInner> beginUpdate( + String resourceName, + String resourceGroupName, + String fabricName, + String vCenterName, + UpdateVCenterRequest updateVCenterRequest, + Context context) { + return beginUpdateAsync(resourceName, resourceGroupName, fabricName, vCenterName, updateVCenterRequest, context) + .getSyncPoller(); + } + + /** + * 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) + 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); + } + + /** + * 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) + 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); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceName, String resourceGroupName) { + return new PagedIterable<>(listAsync(resourceName, resourceGroupName)); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of vCenter details. + */ + @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 0000000000000..59eec4d9a14ad --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/ReplicationvCentersImpl.java @@ -0,0 +1,248 @@ +// Copyright (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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationvCentersImpl implements ReplicationvCenters { + @JsonIgnore private 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 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 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 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 0000000000000..07592790b7eb7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientBuilder.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.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the 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 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 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 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() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + SiteRecoveryManagementClientImpl client = + new SiteRecoveryManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + 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 0000000000000..6152b6a20b405 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SiteRecoveryManagementClientImpl.java @@ -0,0 +1,657 @@ +// Copyright (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.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.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 java.util.Map; +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 { + private final ClientLogger logger = new ClientLogger(SiteRecoveryManagementClientImpl.class); + + /** The subscription Id. */ + private final String subscriptionId; + + /** + * Gets The subscription Id. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The 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 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 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 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 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 = "2021-03-01"; + this.operations = new OperationsClientImpl(this); + this.replicationAlertSettings = new ReplicationAlertSettingsClientImpl(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.replicationProtectionIntents = new ReplicationProtectionIntentsClientImpl(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.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) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/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 0000000000000..ac6ce7d75f8b6 --- /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 0000000000000..b278e9e9c0dca --- /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 0000000000000..34adf492fbab9 --- /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 0000000000000..fdd4b285708ce --- /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.core.util.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(SupportedOperatingSystemsOperationsClientImpl.class); + + /** 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") + private 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, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the data of supported OSes 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 OSes by SRS. + */ + @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 data of supported OSes 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 OSes by SRS. + */ + @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 data of supported OSes 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 OSes by SRS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceName, String resourceGroupName) { + return getWithResponseAsync(resourceName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the data of supported OSes 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 OSes by SRS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportedOperatingSystemsInner get(String resourceName, String resourceGroupName) { + return getAsync(resourceName, resourceGroupName).block(); + } + + /** + * Gets the data of supported OSes 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 OSes by SRS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceName, String resourceGroupName, Context context) { + return getWithResponseAsync(resourceName, resourceGroupName, context).block(); + } +} 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 0000000000000..961b2cd30ed50 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/SupportedOperatingSystemsOperationsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SupportedOperatingSystemsOperationsImpl implements SupportedOperatingSystemsOperations { + @JsonIgnore private 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 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; + } + } + + 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 SupportedOperatingSystemsImpl(inner.getValue(), 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 0000000000000..13558b689a1cb --- /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 0000000000000..be1793df2572d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesClientImpl.java @@ -0,0 +1,446 @@ +// Copyright (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.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.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 { + private final ClientLogger logger = new ClientLogger(TargetComputeSizesClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @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 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. + */ + @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 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. + */ + @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 0000000000000..667f754d98728 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/TargetComputeSizesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TargetComputeSizesImpl implements TargetComputeSizes { + @JsonIgnore private 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 0000000000000..084ab42c7d5d4 --- /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 0000000000000..ff87ea5a9b36a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VCenterImpl.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.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 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 0000000000000..750d20d9e60e1 --- /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 0000000000000..d6f63c62349bd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/implementation/VaultSettingImpl.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.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() + .createWithResponse(resourceName, resourceGroupName, vaultSettingName, createInput, Context.NONE) + .getValue(); + return this; + } + + public VaultSetting create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationVaultSettings() + .createWithResponse(resourceName, resourceGroupName, vaultSettingName, createInput, context) + .getValue(); + 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 0000000000000..a4cea854e6d71 --- /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 0000000000000..8bfb9b340263c --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AAddDisksInput.class); + + /* + * 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; + + /** + * 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 0000000000000..2c644b222b025 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AApplyRecoveryPointInput.class); + + /** + * 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 0000000000000..b06822ac04cf5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AContainerCreationInput.class); + + /** + * 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 0000000000000..c28552a1bcf20 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AContainerMappingInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AContainerMappingInput.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..d5af11a8c85e5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ACreateProtectionIntentInput.java @@ -0,0 +1,597 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2ACreateProtectionIntentInput.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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(); + } + } +} 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 0000000000000..1df105bc5ea50 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEnableProtectionInput.java @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AEnableProtectionInput.class); + + /* + * 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; + + /* + * 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 boot diagnostic storage account. + */ + @JsonProperty(value = "recoveryBootDiagStorageAccountId") + private String recoveryBootDiagStorageAccountId; + + /* + * The recovery disk encryption information. + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /* + * The recovery availability zone. + */ + @JsonProperty(value = "recoveryAvailabilityZone") + private String recoveryAvailabilityZone; + + /* + * The recovery Azure virtual network ARM id. + */ + @JsonProperty(value = "recoveryAzureNetworkId") + private String recoveryAzureNetworkId; + + /* + * The recovery subnet name. + */ + @JsonProperty(value = "recoverySubnetName") + private String recoverySubnetName; + + /** + * 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 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. + * + * @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 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 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; + } + + /** + * 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/A2AEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AEventDetails.java new file mode 100644 index 0000000000000..ffca0ae4e8b02 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AEventDetails.class); + + /* + * 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; + + /** + * 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/A2AFailoverProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AFailoverProviderInput.java new file mode 100644 index 0000000000000..e1b67ecb0a4e0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AFailoverProviderInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** A2A provider specific input for failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("A2A") +@Fluent +public final class A2AFailoverProviderInput extends ProviderSpecificFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AFailoverProviderInput.class); + + /* + * 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 TFO or not. + */ + @JsonProperty(value = "cloudServiceCreationOption") + private String cloudServiceCreationOption; + + /** + * 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 A2AFailoverProviderInput object itself. + */ + public A2AFailoverProviderInput 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 A2AFailoverProviderInput object itself. + */ + public A2AFailoverProviderInput 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/A2APolicyCreationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyCreationInput.java new file mode 100644 index 0000000000000..1db56f5cec2ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyCreationInput.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2APolicyCreationInput.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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 0000000000000..24aca78f89520 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2APolicyDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2APolicyDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..16b025dee4bfc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedDiskDetails.java @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A2A protected disk details. */ +@Fluent +public final class A2AProtectedDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AProtectedDiskDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..527eb740ab7f1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectedManagedDiskDetails.java @@ -0,0 +1,717 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A2A protected managed disk details. */ +@Fluent +public final class A2AProtectedManagedDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AProtectedManagedDiskDetails.class); + + /* + * 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; + + /* + * 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 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; + + /** + * 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 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 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 0000000000000..ef1546c59d794 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionContainerMappingDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AProtectionContainerMappingDetails.class); + + /* + * 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; + + /* + * The schedule arm name. + */ + @JsonProperty(value = "scheduleName") + private String scheduleName; + + /* + * The job schedule arm name. + */ + @JsonProperty(value = "jobScheduleName") + private String jobScheduleName; + + /** + * 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 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 0000000000000..6d1ace4b67c50 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentDiskInputDetails.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM disk input details. */ +@Fluent +public final class A2AProtectionIntentDiskInputDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AProtectionIntentDiskInputDetails.class); + + /* + * 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; + + /** + * 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(); + } + } +} 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 0000000000000..6162b4c93c353 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AProtectionIntentManagedDiskInputDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM managed disk input details. */ +@Fluent +public final class A2AProtectionIntentManagedDiskInputDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AProtectionIntentManagedDiskInputDetails.class); + + /* + * 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; + + /** + * 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(); + } + } +} 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 0000000000000..8cca595318530 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARecoveryAvailabilityType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for A2ARecoveryAvailabilityType. */ +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); + } + + /** @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 0000000000000..20d9230097349 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2ARecoveryPointDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..d56a92a81356e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2ARemoveDisksInput.class); + + /* + * 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; + + /** + * 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 0000000000000..b0cfe3bf59192 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationDetails.java @@ -0,0 +1,1079 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AReplicationDetails.class); + + /* + * The fabric specific object Id of the virtual machine. + */ + @JsonProperty(value = "fabricObjectId") + private String fabricObjectId; + + /* + * The initial primary fabric location. + */ + @JsonProperty(value = "initialPrimaryFabricLocation", access = JsonProperty.Access.WRITE_ONLY) + private String initialPrimaryFabricLocation; + + /* + * The initial recovery fabric location. + */ + @JsonProperty(value = "initialRecoveryFabricLocation", access = JsonProperty.Access.WRITE_ONLY) + private String initialRecoveryFabricLocation; + + /* + * The initial primary availability zone. + */ + @JsonProperty(value = "initialPrimaryZone", access = JsonProperty.Access.WRITE_ONLY) + private String initialPrimaryZone; + + /* + * The initial recovery availability zone. + */ + @JsonProperty(value = "initialRecoveryZone", access = JsonProperty.Access.WRITE_ONLY) + private String initialRecoveryZone; + + /* + * 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; + + /* + * A value indicating whether replication agent update is required. + */ + @JsonProperty(value = "isReplicationAgentUpdateRequired") + private Boolean isReplicationAgentUpdateRequired; + + /* + * 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 recovery availability zone. + */ + @JsonProperty(value = "recoveryAvailabilityZone") + private String recoveryAvailabilityZone; + + /* + * 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 proximity placement group Id. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /** + * 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 initialPrimaryFabricLocation property: The initial primary fabric location. + * + * @return the initialPrimaryFabricLocation value. + */ + public String initialPrimaryFabricLocation() { + return this.initialPrimaryFabricLocation; + } + + /** + * Get the initialRecoveryFabricLocation property: The initial recovery fabric location. + * + * @return the initialRecoveryFabricLocation value. + */ + public String initialRecoveryFabricLocation() { + return this.initialRecoveryFabricLocation; + } + + /** + * Get the initialPrimaryZone property: The initial primary availability zone. + * + * @return the initialPrimaryZone value. + */ + public String initialPrimaryZone() { + return this.initialPrimaryZone; + } + + /** + * Get the initialRecoveryZone property: The initial recovery availability zone. + * + * @return the initialRecoveryZone value. + */ + public String initialRecoveryZone() { + return this.initialRecoveryZone; + } + + /** + * 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 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 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 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 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 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; + } + + /** + * 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 (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(); + } + } +} 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 0000000000000..171d4421da9c9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReplicationIntentDetails.java @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AReplicationIntentDetails.class); + + /* + * The fabric specific object Id of the virtual machine. + */ + @JsonProperty(value = "fabricObjectId") + private String fabricObjectId; + + /* + * The ID of Policy governing this PE. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * 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 recovery fabric Name. + */ + @JsonProperty(value = "primaryFabricFriendlyName") + private String primaryFabricFriendlyName; + + /* + * The recovery fabric Name. + */ + @JsonProperty(value = "recoveryFabricFriendlyName") + private String recoveryFabricFriendlyName; + + /* + * The primary container Name. + */ + @JsonProperty(value = "primaryContainerFriendlyName") + private String primaryContainerFriendlyName; + + /* + * The recovery container Name. + */ + @JsonProperty(value = "recoveryContainerFriendlyName") + private String recoveryContainerFriendlyName; + + /* + * The recovery availability type of the virtual machine. + */ + @JsonProperty(value = "recoveryAvailabilityType") + private String recoveryAvailabilityType; + + /* + * 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 recovery availability set Id. + */ + @JsonProperty(value = "recoveryAvailabilitySetId") + private String recoveryAvailabilitySetId; + + /* + * The recovery virtual network Id. + */ + @JsonProperty(value = "recoveryVirtualNetworkId") + private String recoveryVirtualNetworkId; + + /* + * The recovery proximity placement group custom details. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /* + * A value indicating whether the auto protection is enabled. + */ + @JsonProperty(value = "autoProtectionOfDataDiskStatus") + private AutoProtectionOfDataDiskStatus autoProtectionOfDataDiskStatus; + + /* + * 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; + + /** + * 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 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 A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withPolicyId(String policyId) { + this.policyId = policyId; + 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 primaryFabricFriendlyName property: The recovery fabric Name. + * + * @return the primaryFabricFriendlyName value. + */ + public String primaryFabricFriendlyName() { + return this.primaryFabricFriendlyName; + } + + /** + * Set the primaryFabricFriendlyName property: The recovery fabric Name. + * + * @param primaryFabricFriendlyName the primaryFabricFriendlyName value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withPrimaryFabricFriendlyName(String primaryFabricFriendlyName) { + this.primaryFabricFriendlyName = primaryFabricFriendlyName; + return this; + } + + /** + * Get the recoveryFabricFriendlyName property: The recovery fabric Name. + * + * @return the recoveryFabricFriendlyName value. + */ + public String recoveryFabricFriendlyName() { + return this.recoveryFabricFriendlyName; + } + + /** + * Set the recoveryFabricFriendlyName property: The recovery fabric Name. + * + * @param recoveryFabricFriendlyName the recoveryFabricFriendlyName value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryFabricFriendlyName(String recoveryFabricFriendlyName) { + this.recoveryFabricFriendlyName = recoveryFabricFriendlyName; + return this; + } + + /** + * Get the primaryContainerFriendlyName property: The primary container Name. + * + * @return the primaryContainerFriendlyName value. + */ + public String primaryContainerFriendlyName() { + return this.primaryContainerFriendlyName; + } + + /** + * Set the primaryContainerFriendlyName property: The primary container Name. + * + * @param primaryContainerFriendlyName the primaryContainerFriendlyName value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withPrimaryContainerFriendlyName(String primaryContainerFriendlyName) { + this.primaryContainerFriendlyName = primaryContainerFriendlyName; + return this; + } + + /** + * Get the recoveryContainerFriendlyName property: The recovery container Name. + * + * @return the recoveryContainerFriendlyName value. + */ + public String recoveryContainerFriendlyName() { + return this.recoveryContainerFriendlyName; + } + + /** + * Set the recoveryContainerFriendlyName property: The recovery container Name. + * + * @param recoveryContainerFriendlyName the recoveryContainerFriendlyName value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryContainerFriendlyName(String recoveryContainerFriendlyName) { + this.recoveryContainerFriendlyName = recoveryContainerFriendlyName; + 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 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 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 A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryAvailabilitySetId(String recoveryAvailabilitySetId) { + this.recoveryAvailabilitySetId = recoveryAvailabilitySetId; + return this; + } + + /** + * Get the recoveryVirtualNetworkId property: The recovery virtual network Id. + * + * @return the recoveryVirtualNetworkId value. + */ + public String recoveryVirtualNetworkId() { + return this.recoveryVirtualNetworkId; + } + + /** + * Set the recoveryVirtualNetworkId property: The recovery virtual network Id. + * + * @param recoveryVirtualNetworkId the recoveryVirtualNetworkId value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryVirtualNetworkId(String recoveryVirtualNetworkId) { + this.recoveryVirtualNetworkId = recoveryVirtualNetworkId; + return this; + } + + /** + * Get the recoveryProximityPlacementGroupId property: The recovery proximity placement group custom details. + * + * @return the recoveryProximityPlacementGroupId value. + */ + public String recoveryProximityPlacementGroupId() { + return this.recoveryProximityPlacementGroupId; + } + + /** + * Set the recoveryProximityPlacementGroupId property: The recovery proximity placement group custom details. + * + * @param recoveryProximityPlacementGroupId the recoveryProximityPlacementGroupId value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withRecoveryProximityPlacementGroupId(String recoveryProximityPlacementGroupId) { + this.recoveryProximityPlacementGroupId = recoveryProximityPlacementGroupId; + return this; + } + + /** + * Get the autoProtectionOfDataDiskStatus property: A value indicating whether the auto protection is enabled. + * + * @return the autoProtectionOfDataDiskStatus value. + */ + public AutoProtectionOfDataDiskStatus autoProtectionOfDataDiskStatus() { + return this.autoProtectionOfDataDiskStatus; + } + + /** + * Set the autoProtectionOfDataDiskStatus property: A value indicating whether the auto protection is enabled. + * + * @param autoProtectionOfDataDiskStatus the autoProtectionOfDataDiskStatus value to set. + * @return the A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails withAutoProtectionOfDataDiskStatus( + AutoProtectionOfDataDiskStatus autoProtectionOfDataDiskStatus) { + this.autoProtectionOfDataDiskStatus = autoProtectionOfDataDiskStatus; + 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 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 A2AReplicationIntentDetails object itself. + */ + public A2AReplicationIntentDetails 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 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; + } + + /** + * 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/A2AReprotectInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AReprotectInput.java new file mode 100644 index 0000000000000..576d18f1dd697 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AReprotectInput.class); + + /* + * 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; + + /** + * 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 0000000000000..6d74d0da313ee --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ARpRecoveryPointType.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; + +/** Defines values for A2ARpRecoveryPointType. */ +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); + } + + /** @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 0000000000000..c1f77909e430a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2ASwitchProtectionInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2ASwitchProtectionInput.class); + + /* + * 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 recovery proximity placement group Id. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /* + * The Policy Id. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * The boot diagnostic storage account. + */ + @JsonProperty(value = "recoveryBootDiagStorageAccountId") + private String recoveryBootDiagStorageAccountId; + + /* + * The recovery disk encryption information. + */ + @JsonProperty(value = "diskEncryptionInfo") + private DiskEncryptionInfo diskEncryptionInfo; + + /** + * 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 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 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 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 0000000000000..60ebb16744414 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2ATestFailoverInput.class); + + /* + * 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; + + /** + * 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 0000000000000..ef2d5e334f198 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnplannedFailoverInput.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AUnplannedFailoverInput.class); + + /* + * 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; + + /** + * 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 0000000000000..1fde9a60995fa --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUnprotectedDiskDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A2A unprotected disk details. */ +@Fluent +public final class A2AUnprotectedDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AUnprotectedDiskDetails.class); + + /* + * The source lun Id for the data disk. + */ + @JsonProperty(value = "diskLunId") + private Integer diskLunId; + + /** + * 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; + } + + /** + * 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 0000000000000..7632a7fa45ea8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateContainerMappingInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AUpdateContainerMappingInput.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..f6e36e78bd987 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AUpdateReplicationProtectedItemInput.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AUpdateReplicationProtectedItemInput.class); + + /* + * 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 recovery proximity placement group Id. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /* + * The user given name for test failover VM. + */ + @JsonProperty(value = "tfoAzureVMName") + private String tfoAzureVMName; + + /** + * 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 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 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; + } + + /** + * 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/A2AVmDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmDiskDetails.java new file mode 100644 index 0000000000000..52f4616052df2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmDiskDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM disk details. */ +@Fluent +public final class A2AVmDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AVmDiskDetails.class); + + /* + * The disk Uri. + */ + @JsonProperty(value = "diskUri") + private String diskUri; + + /* + * The recovery VHD storage account Id. + */ + @JsonProperty(value = "recoveryAzureStorageAccountId") + private String recoveryAzureStorageAccountId; + + /* + * The primary staging storage account Id. + */ + @JsonProperty(value = "primaryStagingAzureStorageAccountId") + private String primaryStagingAzureStorageAccountId; + + /** + * 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 A2AVmDiskDetails object itself. + */ + public A2AVmDiskDetails 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 A2AVmDiskDetails object itself. + */ + public A2AVmDiskDetails 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 A2AVmDiskDetails object itself. + */ + public A2AVmDiskDetails withPrimaryStagingAzureStorageAccountId(String primaryStagingAzureStorageAccountId) { + this.primaryStagingAzureStorageAccountId = primaryStagingAzureStorageAccountId; + 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/A2AVmDiskInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmDiskInputDetails.java new file mode 100644 index 0000000000000..5e5ba4000eaca --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmDiskInputDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM disk input details. */ +@Fluent +public final class A2AVmDiskInputDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AVmDiskInputDetails.class); + + /* + * The disk Uri. + */ + @JsonProperty(value = "diskUri") + private String diskUri; + + /* + * The recovery VHD storage account Id. + */ + @JsonProperty(value = "recoveryAzureStorageAccountId") + private String recoveryAzureStorageAccountId; + + /* + * The primary staging storage account Id. + */ + @JsonProperty(value = "primaryStagingAzureStorageAccountId") + private String primaryStagingAzureStorageAccountId; + + /** + * 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() { + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskDetails.java new file mode 100644 index 0000000000000..943c34b2bb835 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskDetails.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM managed disk input details. */ +@Fluent +public final class A2AVmManagedDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AVmManagedDiskDetails.class); + + /* + * The disk Id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The primary staging storage account Arm Id. + */ + @JsonProperty(value = "primaryStagingAzureStorageAccountId") + private String primaryStagingAzureStorageAccountId; + + /* + * The target resource group Arm Id. + */ + @JsonProperty(value = "recoveryResourceGroupId") + private String recoveryResourceGroupId; + + /* + * The replica disk type. + */ + @JsonProperty(value = "recoveryReplicaDiskAccountType") + private String recoveryReplicaDiskAccountType; + + /* + * The target disk type after failover. + */ + @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; + + /** + * 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 A2AVmManagedDiskDetails object itself. + */ + public A2AVmManagedDiskDetails 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 A2AVmManagedDiskDetails object itself. + */ + public A2AVmManagedDiskDetails 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 A2AVmManagedDiskDetails object itself. + */ + public A2AVmManagedDiskDetails withRecoveryResourceGroupId(String recoveryResourceGroupId) { + this.recoveryResourceGroupId = recoveryResourceGroupId; + return this; + } + + /** + * Get the recoveryReplicaDiskAccountType property: The replica disk type. + * + * @return the recoveryReplicaDiskAccountType value. + */ + public String recoveryReplicaDiskAccountType() { + return this.recoveryReplicaDiskAccountType; + } + + /** + * Set the recoveryReplicaDiskAccountType property: The replica disk type. + * + * @param recoveryReplicaDiskAccountType the recoveryReplicaDiskAccountType value to set. + * @return the A2AVmManagedDiskDetails object itself. + */ + public A2AVmManagedDiskDetails withRecoveryReplicaDiskAccountType(String recoveryReplicaDiskAccountType) { + this.recoveryReplicaDiskAccountType = recoveryReplicaDiskAccountType; + return this; + } + + /** + * Get the recoveryTargetDiskAccountType property: The target disk type after failover. + * + * @return the recoveryTargetDiskAccountType value. + */ + public String recoveryTargetDiskAccountType() { + return this.recoveryTargetDiskAccountType; + } + + /** + * Set the recoveryTargetDiskAccountType property: The target disk type after failover. + * + * @param recoveryTargetDiskAccountType the recoveryTargetDiskAccountType value to set. + * @return the A2AVmManagedDiskDetails object itself. + */ + public A2AVmManagedDiskDetails 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 A2AVmManagedDiskDetails object itself. + */ + public A2AVmManagedDiskDetails 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 A2AVmManagedDiskDetails object itself. + */ + public A2AVmManagedDiskDetails withDiskEncryptionInfo(DiskEncryptionInfo diskEncryptionInfo) { + this.diskEncryptionInfo = diskEncryptionInfo; + 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/A2AVmManagedDiskInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskInputDetails.java new file mode 100644 index 0000000000000..5474dd1e8630c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/A2AVmManagedDiskInputDetails.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM managed disk input details. */ +@Fluent +public final class A2AVmManagedDiskInputDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AVmManagedDiskInputDetails.class); + + /* + * The disk Id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The primary staging storage account Arm Id. + */ + @JsonProperty(value = "primaryStagingAzureStorageAccountId") + private String primaryStagingAzureStorageAccountId; + + /* + * The target resource group Arm Id. + */ + @JsonProperty(value = "recoveryResourceGroupId") + 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; + + /** + * 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 (diskEncryptionInfo() != null) { + diskEncryptionInfo().validate(); + } + } +} 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 0000000000000..d1e38824a8739 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM managed disk update input details. */ +@Fluent +public final class A2AVmManagedDiskUpdateDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(A2AVmManagedDiskUpdateDetails.class); + + /* + * 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 disk encryption information (for one / single pass flows). + */ + @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; + + /** + * 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 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 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/AddDisksInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInput.java new file mode 100644 index 0000000000000..6bc1ce85df18f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for add disk(s) operation. */ +@Fluent +public final class AddDisksInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddDisksInput.class); + + /* + * Add disks input properties. + */ + @JsonProperty(value = "properties") + private AddDisksInputProperties properties; + + /** + * 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 0000000000000..5351990451a96 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddDisksInputProperties.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Add Disks input properties. */ +@Fluent +public final class AddDisksInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddDisksInputProperties.class); + + /* + * 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 AddDisksProviderSpecificInput providerSpecificDetails; + + /** + * 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) { + providerSpecificDetails().validate(); + } + } +} 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 0000000000000..3bc7b6d1a528b --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddDisksProviderSpecificInput.class); + + /** + * 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 0000000000000..8734cecd106dd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input required to add a provider. */ +@Fluent +public final class AddRecoveryServicesProviderInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddRecoveryServicesProviderInput.class); + + /* + * The properties of an add provider request. + */ + @JsonProperty(value = "properties", required = true) + private AddRecoveryServicesProviderInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..142a46926f498 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AddRecoveryServicesProviderInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an add provider request. */ +@Fluent +public final class AddRecoveryServicesProviderInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddRecoveryServicesProviderInputProperties.class); + + /* + * 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 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; + + /** + * 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 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(); + } + } +} 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 0000000000000..4b152858161e7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input required to add vCenter. */ +@Fluent +public final class AddVCenterRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddVCenterRequest.class); + + /* + * The properties of an add vCenter request. + */ + @JsonProperty(value = "properties") + private AddVCenterRequestProperties properties; + + /** + * 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 0000000000000..60a0d8960e6da --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an add vCenter request. */ +@Fluent +public final class AddVCenterRequestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddVCenterRequestProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..5906f57b2f732 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentAutoUpdateStatus.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AgentAutoUpdateStatus. */ +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); + } + + /** @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 0000000000000..d0185dee0c611 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Agent details. */ +@Immutable +public final class AgentDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentDetails.class); + + /* + * 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 details of agent disks. + */ + @JsonProperty(value = "disks", access = JsonProperty.Access.WRITE_ONLY) + private List disks; + + /** + * 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 details of agent 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 0000000000000..8c506a0e9a845 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Agent disk details. */ +@Immutable +public final class AgentDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentDiskDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..c36a1c967c236 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentUpgradeBlockedReason.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.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); + } + + /** @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 0000000000000..d36cc07faa520 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AgentVersionStatus.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; + +/** Defines values for AgentVersionStatus. */ +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); + } + + /** @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 0000000000000..b6ea7c18b5295 --- /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 0000000000000..35e454f9bf2f4 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.AlertInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of alerts. */ +@Fluent +public final class AlertCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertCollection.class); + + /* + * The list of alerts. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..94e1db4d7e7ab --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of an alert. */ +@Fluent +public final class AlertProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..4395920e8cf75 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AlternateLocationRecoveryOption.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AlternateLocationRecoveryOption. */ +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); + } + + /** @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/ApplyRecoveryPointInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInput.java new file mode 100644 index 0000000000000..a2b54b0fa4577 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input to apply recovery point. */ +@Fluent +public final class ApplyRecoveryPointInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplyRecoveryPointInput.class); + + /* + * The input properties to apply recovery point. + */ + @JsonProperty(value = "properties") + private ApplyRecoveryPointInputProperties properties; + + /** + * 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) { + properties().validate(); + } + } +} 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 0000000000000..7ced6fb884932 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input properties to apply recovery point. */ +@Fluent +public final class ApplyRecoveryPointInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplyRecoveryPointInputProperties.class); + + /* + * The recovery point Id. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /* + * Provider specific input for applying recovery point. + */ + @JsonProperty(value = "providerSpecificDetails") + private ApplyRecoveryPointProviderSpecificInput providerSpecificDetails; + + /** + * 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) { + providerSpecificDetails().validate(); + } + } +} 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 0000000000000..1e5b45fda7959 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ApplyRecoveryPointProviderSpecificInput.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = "HyperVReplicaAzure", value = HyperVReplicaAzureApplyRecoveryPointInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2ApplyRecoveryPointInput.class), + @JsonSubTypes.Type(name = "InMageRcm", value = InMageRcmApplyRecoveryPointInput.class) +}) +@Immutable +public class ApplyRecoveryPointProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplyRecoveryPointProviderSpecificInput.class); + + /** + * 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 0000000000000..277c53b384719 --- /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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@Immutable +public final class AsrJobDetails extends JobDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AsrJobDetails.class); + + /** {@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 0000000000000..70578a05cb51b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AsrTask.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Task of the Job. */ +@Fluent +public final class AsrTask { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AsrTask.class); + + /* + * 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; + + /** + * 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 0000000000000..9a8e4c1940553 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutoProtectionOfDataDisk.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AutoProtectionOfDataDisk. */ +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); + } + + /** @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/AutoProtectionOfDataDiskStatus.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutoProtectionOfDataDiskStatus.java new file mode 100644 index 0000000000000..3508979a7115e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AutoProtectionOfDataDiskStatus.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AutoProtectionOfDataDiskStatus. */ +public final class AutoProtectionOfDataDiskStatus extends ExpandableStringEnum { + /** Static value Disabled for AutoProtectionOfDataDiskStatus. */ + public static final AutoProtectionOfDataDiskStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for AutoProtectionOfDataDiskStatus. */ + public static final AutoProtectionOfDataDiskStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a AutoProtectionOfDataDiskStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoProtectionOfDataDiskStatus. + */ + @JsonCreator + public static AutoProtectionOfDataDiskStatus fromString(String name) { + return fromString(name, AutoProtectionOfDataDiskStatus.class); + } + + /** @return known AutoProtectionOfDataDiskStatus values. */ + public static Collection values() { + return values(AutoProtectionOfDataDiskStatus.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 0000000000000..1aa90485aea27 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomationRunbookTaskDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..1f7bfbe4b5ca3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFabricCreationInput.class); + + /* + * The Location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 0000000000000..b8407e378ec96 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureFabricSpecificDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFabricSpecificDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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/AzureToAzureCreateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureCreateNetworkMappingInput.java new file mode 100644 index 0000000000000..82b83873c82a8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureCreateNetworkMappingInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureToAzureCreateNetworkMappingInput.class); + + /* + * The primary azure vnet Id. + */ + @JsonProperty(value = "primaryNetworkId") + private String primaryNetworkId; + + /** + * 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(); + } +} 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 0000000000000..4cc93b3ef6a96 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureToAzureNetworkMappingSettings.class); + + /* + * The primary fabric location. + */ + @JsonProperty(value = "primaryFabricLocation") + private String primaryFabricLocation; + + /* + * The recovery fabric location. + */ + @JsonProperty(value = "recoveryFabricLocation") + private String recoveryFabricLocation; + + /** + * 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 0000000000000..a821d658d69b9 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureToAzureUpdateNetworkMappingInput.class); + + /* + * The primary azure vnet Id. + */ + @JsonProperty(value = "primaryNetworkId") + private String primaryNetworkId; + + /** + * 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 0000000000000..a4e9ab3923990 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureToAzureVmSyncedConfigDetails.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureToAzureVmSyncedConfigDetails.class); + + /* + * The Azure VM tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The Azure VM input endpoints. + */ + @JsonProperty(value = "inputEndpoints") + private List inputEndpoints; + + /** + * 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 0000000000000..4f65b4532d9d5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/AzureVmDiskDetails.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk details for E2A provider. */ +@Fluent +public final class AzureVmDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmDiskDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..9db2bc0e3d1b5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputeSizeErrorDetails.class); + + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The severity of the error. + */ + @JsonProperty(value = "severity") + private String severity; + + /** + * 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 0000000000000..34b0aa14997c6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ConfigurationSettings.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = "VmmVirtualMachine", value = VmmVirtualMachineDetails.class), + @JsonSubTypes.Type(name = "VMwareVirtualMachine", value = VMwareVirtualMachineDetails.class) +}) +@Immutable +public class ConfigurationSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationSettings.class); + + /** + * 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 0000000000000..9d526b18ebcdd --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to configure alerts for the system. */ +@Fluent +public final class ConfigureAlertRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigureAlertRequest.class); + + /* + * The properties of a configure alert request. + */ + @JsonProperty(value = "properties") + private ConfigureAlertRequestProperties properties; + + /** + * 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 0000000000000..556f5a34d0c35 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a configure alert request. */ +@Fluent +public final class ConfigureAlertRequestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigureAlertRequestProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..2657d8f52e0e6 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsistencyCheckTaskDetails.class); + + /* + * The list of inconsistent Vm details. + */ + @JsonProperty(value = "vmDetails") + private List vmDetails; + + /** + * 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 0000000000000..33e94ce47a243 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create network mappings input. */ +@Fluent +public final class CreateNetworkMappingInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateNetworkMappingInput.class); + + /* + * Input properties for creating network mapping. + */ + @JsonProperty(value = "properties") + private CreateNetworkMappingInputProperties properties; + + /** + * 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) { + properties().validate(); + } + } +} 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 0000000000000..248782b67f532 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateNetworkMappingInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common input details for network mapping operation. */ +@Fluent +public final class CreateNetworkMappingInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateNetworkMappingInputProperties.class); + + /* + * Recovery fabric Name. + */ + @JsonProperty(value = "recoveryFabricName") + private String recoveryFabricName; + + /* + * Recovery network Id. + */ + @JsonProperty(value = "recoveryNetworkId") + private String recoveryNetworkId; + + /* + * Fabric specific input properties. + */ + @JsonProperty(value = "fabricSpecificDetails") + private FabricSpecificCreateNetworkMappingInput fabricSpecificDetails; + + /** + * 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 (fabricSpecificDetails() != null) { + fabricSpecificDetails().validate(); + } + } +} 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 0000000000000..519d763cee9de --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection Policy input. */ +@Fluent +public final class CreatePolicyInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreatePolicyInput.class); + + /* + * Policy creation properties. + */ + @JsonProperty(value = "properties") + private CreatePolicyInputProperties properties; + + /** + * 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 0000000000000..3e1b946466a0e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Policy creation properties. */ +@Fluent +public final class CreatePolicyInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreatePolicyInputProperties.class); + + /* + * The ReplicationProviderSettings. + */ + @JsonProperty(value = "providerSpecificInput") + private PolicyProviderSpecificInput providerSpecificInput; + + /** + * 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 0000000000000..d6bf43aa564d5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create protection container input. */ +@Fluent +public final class CreateProtectionContainerInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateProtectionContainerInput.class); + + /* + * Create protection container input properties. + */ + @JsonProperty(value = "properties") + private CreateProtectionContainerInputProperties properties; + + /** + * 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 0000000000000..760770245a927 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Create protection container input properties. */ +@Fluent +public final class CreateProtectionContainerInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateProtectionContainerInputProperties.class); + + /* + * Provider specific inputs for container creation. + */ + @JsonProperty(value = "providerSpecificInput") + private List providerSpecificInput; + + /** + * 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 0000000000000..e3d1bcdc14271 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configure pairing input. */ +@Fluent +public final class CreateProtectionContainerMappingInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateProtectionContainerMappingInput.class); + + /* + * Configure protection input properties. + */ + @JsonProperty(value = "properties") + private CreateProtectionContainerMappingInputProperties properties; + + /** + * 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 0000000000000..c019be45ce3da --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionContainerMappingInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configure pairing input properties. */ +@Fluent +public final class CreateProtectionContainerMappingInputProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(CreateProtectionContainerMappingInputProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..e1bf1ffa37288 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create protection intent input. */ +@Fluent +public final class CreateProtectionIntentInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateProtectionIntentInput.class); + + /* + * Create protection intent input properties. + */ + @JsonProperty(value = "properties") + private CreateProtectionIntentProperties properties; + + /** + * 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 0000000000000..c7f601cd0ecdb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create protection intent input properties. */ +@Fluent +public final class CreateProtectionIntentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateProtectionIntentProperties.class); + + /* + * The ReplicationProviderInput. For A2A provider, it will be + * A2ACreateProtectionIntentInput object. For other providers, it can be + * null. + */ + @JsonProperty(value = "providerSpecificDetails") + private CreateProtectionIntentProviderSpecificDetails providerSpecificDetails; + + /** + * Get the providerSpecificDetails property: The ReplicationProviderInput. For A2A provider, it will be + * A2ACreateProtectionIntentInput object. For other providers, it can be null. + * + * @return the providerSpecificDetails value. + */ + public CreateProtectionIntentProviderSpecificDetails providerSpecificDetails() { + return this.providerSpecificDetails; + } + + /** + * Set the providerSpecificDetails property: The ReplicationProviderInput. For A2A provider, it will be + * A2ACreateProtectionIntentInput object. For other providers, it can be null. + * + * @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 0000000000000..c78547ab7c6a8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateProtectionIntentProviderSpecificDetails.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(CreateProtectionIntentProviderSpecificDetails.class); + + /** + * 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 0000000000000..ea48bc9d7d3dd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create recovery plan input class. */ +@Fluent +public final class CreateRecoveryPlanInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateRecoveryPlanInput.class); + + /* + * Recovery plan creation properties. + */ + @JsonProperty(value = "properties", required = true) + private CreateRecoveryPlanInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..d449da93088e3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CreateRecoveryPlanInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan creation properties. */ +@Fluent +public final class CreateRecoveryPlanInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateRecoveryPlanInputProperties.class); + + /* + * 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; + + /** + * 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()); + } + } +} 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 0000000000000..13f07d7242ff2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentJobDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Current job details of the migration item. */ +@Fluent +public final class CurrentJobDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CurrentJobDetails.class); + + /* + * The job name. + */ + @JsonProperty(value = "jobName") + private String jobName; + + /* + * The ARM Id of the job being executed. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /* + * The start time of the job. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /** + * 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 CurrentJobDetails object itself. + */ + public CurrentJobDetails withJobName(String jobName) { + this.jobName = jobName; + return this; + } + + /** + * Get the jobId property: The ARM Id of the job being executed. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: The ARM Id of the job being executed. + * + * @param jobId the jobId value to set. + * @return the CurrentJobDetails object itself. + */ + public CurrentJobDetails withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the startTime property: The start time of the job. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the job. + * + * @param startTime the startTime value to set. + * @return the CurrentJobDetails object itself. + */ + public CurrentJobDetails 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/CurrentScenarioDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/CurrentScenarioDetails.java new file mode 100644 index 0000000000000..984f1d96f471b --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Current scenario details of the protected entity. */ +@Fluent +public final class CurrentScenarioDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CurrentScenarioDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..59d62be998458 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The data store details of the MT. */ +@Fluent +public final class DataStore { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataStore.class); + + /* + * 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; + + /** + * 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 0000000000000..98a47090108e5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DataSyncStatus.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataSyncStatus. */ +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); + } + + /** @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 0000000000000..11d6f21188d98 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disable protection input. */ +@Fluent +public final class DisableProtectionInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DisableProtectionInput.class); + + /* + * Disable protection input properties. + */ + @JsonProperty(value = "properties") + private DisableProtectionInputProperties properties; + + /** + * 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) { + properties().validate(); + } + } +} 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 0000000000000..5246859bd3676 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionInputProperties.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disable protection input properties. */ +@Fluent +public final class DisableProtectionInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DisableProtectionInputProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..a4f306cfecd7f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DisableProtectionProviderSpecificInput.class); + + /** + * 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 0000000000000..abcc26efdf004 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DisableProtectionReason.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DisableProtectionReason. */ +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); + } + + /** @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 0000000000000..2b2f5129bad52 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to add a physical machine as a protectable item in a container. */ +@Fluent +public final class DiscoverProtectableItemRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiscoverProtectableItemRequest.class); + + /* + * The properties of a discover protectable item request. + */ + @JsonProperty(value = "properties") + private DiscoverProtectableItemRequestProperties properties; + + /** + * 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 0000000000000..4847460faf4fa --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Discover protectable item properties. */ +@Fluent +public final class DiscoverProtectableItemRequestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiscoverProtectableItemRequestProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..2e7a32dd1374e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskAccountType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskAccountType. */ +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); + } + + /** @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 0000000000000..cfccb49e5d1bf --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** On-prem disk details data. */ +@Fluent +public final class DiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..b7e0e8ad9287e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery disk encryption info (BEK and KEK). */ +@Fluent +public final class DiskEncryptionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionInfo.class); + + /* + * The recovery KeyVault reference for secret. + */ + @JsonProperty(value = "diskEncryptionKeyInfo") + private DiskEncryptionKeyInfo diskEncryptionKeyInfo; + + /* + * The recovery KeyVault reference for key. + */ + @JsonProperty(value = "keyEncryptionKeyInfo") + private KeyEncryptionKeyInfo keyEncryptionKeyInfo; + + /** + * 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 0000000000000..5f4516d881208 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). */ +@Fluent +public final class DiskEncryptionKeyInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionKeyInfo.class); + + /* + * The secret URL / identifier. + */ + @JsonProperty(value = "secretIdentifier") + private String secretIdentifier; + + /* + * The KeyVault resource ARM Id for secret. + */ + @JsonProperty(value = "keyVaultResourceArmId") + private String keyVaultResourceArmId; + + /** + * 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/DiskType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskType.java new file mode 100644 index 0000000000000..f66c832ee8103 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DiskType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskType. */ +public final class DiskType extends ExpandableStringEnum { + /** Static value Standard_LRS for DiskType. */ + public static final DiskType STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for DiskType. */ + public static final DiskType PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value StandardSSD_LRS for DiskType. */ + public static final DiskType STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** + * Creates or finds a DiskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskType. + */ + @JsonCreator + public static DiskType fromString(String name) { + return fromString(name, DiskType.class); + } + + /** @return known DiskType values. */ + public static Collection values() { + return values(DiskType.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 0000000000000..d7e84346335c6 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume details. */ +@Fluent +public final class DiskVolumeDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskVolumeDetails.class); + + /* + * The volume label. + */ + @JsonProperty(value = "label") + private String label; + + /* + * The volume name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * 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 0000000000000..62a37ace398d6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Display.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the localized display information for this particular operation / action. These value will be used by + * several clients for (1) custom role definitions for RBAC; (2) complex query filters for the event service; and (3) + * audit history / records for management operations. + */ +@Fluent +public final class Display { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Display.class); + + /* + * 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; + + /** + * 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 0000000000000..e9664c9d2b742 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/DraDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** DRA details. */ +@Immutable +public final class DraDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DraDetails.class); + + /* + * 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 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 of the DRA. + */ + @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; + + /** + * 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 version property: The DRA 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 of the DRA. + * + * @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/EnableMigrationInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInput.java new file mode 100644 index 0000000000000..8d05a53c28df4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enable migration input. */ +@Fluent +public final class EnableMigrationInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnableMigrationInput.class); + + /* + * Enable migration input properties. + */ + @JsonProperty(value = "properties", required = true) + private EnableMigrationInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..d6a0390f9b616 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableMigrationInputProperties.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enable migration input properties. */ +@Fluent +public final class EnableMigrationInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnableMigrationInputProperties.class); + + /* + * The policy Id. + */ + @JsonProperty(value = "policyId", required = true) + private String policyId; + + /* + * The provider specific details. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private EnableMigrationProviderSpecificInput providerSpecificDetails; + + /** + * 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(); + } + } +} 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 0000000000000..9a336804dbca3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnableMigrationProviderSpecificInput.class); + + /** + * 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 0000000000000..c6ce8edfed982 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enable protection input. */ +@Fluent +public final class EnableProtectionInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnableProtectionInput.class); + + /* + * Enable protection input properties. + */ + @JsonProperty(value = "properties") + private EnableProtectionInputProperties properties; + + /** + * 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 0000000000000..6fc82e86312de --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EnableProtectionInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enable protection input properties. */ +@Fluent +public final class EnableProtectionInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnableProtectionInputProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..f195fbbec7be9 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = "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), + @JsonSubTypes.Type(name = "San", value = SanEnableProtectionInput.class) +}) +@Immutable +public class EnableProtectionProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnableProtectionProviderSpecificInput.class); + + /** + * 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 0000000000000..9ff99de76239e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Encryption details for the fabric. */ +@Fluent +public final class EncryptionDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..f9ece28e661f4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EthernetAddressType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EthernetAddressType. */ +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); + } + + /** @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 0000000000000..d4b0f0e86cc2c --- /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 0000000000000..dbbe9bb410c2d --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.EventInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of fabric details. */ +@Fluent +public final class EventCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventCollection.class); + + /* + * The list of events. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..daabff03d8f92 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventProperties.class); + + /* + * 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 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; + + /** + * 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 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 0000000000000..3d15939f022da --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/EventProviderSpecificDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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) +}) +@Immutable +public class EventProviderSpecificDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventProviderSpecificDetails.class); + + /** + * 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 0000000000000..f32998f246eac --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventSpecificDetails.class); + + /** + * 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 0000000000000..4ba16f9bea0f6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingProtectionProfile.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExistingProtectionProfile.class); + + /* + * The protection profile Arm Id. Throw error, if resource does not exists. + */ + @JsonProperty(value = "protectionProfileId", required = true) + private String protectionProfileId; + + /** + * 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")); + } + } +} 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 0000000000000..45d4d36d05c9e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryAvailabilitySet.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExistingRecoveryAvailabilitySet.class); + + /* + * The recovery availability set Id. Will throw error, if resource does not + * exist. + */ + @JsonProperty(value = "recoveryAvailabilitySetId") + private String recoveryAvailabilitySetId; + + /** + * 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 0000000000000..e0b72339c1196 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryProximityPlacementGroup.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExistingRecoveryProximityPlacementGroup.class); + + /* + * The recovery proximity placement group Id. Will throw error, if resource + * does not exist. + */ + @JsonProperty(value = "recoveryProximityPlacementGroupId") + private String recoveryProximityPlacementGroupId; + + /** + * 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 0000000000000..56580c39b1400 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExistingRecoveryResourceGroup.class); + + /* + * The recovery resource group Id. Valid for V2 scenarios. + */ + @JsonProperty(value = "recoveryResourceGroupId") + private String recoveryResourceGroupId; + + /** + * 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 0000000000000..4fb25a6947e7b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingRecoveryVirtualNetwork.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExistingRecoveryVirtualNetwork.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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 0000000000000..40734fc27f168 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ExistingStorageAccount.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExistingStorageAccount.class); + + /* + * The storage account Arm Id. Throw error, if resource does not exists. + */ + @JsonProperty(value = "azureStorageAccountId", required = true) + private String azureStorageAccountId; + + /** + * 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")); + } + } +} 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 0000000000000..0e1474589d5d5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportJobDetails.class); + + /* + * BlobUri of the exported jobs. + */ + @JsonProperty(value = "blobUri") + private String blobUri; + + /* + * The sas token to access blob. + */ + @JsonProperty(value = "sasToken") + private String sasToken; + + /** + * 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/Fabric.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Fabric.java new file mode 100644 index 0000000000000..4ffe40e3c35ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Fabric.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights 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); + + /** + * 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(); + + /** + * 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); + + /** + * 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(); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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(); + + /** + * 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 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 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 0000000000000..b3f2992efdcc7 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.FabricInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of fabric details. */ +@Fluent +public final class FabricCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricCollection.class); + + /* + * The fabric details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..9886ada0e8ed7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Site details provided during the time of site creation. */ +@Fluent +public final class FabricCreationInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricCreationInput.class); + + /* + * Fabric creation input. + */ + @JsonProperty(value = "properties") + private FabricCreationInputProperties properties; + + /** + * 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 0000000000000..18abedc6b65a3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of site details provided during the time of site creation. */ +@Fluent +public final class FabricCreationInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricCreationInputProperties.class); + + /* + * Fabric provider specific creation input. + */ + @JsonProperty(value = "customDetails") + private FabricSpecificCreationInput customDetails; + + /** + * 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 0000000000000..b9a0b41f2d5ab --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Fabric properties. */ +@Fluent +public final class FabricProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..a009c8cd54f04 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricReplicationGroupTaskDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 TaskTypeDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricReplicationGroupTaskDetails.class); + + /* + * The skipped reason. + */ + @JsonProperty(value = "skippedReason") + private String skippedReason; + + /* + * The skipped reason string. + */ + @JsonProperty(value = "skippedReasonString") + private String skippedReasonString; + + /* + * The job entity. + */ + @JsonProperty(value = "jobTask") + private JobEntity jobTask; + + /** + * 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; + } + + /** + * 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 FabricReplicationGroupTaskDetails object itself. + */ + public FabricReplicationGroupTaskDetails 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/FabricSpecificCreateNetworkMappingInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FabricSpecificCreateNetworkMappingInput.java new file mode 100644 index 0000000000000..f3e2243463805 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricSpecificCreateNetworkMappingInput.class); + + /** + * 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 0000000000000..668c0b2d5eb28 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricSpecificCreationInput.class); + + /** + * 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 0000000000000..8a79a89fbfdc8 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricSpecificDetails.class); + + /** + * 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 0000000000000..5d02067591b28 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FabricSpecificUpdateNetworkMappingInput.class); + + /** + * 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 0000000000000..dda7b6d8519cb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/FailoverDeploymentModel.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FailoverDeploymentModel. */ +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); + } + + /** @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 0000000000000..ad03f9f3d8d6c --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FailoverJobDetails.class); + + /* + * The test VM details. + */ + @JsonProperty(value = "protectedItemDetails") + private List protectedItemDetails; + + /** + * 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 0000000000000..ac32a19b36e25 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to failover a process server. */ +@Fluent +public final class FailoverProcessServerRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FailoverProcessServerRequest.class); + + /* + * The properties of the PS Failover request. + */ + @JsonProperty(value = "properties") + private FailoverProcessServerRequestProperties properties; + + /** + * 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 0000000000000..2c58784fecf40 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of the Failover Process Server request. */ +@Fluent +public final class FailoverProcessServerRequestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FailoverProcessServerRequestProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..2fc622782e108 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Failover details for a replication protected item. */ +@Fluent +public final class FailoverReplicationProtectedItemDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FailoverReplicationProtectedItemDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..13ba709a247cd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/GroupTaskDetails.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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), + @JsonSubTypes.Type( + name = "RecoveryPlanShutdownGroupTaskDetails", + value = RecoveryPlanShutdownGroupTaskDetails.class) +}) +@Fluent +public class GroupTaskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupTaskDetails.class); + + /* + * The child tasks. + */ + @JsonProperty(value = "childTasks") + private List childTasks; + + /** + * 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 0000000000000..0fa14047105e4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthError.java @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Health Error. */ +@Fluent +public final class HealthError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HealthError.class); + + /* + * 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; + + /** + * 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 0000000000000..2d66d3f01fb12 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCategory.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HealthErrorCategory. */ +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 AgentAutoUpdate for HealthErrorCategory. */ + public static final HealthErrorCategory AGENT_AUTO_UPDATE = fromString("AgentAutoUpdate"); + + /** + * 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); + } + + /** @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 0000000000000..dadbe933295ec --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorCustomerResolvability.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HealthErrorCustomerResolvability. */ +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); + } + + /** @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 0000000000000..71b3e5febb7b2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HealthErrorSummary.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HealthErrorSummary.class); + + /* + * 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; + + /** + * 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/HyperVReplica2012EventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplica2012EventDetails.java new file mode 100644 index 0000000000000..0932b68980ac7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplica2012EventDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..fd568457cb85f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplica2012R2EventDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..a897d9f1299ec --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureApplyRecoveryPointInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureApplyRecoveryPointInput.class); + + /* + * The vault location where the recovery Vm resides. + */ + @JsonProperty(value = "vaultLocation") + private String vaultLocation; + + /* + * The primary kek certificate pfx. + */ + @JsonProperty(value = "primaryKekCertificatePfx") + private String primaryKekCertificatePfx; + + /* + * The secondary kek certificate pfx. + */ + @JsonProperty(value = "secondaryKekCertificatePfx") + private String secondaryKekCertificatePfx; + + /** + * Get the vaultLocation property: The vault location where the recovery Vm resides. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: The vault location where the recovery Vm resides. + * + * @param vaultLocation the vaultLocation value to set. + * @return the HyperVReplicaAzureApplyRecoveryPointInput object itself. + */ + public HyperVReplicaAzureApplyRecoveryPointInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + return this; + } + + /** + * 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/HyperVReplicaAzureEnableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEnableProtectionInput.java new file mode 100644 index 0000000000000..96afa08e5b80a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEnableProtectionInput.java @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Azure specific enable protection input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureEnableProtectionInput extends EnableProtectionProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureEnableProtectionInput.class); + + /* + * 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 = "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 zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The proximity placement group ARM Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The availability set ARM Id. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /** + * 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 name. + * + * @return the targetStorageAccountId value. + */ + public String targetStorageAccountId() { + return this.targetStorageAccountId; + } + + /** + * Set the targetStorageAccountId property: The storage account name. + * + * @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 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 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 targetAvailabilitySetId property: The availability set ARM Id. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The availability set ARM Id. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the HyperVReplicaAzureEnableProtectionInput object itself. + */ + public HyperVReplicaAzureEnableProtectionInput withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + 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; + } + + /** + * 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/HyperVReplicaAzureEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureEventDetails.java new file mode 100644 index 0000000000000..140def5f9d222 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureEventDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..90f8f5a81a54e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HvrA provider specific input for failback. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzureFailback") +@Fluent +public final class HyperVReplicaAzureFailbackProviderInput extends ProviderSpecificFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureFailbackProviderInput.class); + + /* + * 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; + + /** + * 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/HyperVReplicaAzureFailoverProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureFailoverProviderInput.java new file mode 100644 index 0000000000000..e748dc2b34b6c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureFailoverProviderInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HvrA provider specific input for failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureFailoverProviderInput extends ProviderSpecificFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureFailoverProviderInput.class); + + /* + * Location of the vault. + */ + @JsonProperty(value = "vaultLocation") + private String vaultLocation; + + /* + * 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; + + /** + * Get the vaultLocation property: Location of the vault. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: Location of the vault. + * + * @param vaultLocation the vaultLocation value to set. + * @return the HyperVReplicaAzureFailoverProviderInput object itself. + */ + public HyperVReplicaAzureFailoverProviderInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + return this; + } + + /** + * 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 HyperVReplicaAzureFailoverProviderInput object itself. + */ + public HyperVReplicaAzureFailoverProviderInput 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 HyperVReplicaAzureFailoverProviderInput object itself. + */ + public HyperVReplicaAzureFailoverProviderInput 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 HyperVReplicaAzureFailoverProviderInput object itself. + */ + public HyperVReplicaAzureFailoverProviderInput 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 0000000000000..fdd3fa35c0d4b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzurePolicyDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..de3380a6ddfb7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzurePolicyInput.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzurePolicyInput.class); + + /* + * 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; + + /** + * 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 0000000000000..05cbb8bf5a9bd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureReplicationDetails.java @@ -0,0 +1,734 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 Azure provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVReplicaAzure") +@Fluent +public final class HyperVReplicaAzureReplicationDetails extends ReplicationProviderSpecificSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureReplicationDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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(); + } + } +} 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 0000000000000..aec426a0b48a2 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureReprotectInput.class); + + /* + * 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; + + /** + * 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 0000000000000..0b9650782b567 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureRpRecoveryPointType.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; + +/** Defines values for HyperVReplicaAzureRpRecoveryPointType. */ +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); + } + + /** @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 0000000000000..34498e41434fd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureTestFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureTestFailoverInput.class); + + /* + * Location of the vault. + */ + @JsonProperty(value = "vaultLocation") + private String vaultLocation; + + /* + * 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; + + /** + * Get the vaultLocation property: Location of the vault. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: Location of the vault. + * + * @param vaultLocation the vaultLocation value to set. + * @return the HyperVReplicaAzureTestFailoverInput object itself. + */ + public HyperVReplicaAzureTestFailoverInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + return this; + } + + /** + * 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 0000000000000..bb093647c33bc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUnplannedFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureUnplannedFailoverInput.class); + + /* + * Location of the vault. + */ + @JsonProperty(value = "vaultLocation") + private String vaultLocation; + + /* + * 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; + + /** + * Get the vaultLocation property: Location of the vault. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: Location of the vault. + * + * @param vaultLocation the vaultLocation value to set. + * @return the HyperVReplicaAzureUnplannedFailoverInput object itself. + */ + public HyperVReplicaAzureUnplannedFailoverInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + return this; + } + + /** + * 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 0000000000000..ab5c38bc20cfd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaAzureUpdateReplicationProtectedItemInput.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(HyperVReplicaAzureUpdateReplicationProtectedItemInput.class); + + /* + * 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") + 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; + + /** + * 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; + } + + /** + * 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/HyperVReplicaBaseEventDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBaseEventDetails.java new file mode 100644 index 0000000000000..239f890f5b327 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaBaseEventDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..15ed7636c9d55 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBasePolicyDetails.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaBasePolicyDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..1a415f215e2cb --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaBaseReplicationDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..245d60a88fbe9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaBluePolicyDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..d4a10e4088672 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBluePolicyInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 PolicyProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaBluePolicyInput.class); + + /* + * 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. + */ + @JsonProperty(value = "replicaDeletion") + private String replicaDeletion; + + /** + * 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; + } + + /** + * 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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 HyperVReplicaBluePolicyInput object itself. + */ + public HyperVReplicaBluePolicyInput 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/HyperVReplicaBlueReplicationDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaBlueReplicationDetails.java new file mode 100644 index 0000000000000..e1d594a30eca7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaBlueReplicationDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..cabbe0387168f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyDetails.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaPolicyDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..633355289372d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVReplicaPolicyInput.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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") +@JsonTypeName("HyperVReplica2012") +@Fluent +public final class HyperVReplicaPolicyInput extends PolicyProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaPolicyInput.class); + + /* + * 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; + + /** + * 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 0000000000000..8bc73c09561d0 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVReplicaReplicationDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..66384607d6cdb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVSiteDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HyperVSite fabric specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVSite") +@Immutable +public final class HyperVSiteDetails extends FabricSpecificDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVSiteDetails.class); + + /** + * 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/HyperVVirtualMachineDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVVirtualMachineDetails.java new file mode 100644 index 0000000000000..346da77b3e909 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/HyperVVirtualMachineDetails.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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") +@JsonTypeName("HyperVVirtualMachine") +@Fluent +public final class HyperVVirtualMachineDetails extends ConfigurationSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HyperVVirtualMachineDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..f81326d8237a1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity provider details. */ +@Fluent +public final class IdentityProviderDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..6c21255b9f44c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IdentityProviderInput.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity provider input. */ +@Fluent +public final class IdentityProviderInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderInput.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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 0000000000000..623a787aa8177 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The details of the InMage agent. */ +@Fluent +public final class InMageAgentDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAgentDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..232d90a1bc0fb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ApplyRecoveryPointInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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") +@Fluent +public final class InMageAzureV2ApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2ApplyRecoveryPointInput.class); + + /* + * The vault location where the recovery Vm resides. + */ + @JsonProperty(value = "vaultLocation") + private String vaultLocation; + + /** + * Get the vaultLocation property: The vault location where the recovery Vm resides. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: The vault location where the recovery Vm resides. + * + * @param vaultLocation the vaultLocation value to set. + * @return the InMageAzureV2ApplyRecoveryPointInput object itself. + */ + public InMageAzureV2ApplyRecoveryPointInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + 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/InMageAzureV2DiskInputDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2DiskInputDetails.java new file mode 100644 index 0000000000000..14adc50f75359 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk input details. */ +@Fluent +public final class InMageAzureV2DiskInputDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2DiskInputDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..31ac8fbde7fbf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EnableProtectionInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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("InMageAzureV2") +@Fluent +public final class InMageAzureV2EnableProtectionInput extends EnableProtectionProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2EnableProtectionInput.class); + + /* + * The Master target Id. + */ + @JsonProperty(value = "masterTargetId") + private String masterTargetId; + + /* + * The Process Server Id. + */ + @JsonProperty(value = "processServerId") + private String processServerId; + + /* + * The storage account name. + */ + @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 DiskEncryptionSet ARM ID. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private String targetAvailabilityZone; + + /* + * The proximity placement group ARM Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId") + private String targetProximityPlacementGroupId; + + /* + * The availability set ARM Id. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /** + * 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 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 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 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 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 targetAvailabilitySetId property: The availability set ARM Id. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: The availability set ARM Id. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the InMageAzureV2EnableProtectionInput object itself. + */ + public InMageAzureV2EnableProtectionInput withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + 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; + } + + /** + * 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 0000000000000..1129bc3ed7b97 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2EventDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2EventDetails.class); + + /* + * 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; + + /** + * 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/InMageAzureV2FailoverProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2FailoverProviderInput.java new file mode 100644 index 0000000000000..6e943f2e53bc7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2FailoverProviderInput.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** InMageAzureV2 provider specific input for failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2FailoverProviderInput extends ProviderSpecificFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2FailoverProviderInput.class); + + /* + * Location of the vault. + */ + @JsonProperty(value = "vaultLocation") + private String vaultLocation; + + /* + * 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; + + /** + * Get the vaultLocation property: Location of the vault. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: Location of the vault. + * + * @param vaultLocation the vaultLocation value to set. + * @return the InMageAzureV2FailoverProviderInput object itself. + */ + public InMageAzureV2FailoverProviderInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + 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 InMageAzureV2FailoverProviderInput object itself. + */ + public InMageAzureV2FailoverProviderInput 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/InMageAzureV2ManagedDiskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ManagedDiskDetails.java new file mode 100644 index 0000000000000..21c6a13f896d1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ManagedDiskDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageAzureV2 Managed disk details. */ +@Fluent +public final class InMageAzureV2ManagedDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2ManagedDiskDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..dad701f4fc17b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2PolicyDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..5c88985c16ed2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2PolicyInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2PolicyInput.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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 0000000000000..80fa896d5bcf5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ProtectedDiskDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** InMageAzureV2 protected disk details. */ +@Fluent +public final class InMageAzureV2ProtectedDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2ProtectedDiskDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..7760f5d1f05ba --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2RecoveryPointDetails.class); + + /* + * A value indicating whether the recovery point is multi VM consistent. + */ + @JsonProperty(value = "isMultiVmSyncPoint") + private String isMultiVmSyncPoint; + + /** + * 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 0000000000000..71a0d46a6861c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReplicationDetails.java @@ -0,0 +1,1468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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; + +/** InMageAzureV2 provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMageAzureV2") +@Fluent +public final class InMageAzureV2ReplicationDetails extends ReplicationProviderSpecificSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2ReplicationDetails.class); + + /* + * 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", access = JsonProperty.Access.WRITE_ONLY) + 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 data stores of the on-premise machine. Value can be list of strings + * that contain data store 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 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; + + /** + * 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; + } + + /** + * 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 data stores of the on-premise machine. Value can be list of strings that contain + * data store names. + * + * @return the datastores value. + */ + public List datastores() { + return this.datastores; + } + + /** + * Set the datastores property: The data stores of the on-premise machine. Value can be list of strings that contain + * data store 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 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; + } + + /** + * 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()); + } + } +} 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 0000000000000..8023a865f3261 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2ReprotectInput.class); + + /* + * 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; + + /** + * 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/InMageAzureV2TestFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2TestFailoverInput.java new file mode 100644 index 0000000000000..43c60960caf29 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2TestFailoverInput.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2TestFailoverInput.class); + + /* + * Location of the vault. + */ + @JsonProperty(value = "vaultLocation") + private String vaultLocation; + + /* + * 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; + + /** + * Get the vaultLocation property: Location of the vault. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: Location of the vault. + * + * @param vaultLocation the vaultLocation value to set. + * @return the InMageAzureV2TestFailoverInput object itself. + */ + public InMageAzureV2TestFailoverInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + 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 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 0000000000000..12080b5a8e28d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UnplannedFailoverInput.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageAzureV2UnplannedFailoverInput.class); + + /* + * Location of the vault. + */ + @JsonProperty(value = "vaultLocation") + private String vaultLocation; + + /* + * 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; + + /** + * Get the vaultLocation property: Location of the vault. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: Location of the vault. + * + * @param vaultLocation the vaultLocation value to set. + * @return the InMageAzureV2UnplannedFailoverInput object itself. + */ + public InMageAzureV2UnplannedFailoverInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + 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 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 0000000000000..570803699dbe2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2UpdateReplicationProtectedItemInput.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** 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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(InMageAzureV2UpdateReplicationProtectedItemInput.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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/InMageBasePolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageBasePolicyDetails.java new file mode 100644 index 0000000000000..24f11d2420b71 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageBasePolicyDetails.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageBasePolicyDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..bc0ab83cd33db --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageDisableProtectionProviderSpecificInput.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.JsonIgnore; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(InMageDisableProtectionProviderSpecificInput.class); + + /* + * A value indicating whether the replica VM should be destroyed or + * retained. Values from Delete and Retain. + */ + @JsonProperty(value = "replicaVmDeletionStatus") + private String replicaVmDeletionStatus; + + /** + * 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 0000000000000..3ffe102a62348 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VMware/Physical specific Disk Details. */ +@Fluent +public final class InMageDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageDiskDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..01350394bcd55 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageDiskExclusionInput.class); + + /* + * 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; + + /** + * 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 0000000000000..7d81481aaf02d --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageDiskSignatureExclusionOptions.class); + + /* + * The guest signature of disk to be excluded from replication. + */ + @JsonProperty(value = "diskSignature") + private String diskSignature; + + /** + * 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 0000000000000..bbfcde3b692a7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageEnableProtectionInput.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageEnableProtectionInput.class); + + /* + * 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 data store 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; + + /** + * 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 data store name. + * + * @return the datastoreName value. + */ + public String datastoreName() { + return this.datastoreName; + } + + /** + * Set the datastoreName property: The target data store 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(); + } + } +} diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageFailoverProviderInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageFailoverProviderInput.java new file mode 100644 index 0000000000000..61f2761e0e9f3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageFailoverProviderInput.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Provider specific input for InMage failover. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("InMage") +@Fluent +public final class InMageFailoverProviderInput extends ProviderSpecificFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageFailoverProviderInput.class); + + /* + * 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; + + /** + * 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 InMageFailoverProviderInput object itself. + */ + public InMageFailoverProviderInput 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 InMageFailoverProviderInput object itself. + */ + public InMageFailoverProviderInput 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/InMagePolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyDetails.java new file mode 100644 index 0000000000000..7f132b7e58bf6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyDetails.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMagePolicyDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..b2e9a974a1837 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMagePolicyInput.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMagePolicyInput.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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 0000000000000..d6fe09c1bfc08 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageProtectedDiskDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** InMage protected disk details. */ +@Fluent +public final class InMageProtectedDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageProtectedDiskDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..94edd36667918 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmAgentUpgradeBlockingErrorDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** InMageRcm source agent upgrade blocking error details. */ +@Immutable +public final class InMageRcmAgentUpgradeBlockingErrorDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmAgentUpgradeBlockingErrorDetails.class); + + /* + * 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) + private Map errorMessageParameters; + + /* + * The error tags. + */ + @JsonProperty(value = "errorTags", access = JsonProperty.Access.WRITE_ONLY) + private Map errorTags; + + /** + * 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/InMageRcmApplyRecoveryPointInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplyRecoveryPointInput.java new file mode 100644 index 0000000000000..8515ed83ce69c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmApplyRecoveryPointInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmApplyRecoveryPointInput.class); + + /* + * The recovery point Id. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** + * 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(); + } +} 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 0000000000000..430685fa27adf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDiskInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm disk input. */ +@Fluent +public final class InMageRcmDiskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmDiskInput.class); + + /* + * The disk Id. + */ + @JsonProperty(value = "diskId") + private String diskId; + + /* + * The log storage account ARM Id. + */ + @JsonProperty(value = "logStorageAccountId") + private String logStorageAccountId; + + /* + * The disk type. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /* + * The disk encryption set ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** + * 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 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 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() { + } +} 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 0000000000000..ad6821c0c5534 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmDisksDefaultInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm disk input. */ +@Fluent +public final class InMageRcmDisksDefaultInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmDisksDefaultInput.class); + + /* + * The log storage account ARM Id. + */ + @JsonProperty(value = "logStorageAccountId") + private String logStorageAccountId; + + /* + * The disk type. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /* + * The disk encryption set ARM Id. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** + * 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 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 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() { + } +} 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 0000000000000..d16b5145d78d9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEnableProtectionInput.java @@ -0,0 +1,506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmEnableProtectionInput.class); + + /* + * The ARM Id of discovered machine. + */ + @JsonProperty(value = "fabricDiscoveryMachineId") + 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") + 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") + private String processServerId; + + /* + * The multi VM group name. + */ + @JsonProperty(value = "multiVmGroupName") + private String multiVmGroupName; + + /** + * 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 (disksToInclude() != null) { + disksToInclude().forEach(e -> e.validate()); + } + if (disksDefault() != null) { + disksDefault().validate(); + } + } +} 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 0000000000000..c3b561e04752d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmEventDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmEventDetails.class); + + /* + * The protected item name. + */ + @JsonProperty(value = "protectedItemName", access = JsonProperty.Access.WRITE_ONLY) + private String protectedItemName; + + /** + * Get the protectedItemName property: The protected item name. + * + * @return the protectedItemName value. + */ + public String protectedItemName() { + return this.protectedItemName; + } + + /** + * 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 0000000000000..f011c9924f428 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricCreationInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmFabricCreationInput.class); + + /* + * 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 identity provider input for source agent authentication. + */ + @JsonProperty(value = "sourceAgentIdentity") + private IdentityProviderInput sourceAgentIdentity; + + /* + * The certificate to be used for AAD authentication. + */ + @JsonProperty(value = "authCertificate") + private String authCertificate; + + /** + * 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; + } + + /** + * Get the authCertificate property: The certificate to be used for AAD authentication. + * + * @return the authCertificate value. + */ + public String authCertificate() { + return this.authCertificate; + } + + /** + * Set the authCertificate property: The certificate to be used for AAD authentication. + * + * @param authCertificate the authCertificate value to set. + * @return the InMageRcmFabricCreationInput object itself. + */ + public InMageRcmFabricCreationInput withAuthCertificate(String authCertificate) { + this.authCertificate = authCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sourceAgentIdentity() != null) { + sourceAgentIdentity().validate(); + } + } +} 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 0000000000000..bf732ecc8fae2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmFabricSpecificDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@Immutable +public final class InMageRcmFabricSpecificDetails extends FabricSpecificDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmFabricSpecificDetails.class); + + /* + * 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 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 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; + + /** + * 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 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 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 (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 (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/InMageRcmLastAgentUpgradeErrorDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmLastAgentUpgradeErrorDetails.java new file mode 100644 index 0000000000000..d113ba860499e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmLastAgentUpgradeErrorDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** InMageRcm last source agent upgrade error details. */ +@Immutable +public final class InMageRcmLastAgentUpgradeErrorDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmLastAgentUpgradeErrorDetails.class); + + /* + * 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) + private Map errorMessageParameters; + + /* + * The error tags. + */ + @JsonProperty(value = "errorTags", access = JsonProperty.Access.WRITE_ONLY) + private Map errorTags; + + /** + * 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 0000000000000..f4a996a914006 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmMobilityAgentDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** InMageRcm mobility agent details. */ +@Immutable +public final class InMageRcmMobilityAgentDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmMobilityAgentDetails.class); + + /* + * 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; + + /** + * 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/InMageRcmNicDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicDetails.java new file mode 100644 index 0000000000000..095ff0694ecd7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm NIC details. */ +@Immutable +public final class InMageRcmNicDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmNicDetails.class); + + /* + * 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", access = JsonProperty.Access.WRITE_ONLY) + private String isPrimaryNic; + + /* + * A value indicating whether this NIC is selected for failover. + */ + @JsonProperty(value = "isSelectedForFailover", access = JsonProperty.Access.WRITE_ONLY) + 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", access = JsonProperty.Access.WRITE_ONLY) + private String targetIpAddress; + + /* + * The target IP address type. + */ + @JsonProperty(value = "targetIPAddressType", access = JsonProperty.Access.WRITE_ONLY) + private EthernetAddressType targetIpAddressType; + + /* + * Target subnet name. + */ + @JsonProperty(value = "targetSubnetName", access = JsonProperty.Access.WRITE_ONLY) + private String targetSubnetName; + + /* + * Test subnet name. + */ + @JsonProperty(value = "testSubnetName", access = JsonProperty.Access.WRITE_ONLY) + private String testSubnetName; + + /* + * The test IP address. + */ + @JsonProperty(value = "testIPAddress", access = JsonProperty.Access.WRITE_ONLY) + private String testIpAddress; + + /* + * The test IP address type. + */ + @JsonProperty(value = "testIPAddressType", access = JsonProperty.Access.WRITE_ONLY) + private EthernetAddressType testIpAddressType; + + /** + * 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; + } + + /** + * Get the isSelectedForFailover property: A value indicating whether this NIC is selected for failover. + * + * @return the isSelectedForFailover value. + */ + public String isSelectedForFailover() { + return this.isSelectedForFailover; + } + + /** + * 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; + } + + /** + * Get the targetIpAddressType property: The target IP address type. + * + * @return the targetIpAddressType value. + */ + public EthernetAddressType targetIpAddressType() { + return this.targetIpAddressType; + } + + /** + * Get the targetSubnetName property: Target subnet name. + * + * @return the targetSubnetName value. + */ + public String targetSubnetName() { + return this.targetSubnetName; + } + + /** + * Get the testSubnetName property: Test subnet name. + * + * @return the testSubnetName value. + */ + public String testSubnetName() { + return this.testSubnetName; + } + + /** + * Get the testIpAddress property: The test IP address. + * + * @return the testIpAddress value. + */ + public String testIpAddress() { + return this.testIpAddress; + } + + /** + * Get the testIpAddressType property: The test IP address type. + * + * @return the testIpAddressType value. + */ + public EthernetAddressType testIpAddressType() { + return this.testIpAddressType; + } + + /** + * 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 0000000000000..fd65dc6cb992e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmNicInput.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm NIC input. */ +@Fluent +public final class InMageRcmNicInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmNicInput.class); + + /* + * The NIC Id. + */ + @JsonProperty(value = "nicId") + 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; + + /* + * 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; + + /** + * 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() { + } +} 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 0000000000000..c3c3126d009e8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyCreationInput.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmPolicyCreationInput.class); + + /* + * 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; + + /** + * 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 0000000000000..6e22b83ed8a6a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmPolicyDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@Immutable +public final class InMageRcmPolicyDetails extends PolicyProviderSpecificDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmPolicyDetails.class); + + /* + * The duration in minutes until which the recovery points need to be + * stored. + */ + @JsonProperty(value = "recoveryPointHistoryInMinutes", access = JsonProperty.Access.WRITE_ONLY) + private Integer recoveryPointHistoryInMinutes; + + /* + * The app consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes", access = JsonProperty.Access.WRITE_ONLY) + private Integer appConsistentFrequencyInMinutes; + + /* + * The crash consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes", access = JsonProperty.Access.WRITE_ONLY) + private Integer crashConsistentFrequencyInMinutes; + + /* + * A value indicating whether multi-VM sync has to be enabled. + */ + @JsonProperty(value = "enableMultiVmSync", access = JsonProperty.Access.WRITE_ONLY) + private String enableMultiVmSync; + + /** + * 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; + } + + /** + * Get the appConsistentFrequencyInMinutes property: The app consistent snapshot frequency in minutes. + * + * @return the appConsistentFrequencyInMinutes value. + */ + public Integer appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: The crash consistent snapshot frequency in minutes. + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public Integer crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * 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; + } + + /** + * 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 0000000000000..2c2fed128cdb4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmProtectedDiskDetails.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InMageRcm protected disk details. */ +@Immutable +public final class InMageRcmProtectedDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmProtectedDiskDetails.class); + + /* + * 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 disk encryption set 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 ARM Id of the target managed disk. + */ + @JsonProperty(value = "targetManagedDiskId", access = JsonProperty.Access.WRITE_ONLY) + private String targetManagedDiskId; + + /* + * The disk type. + */ + @JsonProperty(value = "diskType", access = JsonProperty.Access.WRITE_ONLY) + private DiskAccountType diskType; + + /** + * 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 disk encryption set 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 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; + } + + /** + * 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/InMageRcmRecoveryPointDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmRecoveryPointDetails.java new file mode 100644 index 0000000000000..70ebb2d251da7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmRecoveryPointDetails.class); + + /* + * A value indicating whether the recovery point is multi VM consistent. + */ + @JsonProperty(value = "isMultiVmSyncPoint", access = JsonProperty.Access.WRITE_ONLY) + private String isMultiVmSyncPoint; + + /** + * 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 0000000000000..9d6a6f2d7e24b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmReplicationDetails.java @@ -0,0 +1,719 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@Immutable +public final class InMageRcmReplicationDetails extends ReplicationProviderSpecificSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmReplicationDetails.class); + + /* + * 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 target generation. + */ + @JsonProperty(value = "targetGeneration", access = JsonProperty.Access.WRITE_ONLY) + private String targetGeneration; + + /* + * License Type of the VM to be used. + */ + @JsonProperty(value = "licenseType", access = JsonProperty.Access.WRITE_ONLY) + private String licenseType; + + /* + * Target VM name. + */ + @JsonProperty(value = "targetVmName", access = JsonProperty.Access.WRITE_ONLY) + private String targetVmName; + + /* + * The target VM size. + */ + @JsonProperty(value = "targetVmSize", access = JsonProperty.Access.WRITE_ONLY) + private String targetVmSize; + + /* + * The target resource group Id. + */ + @JsonProperty(value = "targetResourceGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceGroupId; + + /* + * The target availability set Id. + */ + @JsonProperty(value = "targetAvailabilitySetId", access = JsonProperty.Access.WRITE_ONLY) + private String targetAvailabilitySetId; + + /* + * The target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone", access = JsonProperty.Access.WRITE_ONLY) + private String targetAvailabilityZone; + + /* + * The target proximity placement group Id. + */ + @JsonProperty(value = "targetProximityPlacementGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String targetProximityPlacementGroupId; + + /* + * The target boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String targetBootDiagnosticsStorageAccountId; + + /* + * The target network Id. + */ + @JsonProperty(value = "targetNetworkId", access = JsonProperty.Access.WRITE_ONLY) + private String targetNetworkId; + + /* + * The test network Id. + */ + @JsonProperty(value = "testNetworkId", access = JsonProperty.Access.WRITE_ONLY) + 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 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; + + /* + * 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 last agent upgrade failed or cancelled job Id. + */ + @JsonProperty(value = "lastAgentUpgradeFailedJobId", access = JsonProperty.Access.WRITE_ONLY) + private String lastAgentUpgradeFailedJobId; + + /* + * The list of protected disks. + */ + @JsonProperty(value = "protectedDisks", access = JsonProperty.Access.WRITE_ONLY) + 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; + + /* + * The mobility agent information. + */ + @JsonProperty(value = "mobilityAgentDetails", access = JsonProperty.Access.WRITE_ONLY) + private InMageRcmMobilityAgentDetails mobilityAgentDetails; + + /* + * The last agent upgrade error information. + */ + @JsonProperty(value = "lastAgentUpgradeErrorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List lastAgentUpgradeErrorDetails; + + /* + * The agent upgrade blocking error information. + */ + @JsonProperty(value = "agentUpgradeBlockingErrorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List agentUpgradeBlockingErrorDetails; + + /* + * The network details. + */ + @JsonProperty(value = "vmNics", access = JsonProperty.Access.WRITE_ONLY) + private List vmNics; + + /** + * 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 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; + } + + /** + * Get the targetVmName property: Target VM name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Get the targetVmSize property: The target VM size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Get the targetResourceGroupId property: The target resource group Id. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Get the targetAvailabilitySetId property: The target availability set Id. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Get the targetAvailabilityZone property: The target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public String targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Get the targetProximityPlacementGroupId property: The target proximity placement group Id. + * + * @return the targetProximityPlacementGroupId value. + */ + public String targetProximityPlacementGroupId() { + return this.targetProximityPlacementGroupId; + } + + /** + * Get the targetBootDiagnosticsStorageAccountId property: The target boot diagnostics storage account ARM Id. + * + * @return the targetBootDiagnosticsStorageAccountId value. + */ + public String targetBootDiagnosticsStorageAccountId() { + return this.targetBootDiagnosticsStorageAccountId; + } + + /** + * Get the targetNetworkId property: The target network Id. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Get the testNetworkId property: The test network Id. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * 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 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 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 lastAgentUpgradeFailedJobId property: The last agent upgrade failed or cancelled job Id. + * + * @return the lastAgentUpgradeFailedJobId value. + */ + public String lastAgentUpgradeFailedJobId() { + return this.lastAgentUpgradeFailedJobId; + } + + /** + * Get the protectedDisks property: The list of protected disks. + * + * @return the protectedDisks value. + */ + public List protectedDisks() { + return this.protectedDisks; + } + + /** + * 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 mobilityAgentDetails property: The mobility agent information. + * + * @return the mobilityAgentDetails value. + */ + public InMageRcmMobilityAgentDetails mobilityAgentDetails() { + return this.mobilityAgentDetails; + } + + /** + * Get the lastAgentUpgradeErrorDetails property: The last agent upgrade error information. + * + * @return the lastAgentUpgradeErrorDetails value. + */ + public List lastAgentUpgradeErrorDetails() { + return this.lastAgentUpgradeErrorDetails; + } + + /** + * Get the agentUpgradeBlockingErrorDetails property: The agent upgrade blocking error information. + * + * @return the agentUpgradeBlockingErrorDetails value. + */ + public List agentUpgradeBlockingErrorDetails() { + return this.agentUpgradeBlockingErrorDetails; + } + + /** + * Get the vmNics property: The network details. + * + * @return the vmNics value. + */ + public List vmNics() { + return this.vmNics; + } + + /** + * 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()); + } + } +} 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 0000000000000..c548f8834d8aa --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmTestFailoverInput.class); + + /* + * 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; + + /** + * 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 0000000000000..5b716bef3dde1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUnplannedFailoverInput.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageRcmUnplannedFailoverInput.class); + + /* + * A value indicating whether VM is to be shutdown. + */ + @JsonProperty(value = "performShutdown") + 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; + + /** + * 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(); + } +} 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 0000000000000..b3b2d4b4d2691 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageRcmUpdateReplicationProtectedItemInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(InMageRcmUpdateReplicationProtectedItemInput.class); + + /* + * 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; + + /** + * 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 0000000000000..38a28a8654c46 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReplicationDetails.java @@ -0,0 +1,1031 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageReplicationDetails.class); + + /* + * 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") + 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 data stores of the on-premise machine Value can be list of strings + * that contain data store 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; + + /** + * 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 data stores of the on-premise machine Value can be list of strings that contain + * data store names. + * + * @return the datastores value. + */ + public List datastores() { + return this.datastores; + } + + /** + * Set the datastores property: The data stores of the on-premise machine Value can be list of strings that contain + * data store 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; + } + + /** + * 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 0000000000000..6169df625aada --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageReprotectInput.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageReprotectInput.class); + + /* + * 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 data store 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; + + /** + * 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 data store name. + * + * @return the datastoreName value. + */ + public String datastoreName() { + return this.datastoreName; + } + + /** + * Set the datastoreName property: The target data store 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")); + } + } +} 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 0000000000000..96015a33463f5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageTestFailoverInput.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageTestFailoverInput.class); + + /* + * 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; + + /** + * 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 0000000000000..62fe13cbd048f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageUnplannedFailoverInput.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageUnplannedFailoverInput.class); + + /* + * 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; + + /** + * 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 0000000000000..0e6e6f688e370 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageV2RpRecoveryPointType.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; + +/** Defines values for InMageV2RpRecoveryPointType. */ +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); + } + + /** @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 0000000000000..abdc08dcad18a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageVolumeExclusionOptions.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Guest disk signature based disk exclusion option when doing enable protection of virtual machine in InMage provider. + */ +@Fluent +public final class InMageVolumeExclusionOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InMageVolumeExclusionOptions.class); + + /* + * 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; + + /** + * 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 0000000000000..09442262e7d6f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InconsistentVmDetails.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This class stores the monitoring details for consistency check of inconsistent Protected Entity. */ +@Fluent +public final class InconsistentVmDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InconsistentVmDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..32d5b4eb6e194 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Initial replication details. */ +@Fluent +public final class InitialReplicationDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InitialReplicationDetails.class); + + /* + * Initial replication type. + */ + @JsonProperty(value = "initialReplicationType") + private String initialReplicationType; + + /* + * The initial replication progress percentage. + */ + @JsonProperty(value = "initialReplicationProgressPercentage") + private String initialReplicationProgressPercentage; + + /** + * 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 0000000000000..667a526eff239 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InlineWorkflowTaskDetails.class); + + /* + * The list of child workflow ids. + */ + @JsonProperty(value = "workflowIds") + private List workflowIds; + + /** + * 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 0000000000000..f152e8b15aa27 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InnerHealthError.java @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InnerHealthError.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..dbe0f81c7a727 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM input endpoint details. */ +@Fluent +public final class InputEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InputEndpoint.class); + + /* + * The input endpoint name. + */ + @JsonProperty(value = "endpointName") + private String endpointName; + + /* + * The input endpoint private port. + */ + @JsonProperty(value = "privatePort") + private Integer privatePort; + + /* + * The input endpoint public port. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /* + * The input endpoint protocol. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * Get the endpointName property: The input endpoint name. + * + * @return the endpointName value. + */ + public String endpointName() { + return this.endpointName; + } + + /** + * Set the endpointName property: The input endpoint name. + * + * @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 input endpoint private port. + * + * @return the privatePort value. + */ + public Integer privatePort() { + return this.privatePort; + } + + /** + * Set the privatePort property: The input endpoint private port. + * + * @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 input endpoint public port. + * + * @return the publicPort value. + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the publicPort property: The input endpoint public port. + * + * @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 input endpoint protocol. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The input endpoint protocol. + * + * @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/IpConfig.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfig.java new file mode 100644 index 0000000000000..5de97611ae189 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/IpConfig.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IP configuration details. */ +@Fluent +public final class IpConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfig.class); + + /* + * The static IP address of the IP configuration. + */ + @JsonProperty(value = "staticIPAddress") + private String staticIpAddress; + + /* + * The Id of the public IP address associated with the IP configuration. + */ + @JsonProperty(value = "publicIpAddressId") + private String publicIpAddressId; + + /* + * The backend address pools associated with the IP configuration. + */ + @JsonProperty(value = "lBBackendAddressPoolIds") + private List lBBackendAddressPoolIds; + + /** + * Get the staticIpAddress property: The static IP address of the IP configuration. + * + * @return the staticIpAddress value. + */ + public String staticIpAddress() { + return this.staticIpAddress; + } + + /** + * Set the staticIpAddress property: The static IP address of the IP configuration. + * + * @param staticIpAddress the staticIpAddress value to set. + * @return the IpConfig object itself. + */ + public IpConfig withStaticIpAddress(String staticIpAddress) { + this.staticIpAddress = staticIpAddress; + return this; + } + + /** + * Get the publicIpAddressId property: The Id of the public IP address associated with the IP configuration. + * + * @return the publicIpAddressId value. + */ + public String publicIpAddressId() { + return this.publicIpAddressId; + } + + /** + * Set the publicIpAddressId property: The Id of the public IP address associated with the IP configuration. + * + * @param publicIpAddressId the publicIpAddressId value to set. + * @return the IpConfig object itself. + */ + public IpConfig withPublicIpAddressId(String publicIpAddressId) { + this.publicIpAddressId = publicIpAddressId; + return this; + } + + /** + * Get the lBBackendAddressPoolIds property: The backend address pools associated with the IP configuration. + * + * @return the lBBackendAddressPoolIds value. + */ + public List lBBackendAddressPoolIds() { + return this.lBBackendAddressPoolIds; + } + + /** + * Set the lBBackendAddressPoolIds property: The backend address pools associated with the IP configuration. + * + * @param lBBackendAddressPoolIds the lBBackendAddressPoolIds value to set. + * @return the IpConfig object itself. + */ + public IpConfig withLBBackendAddressPoolIds(List lBBackendAddressPoolIds) { + this.lBBackendAddressPoolIds = lBBackendAddressPoolIds; + 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 0000000000000..6ac3b03e16a48 --- /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 0000000000000..42092fffe392a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.JobInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of jobs. */ +@Fluent +public final class JobCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobCollection.class); + + /* + * The list of jobs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..ba1edc791e68e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobDetails.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobDetails.class); + + /* + * The affected object properties like source server, source cloud, target + * server, target cloud etc. based on the workflow object details. + */ + @JsonProperty(value = "affectedObjectDetails") + private Map affectedObjectDetails; + + /** + * 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 0000000000000..6eb24e75f5619 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobEntity.class); + + /* + * 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; + + /** + * 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 0000000000000..6e24ff21a8e29 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** This class contains the error details per object. */ +@Fluent +public final class JobErrorDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobErrorDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..f75d828c802ef --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobProperties.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Job custom data details. */ +@Fluent +public final class JobProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..6c13c05b30f38 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobQueryParameter.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Query parameter to enumerate jobs. */ +@Fluent +public final class JobQueryParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobQueryParameter.class); + + /* + * Date time to get jobs from. + */ + @JsonProperty(value = "startTime") + private String startTime; + + /* + * Date time to get jobs up to. + */ + @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; + + /** + * 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 up to. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Date time to get jobs up to. + * + * @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; + } + + /** + * 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 0000000000000..c94ddd1979650 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobStatusEventDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..08dbc2c112d80 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/JobTaskDetails.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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") +@JsonTypeName("JobTaskDetails") +@Fluent +public final class JobTaskDetails extends TaskTypeDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobTaskDetails.class); + + /* + * The job entity. + */ + @JsonProperty(value = "jobTask") + private JobEntity jobTask; + + /** + * 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 0000000000000..ca6ed4d263a72 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key Encryption Key (KEK) information. */ +@Fluent +public final class KeyEncryptionKeyInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyEncryptionKeyInfo.class); + + /* + * The key URL / identifier. + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * The KeyVault resource ARM Id for key. + */ + @JsonProperty(value = "keyVaultResourceArmId") + private String keyVaultResourceArmId; + + /** + * 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 0000000000000..bb59a1ca1d47d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LicenseType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LicenseType. */ +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); + } + + /** @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 0000000000000..ad74460a6e882 --- /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 0000000000000..6b710398477ab --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.LogicalNetworkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of logical networks. */ +@Fluent +public final class LogicalNetworkCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogicalNetworkCollection.class); + + /* + * The Logical Networks list details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..174ce71641565 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/LogicalNetworkProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Logical Network Properties. */ +@Fluent +public final class LogicalNetworkProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogicalNetworkProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..c9dc261d706c3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManualActionTaskDetails.class); + + /* + * The name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The instructions. + */ + @JsonProperty(value = "instructions") + private String instructions; + + /* + * The observation. + */ + @JsonProperty(value = "observation") + private String observation; + + /** + * 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/MasterTargetServer.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MasterTargetServer.java new file mode 100644 index 0000000000000..b794a10964412 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MasterTargetServer.class); + + /* + * 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; + + /** + * 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 0000000000000..3de381761fbc0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for migrate. */ +@Fluent +public final class MigrateInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateInput.class); + + /* + * Migrate input properties. + */ + @JsonProperty(value = "properties", required = true) + private MigrateInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..e9be45c92c605 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrateInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Migrate input properties. */ +@Fluent +public final class MigrateInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateInputProperties.class); + + /* + * The provider specific details. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private MigrateProviderSpecificInput providerSpecificDetails; + + /** + * 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(); + } + } +} 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 0000000000000..753779150fdb2 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateProviderSpecificInput.class); + + /** + * 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 0000000000000..3fc0ff345710c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItem.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 0000000000000..45dda4e623027 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationItemInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Migration item collection. */ +@Fluent +public final class MigrationItemCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationItemCollection.class); + + /* + * The list of migration items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..a96e5f7f801b7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemOperation.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; + +/** 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"); + + /** + * 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); + } + + /** @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 0000000000000..5e1cac26ae383 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationItemProperties.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Migration item properties. */ +@Fluent +public final class MigrationItemProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationItemProperties.class); + + /* + * 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 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 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 String 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 migration provider custom settings. + */ + @JsonProperty(value = "providerSpecificDetails") + private MigrationProviderSpecificSettings providerSpecificDetails; + + /** + * 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 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 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 String 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 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 (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 0000000000000..e541152b537b3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationProviderSpecificSettings.class); + + /** + * 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 0000000000000..0a4509ef0a517 --- /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 0000000000000..51f804f88f44e --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.MigrationRecoveryPointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of migration recovery points. */ +@Fluent +public final class MigrationRecoveryPointCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationRecoveryPointCollection.class); + + /* + * The migration recovery point details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..8bf156af6b772 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Migration item recovery point properties. */ +@Immutable +public final class MigrationRecoveryPointProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationRecoveryPointProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..91766cc2575b7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationRecoveryPointType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationRecoveryPointType. */ +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); + } + + /** @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 0000000000000..068cd037b0a09 --- /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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + String migrationRecoveryPointName, + Context context); +} 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 0000000000000..670c2541b4ddf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MigrationState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationState. */ +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"); + + /** + * 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); + } + + /** @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 0000000000000..ced25e246f8d5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MobilityAgentUpgradeState.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; + +/** Defines values for MobilityAgentUpgradeState. */ +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); + } + + /** @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 0000000000000..fe4d08cc25658 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Mobility Service update details. */ +@Fluent +public final class MobilityServiceUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MobilityServiceUpdate.class); + + /* + * 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; + + /** + * 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 0000000000000..55a7ad2b7ff77 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmGroupCreateOption.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MultiVmGroupCreateOption. */ +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); + } + + /** @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 0000000000000..025272a5a9056 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmSyncPointOption.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; + +/** Defines values for MultiVmSyncPointOption. */ +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); + } + + /** @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/MultiVmSyncStatus.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmSyncStatus.java new file mode 100644 index 0000000000000..52e2f0ed52f10 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/MultiVmSyncStatus.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MultiVmSyncStatus. */ +public final class MultiVmSyncStatus extends ExpandableStringEnum { + /** Static value Enabled for MultiVmSyncStatus. */ + public static final MultiVmSyncStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for MultiVmSyncStatus. */ + public static final MultiVmSyncStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a MultiVmSyncStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MultiVmSyncStatus. + */ + @JsonCreator + public static MultiVmSyncStatus fromString(String name) { + return fromString(name, MultiVmSyncStatus.class); + } + + /** @return known MultiVmSyncStatus values. */ + public static Collection values() { + return values(MultiVmSyncStatus.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 0000000000000..ba17c5faa69b0 --- /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 0000000000000..acaa42b2e656d --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of networks. */ +@Fluent +public final class NetworkCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkCollection.class); + + /* + * The Networks list details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..706dde281bea9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NetworkMapping.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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.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. + */ + WithCreate withExistingReplicationNetwork( + String resourceName, String resourceGroupName, String fabricName, String networkName); + } + /** + * 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 extends DefinitionStages.WithProperties { + /** + * 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); + } + /** 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); + } + } + /** + * 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 0000000000000..f48daa171e96a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.NetworkMappingInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkMappingCollection.class); + + /* + * The Network Mappings list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..926278b3241de --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkMappingFabricSpecificSettings.class); + + /** + * 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 0000000000000..e9075a7c30488 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Mapping Properties. */ +@Fluent +public final class NetworkMappingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkMappingProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..abefe57ca0cb7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Properties. */ +@Fluent +public final class NetworkProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..6152ea9902845 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewProtectionProfile.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NewProtectionProfile.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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 0000000000000..b614786651570 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/NewRecoveryVirtualNetwork.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NewRecoveryVirtualNetwork.class); + + /* + * 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; + + /** + * 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 0000000000000..da9abdb244692 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk Details. */ +@Fluent +public final class OSDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..45e4bde1eb6bd --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of the OS Disk. */ +@Fluent +public final class OSDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSDiskDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..3149d3d86b8c4 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Wrapper model for OSVersion to include version and service pack info. */ +@Fluent +public final class OSVersionWrapper { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSVersionWrapper.class); + + /* + * The version. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Service pack. + */ + @JsonProperty(value = "servicePack") + private String servicePack; + + /** + * 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: Service pack. + * + * @return the servicePack value. + */ + public String servicePack() { + return this.servicePack; + } + + /** + * Set the servicePack property: 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 0000000000000..70ce0ac074879 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Operations.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface 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. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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. + */ + 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 0000000000000..3bacdbbb1759f --- /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 0000000000000..38b967f563b10 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.OperationsDiscoveryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of ClientDiscovery details. */ +@Fluent +public final class OperationsDiscoveryCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDiscoveryCollection.class); + + /* + * The ClientDiscovery details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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/PlannedFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PlannedFailoverInput.java new file mode 100644 index 0000000000000..c572d65d3592e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for planned failover. */ +@Fluent +public final class PlannedFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PlannedFailoverInput.class); + + /* + * Planned failover input properties + */ + @JsonProperty(value = "properties") + private PlannedFailoverInputProperties properties; + + /** + * 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 0000000000000..54d5bc520f98a --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for planned failover input properties. */ +@Fluent +public final class PlannedFailoverInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PlannedFailoverInputProperties.class); + + /* + * Failover direction. + */ + @JsonProperty(value = "failoverDirection") + private String failoverDirection; + + /* + * Provider specific settings + */ + @JsonProperty(value = "providerSpecificDetails") + private ProviderSpecificFailoverInput providerSpecificDetails; + + /** + * 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 ProviderSpecificFailoverInput 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( + ProviderSpecificFailoverInput 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/Policy.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Policy.java new file mode 100644 index 0000000000000..df95e28761c17 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Policy.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.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 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 0000000000000..4203b7ac049d9 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.PolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protection Profile Collection details. */ +@Fluent +public final class PolicyCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyCollection.class); + + /* + * The policy details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..a0f231c2e3574 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection profile custom data details. */ +@Fluent +public final class PolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyProperties.class); + + /* + * The FriendlyName. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The ReplicationChannelSetting. + */ + @JsonProperty(value = "providerSpecificDetails") + private PolicyProviderSpecificDetails providerSpecificDetails; + + /** + * 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 0000000000000..c4ef3a8a3ed08 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = "InMageRcm", value = InMageRcmPolicyDetails.class), + @JsonSubTypes.Type(name = "RcmAzureMigration", value = RcmAzureMigrationPolicyDetails.class), + @JsonSubTypes.Type(name = "VMwareCbt", value = VmwareCbtPolicyDetails.class) +}) +@Immutable +public class PolicyProviderSpecificDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyProviderSpecificDetails.class); + + /** + * 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 0000000000000..a77ed5e18ccdc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PolicyProviderSpecificInput.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.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 = "A2A", value = A2APolicyCreationInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzurePolicyInput.class), + @JsonSubTypes.Type(name = "HyperVReplica2012R2", value = HyperVReplicaBluePolicyInput.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 = "InMageRcm", value = InMageRcmPolicyCreationInput.class), + @JsonSubTypes.Type(name = "VMwareCbt", value = VMwareCbtPolicyCreationInput.class) +}) +@Immutable +public class PolicyProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyProviderSpecificInput.class); + + /** + * 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 0000000000000..3e47411b3ab58 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PossibleOperationsDirections.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.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); + } + + /** @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 0000000000000..4a12eec89a6a5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PresenceStatus.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PresenceStatus. */ +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); + } + + /** @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 0000000000000..4dc92a55cd21f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServer.java @@ -0,0 +1,889 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of the Process Server. */ +@Fluent +public final class ProcessServer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessServer.class); + + /* + * 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; + + /** + * 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 0000000000000..70f597ae9260a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProcessServerDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Process server details. */ +@Immutable +public final class ProcessServerDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProcessServerDetails.class); + + /* + * 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 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 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 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; + + /** + * 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 version property: The process server 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 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 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 0000000000000..dfeedb829fb0a --- /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 0000000000000..c60d30ef4df22 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectableItemInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protectable item collection. */ +@Fluent +public final class ProtectableItemCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectableItemCollection.class); + + /* + * The Protectable item details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..a8520d16d9603 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication protected item custom data details. */ +@Fluent +public final class ProtectableItemProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectableItemProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..8548a5b357692 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainer.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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); + + /** + * 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); + + /** + * 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); + + /** + * 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(); + + /** + * 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); + + /** + * 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); + + /** + * 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 0000000000000..dbaee87d53b74 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protection Container collection. */ +@Fluent +public final class ProtectionContainerCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerCollection.class); + + /* + * The Protection Container details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..508e8f66ec191 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base class for fabric specific details of container. */ +@Immutable +public final class ProtectionContainerFabricSpecificDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerFabricSpecificDetails.class); + + /* + * Gets the class type. Overridden in derived classes. + */ + @JsonProperty(value = "instanceType", access = JsonProperty.Access.WRITE_ONLY) + private String instanceType; + + /** + * 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 0000000000000..4e65f37f29b30 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionContainerMapping.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.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 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); + + /** + * 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); + + /** + * 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 0000000000000..dd49543b087a3 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ProtectionContainerMappingInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protection container mapping collection class. */ +@Fluent +public final class ProtectionContainerMappingCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerMappingCollection.class); + + /* + * List of container mappings. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to fetch rest of the data. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..36efdf29ac405 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protection container mapping properties. */ +@Fluent +public final class ProtectionContainerMappingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerMappingProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..7e5505042b5fc --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = "VMwareCbt", value = VMwareCbtProtectionContainerMappingDetails.class) +}) +@Immutable +public class ProtectionContainerMappingProviderSpecificDetails { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ProtectionContainerMappingProviderSpecificDetails.class); + + /** + * 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 0000000000000..395e0f8940678 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protection profile custom data details. */ +@Fluent +public final class ProtectionContainerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..6fcec73882cfc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProtectionHealth.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; + +/** Defines values for ProtectionHealth. */ +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); + } + + /** @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 0000000000000..8258bfded63f4 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionProfileCustomDetails.class); + + /** + * 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 0000000000000..4d20c814ba432 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This class contains the error details per object. */ +@Fluent +public final class ProviderError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderError.class); + + /* + * 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; + + /** + * 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/ProviderSpecificFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderSpecificFailoverInput.java new file mode 100644 index 0000000000000..d13745d1b9bca --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ProviderSpecificFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = ProviderSpecificFailoverInput.class) +@JsonTypeName("ProviderSpecificFailoverInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "A2A", value = A2AFailoverProviderInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzureFailback", value = HyperVReplicaAzureFailbackProviderInput.class), + @JsonSubTypes.Type(name = "HyperVReplicaAzure", value = HyperVReplicaAzureFailoverProviderInput.class), + @JsonSubTypes.Type(name = "InMageAzureV2", value = InMageAzureV2FailoverProviderInput.class), + @JsonSubTypes.Type(name = "InMage", value = InMageFailoverProviderInput.class) +}) +@Immutable +public class ProviderSpecificFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderSpecificFailoverInput.class); + + /** + * 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 0000000000000..4c0c9aae7dd6b --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderSpecificRecoveryPointDetails.class); + + /** + * 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 0000000000000..f96929e54582f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/PushInstallerDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Push installer details. */ +@Immutable +public final class PushInstallerDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PushInstallerDetails.class); + + /* + * 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 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; + + /** + * 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 version property: The push installer 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/RcmAzureMigrationPolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmAzureMigrationPolicyDetails.java new file mode 100644 index 0000000000000..bcfea31deb169 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmAzureMigrationPolicyDetails.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** RCM based Azure migration specific policy details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("RcmAzureMigration") +@Fluent +public final class RcmAzureMigrationPolicyDetails extends PolicyProviderSpecificDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RcmAzureMigrationPolicyDetails.class); + + /* + * 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 MultiVmSyncStatus multiVmSyncStatus; + + /* + * The crash consistent snapshot frequency in minutes. + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes") + private Integer crashConsistentFrequencyInMinutes; + + /** + * 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 RcmAzureMigrationPolicyDetails object itself. + */ + public RcmAzureMigrationPolicyDetails 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 RcmAzureMigrationPolicyDetails object itself. + */ + public RcmAzureMigrationPolicyDetails 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 RcmAzureMigrationPolicyDetails object itself. + */ + public RcmAzureMigrationPolicyDetails 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 MultiVmSyncStatus 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 RcmAzureMigrationPolicyDetails object itself. + */ + public RcmAzureMigrationPolicyDetails withMultiVmSyncStatus(MultiVmSyncStatus 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 RcmAzureMigrationPolicyDetails object itself. + */ + public RcmAzureMigrationPolicyDetails 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/RcmProxyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmProxyDetails.java new file mode 100644 index 0000000000000..197e9cedf3193 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RcmProxyDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** RCM proxy details. */ +@Immutable +public final class RcmProxyDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RcmProxyDetails.class); + + /* + * 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 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; + + /** + * 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 version property: The RCM proxy 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 0000000000000..c578c11942178 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryAvailabilitySetCustomDetails.class); + + /** + * 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 0000000000000..f604422fc3b8f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlan.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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); + + /** + * The operation to commit the fail over 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(); + + /** + * The operation to commit the fail over 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); + + /** + * 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); + + /** + * 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); + + /** + * 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(); + + /** + * 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); + + /** + * The operation to start the test 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 testFailover(RecoveryPlanTestFailoverInput input); + + /** + * The operation to start the test 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 testFailover(RecoveryPlanTestFailoverInput input, Context context); + + /** + * The operation to cleanup test failover of a recovery plan. + * + * @param input 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); + + /** + * The operation to cleanup test failover of a recovery plan. + * + * @param input 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); + + /** + * The operation to start the 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 unplannedFailover(RecoveryPlanUnplannedFailoverInput input); + + /** + * The operation to start the 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 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 0000000000000..b3a3c7fa301b7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2ADetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanA2ADetails.class); + + /* + * The primary zone. + */ + @JsonProperty(value = "primaryZone") + private String primaryZone; + + /* + * The recovery zone. + */ + @JsonProperty(value = "recoveryZone") + private String recoveryZone; + + /** + * 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; + } + + /** + * 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/RecoveryPlanA2AFailoverInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AFailoverInput.java new file mode 100644 index 0000000000000..afe56e35894ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AFailoverInput.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanA2AFailoverInput.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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 0000000000000..184cdff377e05 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanA2AInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanA2AInput.class); + + /* + * The primary zone. + */ + @JsonProperty(value = "primaryZone") + private String primaryZone; + + /* + * The recovery zone. + */ + @JsonProperty(value = "recoveryZone") + private String recoveryZone; + + /** + * 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; + } + + /** + * 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/RecoveryPlanAction.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAction.java new file mode 100644 index 0000000000000..a64ff460b2c44 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAction.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan action details. */ +@Fluent +public final class RecoveryPlanAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanAction.class); + + /* + * 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; + + /** + * 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(); + } + } +} 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 0000000000000..91939d09a49b4 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanActionDetails.class); + + /** + * 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 0000000000000..21b3bb3253600 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanActionLocation.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RecoveryPlanActionLocation. */ +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); + } + + /** @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 0000000000000..381ae7acb4da3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanAutomationRunbookActionDetails.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanAutomationRunbookActionDetails.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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 0000000000000..bddbc6c84de34 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPlanInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan collection details. */ +@Fluent +public final class RecoveryPlanCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanCollection.class); + + /* + * The list of recovery plans. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..26016edd48c56 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroup.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan group details. */ +@Fluent +public final class RecoveryPlanGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanGroup.class); + + /* + * 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; + + /** + * 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()); + } + } +} 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 0000000000000..0ce2e12515a51 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupTaskDetails.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 recovery plan group task. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("RecoveryPlanGroupTaskDetails") +@Fluent +public final class RecoveryPlanGroupTaskDetails extends GroupTaskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanGroupTaskDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..b6eb99fd1c968 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanGroupType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RecoveryPlanGroupType. */ +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); + } + + /** @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 0000000000000..a0a843d2b41d3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailbackInput.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanHyperVReplicaAzureFailbackInput.class); + + /* + * The data sync option. + */ + @JsonProperty(value = "dataSyncOption", required = true) + private DataSyncStatus dataSyncOption; + + /* + * The ALR option. + */ + @JsonProperty(value = "recoveryVmCreationOption", required = true) + private AlternateLocationRecoveryOption recoveryVmCreationOption; + + /** + * 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")); + } + } +} 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 0000000000000..8102185f6a561 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanHyperVReplicaAzureFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanHyperVReplicaAzureFailoverInput.class); + + /* + * The vault location. + */ + @JsonProperty(value = "vaultLocation") + private String vaultLocation; + + /* + * 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; + + /** + * Get the vaultLocation property: The vault location. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: The vault location. + * + * @param vaultLocation the vaultLocation value to set. + * @return the RecoveryPlanHyperVReplicaAzureFailoverInput object itself. + */ + public RecoveryPlanHyperVReplicaAzureFailoverInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + return this; + } + + /** + * 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 0000000000000..332ac79d496ea --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageAzureV2FailoverInput.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanInMageAzureV2FailoverInput.class); + + /* + * The vault location. + */ + @JsonProperty(value = "vaultLocation", required = true) + private String vaultLocation; + + /* + * 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; + + /** + * Get the vaultLocation property: The vault location. + * + * @return the vaultLocation value. + */ + public String vaultLocation() { + return this.vaultLocation; + } + + /** + * Set the vaultLocation property: The vault location. + * + * @param vaultLocation the vaultLocation value to set. + * @return the RecoveryPlanInMageAzureV2FailoverInput object itself. + */ + public RecoveryPlanInMageAzureV2FailoverInput withVaultLocation(String vaultLocation) { + this.vaultLocation = vaultLocation; + return this; + } + + /** + * 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 (vaultLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vaultLocation in model RecoveryPlanInMageAzureV2FailoverInput")); + } + if (recoveryPointType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointType in model RecoveryPlanInMageAzureV2FailoverInput")); + } + } +} 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 0000000000000..1255e26cf77d1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageFailoverInput.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanInMageFailoverInput.class); + + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType", required = true) + private RpInMageRecoveryPointType recoveryPointType; + + /** + * 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")); + } + } +} 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 0000000000000..5285989df6d6f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanInMageRcmFailoverInput.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanInMageRcmFailoverInput.class); + + /* + * The recovery point type. + */ + @JsonProperty(value = "recoveryPointType") + 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; + + /** + * 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(); + } +} 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 0000000000000..17a5c34020c51 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanManualActionDetails.class); + + /* + * The manual action description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * 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 0000000000000..be87450fe20d4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan planned failover input. */ +@Fluent +public final class RecoveryPlanPlannedFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanPlannedFailoverInput.class); + + /* + * The recovery plan planned failover input properties. + */ + @JsonProperty(value = "properties", required = true) + private RecoveryPlanPlannedFailoverInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..6e654ec5eb33a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPlannedFailoverInputProperties.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan planned failover input properties. */ +@Fluent +public final class RecoveryPlanPlannedFailoverInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanPlannedFailoverInputProperties.class); + + /* + * The failover direction. + */ + @JsonProperty(value = "failoverDirection", required = true) + private PossibleOperationsDirections failoverDirection; + + /* + * The provider specific properties. + */ + @JsonProperty(value = "providerSpecificDetails") + private List providerSpecificDetails; + + /** + * 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()); + } + } +} 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 0000000000000..0c3b5c287c3d5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanPointType.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; + +/** Defines values for RecoveryPlanPointType. */ +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); + } + + /** @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 0000000000000..555961f24c30f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProperties.java @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Recovery plan custom details. */ +@Fluent +public final class RecoveryPlanProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanProperties.class); + + /* + * 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", access = JsonProperty.Access.WRITE_ONLY) + private List providerSpecificDetails; + + /** + * 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; + } + + /** + * 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 0000000000000..8fcda6901ac73 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan protected item. */ +@Fluent +public final class RecoveryPlanProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanProtectedItem.class); + + /* + * 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; + + /** + * 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 0000000000000..f622091d5fb23 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanProviderSpecificDetails.class); + + /** + * 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 0000000000000..a01288be207d9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanProviderSpecificFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Recovery plan provider specific failover input base class. */ +@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 = "InMageRcm", value = RecoveryPlanInMageRcmFailoverInput.class) +}) +@Immutable +public class RecoveryPlanProviderSpecificFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanProviderSpecificFailoverInput.class); + + /** + * 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 0000000000000..3a1c01ac23669 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanProviderSpecificInput.class); + + /** + * 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 0000000000000..1240903c6f76f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanScriptActionDetails.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanScriptActionDetails.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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 0000000000000..909898eadc45e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanShutdownGroupTaskDetails.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 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 GroupTaskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanShutdownGroupTaskDetails.class); + + /* + * 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; + + /** + * 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 RecoveryPlanShutdownGroupTaskDetails object itself. + */ + public RecoveryPlanShutdownGroupTaskDetails 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 RecoveryPlanShutdownGroupTaskDetails object itself. + */ + public RecoveryPlanShutdownGroupTaskDetails 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 RecoveryPlanShutdownGroupTaskDetails object itself. + */ + public RecoveryPlanShutdownGroupTaskDetails withRpGroupType(String rpGroupType) { + this.rpGroupType = 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 0000000000000..a0cdaa0e9f812 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInput.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan test failover cleanup input. */ +@Fluent +public final class RecoveryPlanTestFailoverCleanupInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanTestFailoverCleanupInput.class); + + /* + * The recovery plan test failover cleanup input properties. + */ + @JsonProperty(value = "properties", required = true) + private RecoveryPlanTestFailoverCleanupInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..096b6695d4cee --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverCleanupInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan test failover cleanup input properties. */ +@Fluent +public final class RecoveryPlanTestFailoverCleanupInputProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(RecoveryPlanTestFailoverCleanupInputProperties.class); + + /* + * The test failover cleanup comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /** + * 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 0000000000000..d93d01eacf153 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan test failover input. */ +@Fluent +public final class RecoveryPlanTestFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanTestFailoverInput.class); + + /* + * The recovery plan test failover input properties. + */ + @JsonProperty(value = "properties", required = true) + private RecoveryPlanTestFailoverInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..288ec551bb792 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanTestFailoverInputProperties.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan test failover input properties. */ +@Fluent +public final class RecoveryPlanTestFailoverInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanTestFailoverInputProperties.class); + + /* + * 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; + + /* + * A value indicating whether the test failover cleanup is to be skipped. + */ + @JsonProperty(value = "skipTestFailoverCleanup") + private String skipTestFailoverCleanup; + + /* + * The provider specific properties. + */ + @JsonProperty(value = "providerSpecificDetails") + private List providerSpecificDetails; + + /** + * 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 skipTestFailoverCleanup property: A value indicating whether the test failover cleanup is to be skipped. + * + * @return the skipTestFailoverCleanup value. + */ + public String skipTestFailoverCleanup() { + return this.skipTestFailoverCleanup; + } + + /** + * Set the skipTestFailoverCleanup property: A value indicating whether the test failover cleanup is to be skipped. + * + * @param skipTestFailoverCleanup the skipTestFailoverCleanup value to set. + * @return the RecoveryPlanTestFailoverInputProperties object itself. + */ + public RecoveryPlanTestFailoverInputProperties withSkipTestFailoverCleanup(String skipTestFailoverCleanup) { + this.skipTestFailoverCleanup = skipTestFailoverCleanup; + 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()); + } + } +} 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 0000000000000..025f5d10d6eef --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery plan unplanned failover input. */ +@Fluent +public final class RecoveryPlanUnplannedFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPlanUnplannedFailoverInput.class); + + /* + * The recovery plan unplanned failover input properties. + */ + @JsonProperty(value = "properties", required = true) + private RecoveryPlanUnplannedFailoverInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..856e20dd7ce00 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPlanUnplannedFailoverInputProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan unplanned failover input properties. */ +@Fluent +public final class RecoveryPlanUnplannedFailoverInputProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(RecoveryPlanUnplannedFailoverInputProperties.class); + + /* + * 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; + + /** + * 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()); + } + } +} 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 0000000000000..2a725887a0f44 --- /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: Recovery point related data. + * + * @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 0000000000000..469f61c3de823 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryPointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of recovery point details. */ +@Fluent +public final class RecoveryPointCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointCollection.class); + + /* + * The recovery point details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..8b4e6f39a9f1f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Recovery point properties. */ +@Fluent +public final class RecoveryPointProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..3468bc8e0a0b4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointSyncType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RecoveryPointSyncType. */ +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); + } + + /** @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 0000000000000..3de0d41acf4ae --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPointType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RecoveryPointType. */ +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); + } + + /** @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 0000000000000..4c56e075e6fb7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryPoints.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 RecoveryPoints. */ +public interface RecoveryPoints { + /** + * 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's 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. + */ + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * 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's 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. + */ + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * 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's 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); + + /** + * 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's 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + String recoveryPointName, + Context context); +} 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 0000000000000..3509db78e1233 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryProximityPlacementGroupCustomDetails.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(RecoveryProximityPlacementGroupCustomDetails.class); + + /** + * 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 0000000000000..2d190d1804ff2 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryResourceGroupCustomDetails.class); + + /** + * 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 0000000000000..d4cf85cd19e9f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProvider.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.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); + + /** + * 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(); + + /** + * 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); + + /** + * 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(); + + /** + * 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 0000000000000..a50a09f584441 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.RecoveryServicesProviderInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of providers. */ +@Fluent +public final class RecoveryServicesProviderCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryServicesProviderCollection.class); + + /* + * The Servers details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..a6137a505f980 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RecoveryServicesProviderProperties.java @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Recovery services provider properties. */ +@Fluent +public final class RecoveryServicesProviderProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryServicesProviderProperties.class); + + /* + * 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 authentication identity details. + */ + @JsonProperty(value = "authenticationIdentityDetails") + private IdentityProviderDetails authenticationIdentityDetails; + + /* + * The resource access identity details. + */ + @JsonProperty(value = "resourceAccessIdentityDetails") + private IdentityProviderDetails resourceAccessIdentityDetails; + + /* + * The provider version details. + */ + @JsonProperty(value = "providerVersionDetails") + private VersionDetails providerVersionDetails; + + /** + * 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 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 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 (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 0000000000000..1e9fecfdff13c --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryVirtualNetworkCustomDetails.class); + + /** + * 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 0000000000000..d4483b4edaea0 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for remove disk(s) operation. */ +@Fluent +public final class RemoveDisksInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RemoveDisksInput.class); + + /* + * Remove disk input properties. + */ + @JsonProperty(value = "properties") + private RemoveDisksInputProperties properties; + + /** + * 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 0000000000000..53c9e460a7566 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveDisksInputProperties.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Remove Disk input properties. */ +@Fluent +public final class RemoveDisksInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RemoveDisksInputProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..853272a032595 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RemoveDisksProviderSpecificInput.class); + + /** + * 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 0000000000000..a16b394a92629 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container unpairing input. */ +@Fluent +public final class RemoveProtectionContainerMappingInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RemoveProtectionContainerMappingInput.class); + + /* + * Configure protection input properties. + */ + @JsonProperty(value = "properties") + private RemoveProtectionContainerMappingInputProperties properties; + + /** + * 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 0000000000000..4c7478490318b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RemoveProtectionContainerMappingInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Unpairing input properties. */ +@Fluent +public final class RemoveProtectionContainerMappingInputProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(RemoveProtectionContainerMappingInputProperties.class); + + /* + * Provider specific input for unpairing. + */ + @JsonProperty(value = "providerSpecificInput") + private ReplicationProviderContainerUnmappingInput providerSpecificInput; + + /** + * 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 0000000000000..b6ebd04875f58 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Certificate renewal input. */ +@Fluent +public final class RenewCertificateInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RenewCertificateInput.class); + + /* + * Renew certificate input properties. + */ + @JsonProperty(value = "properties") + private RenewCertificateInputProperties properties; + + /** + * 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 0000000000000..0951e80ceeb20 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Renew Certificate input properties. */ +@Fluent +public final class RenewCertificateInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RenewCertificateInputProperties.class); + + /* + * Renew certificate type. + */ + @JsonProperty(value = "renewCertificateType") + private String renewCertificateType; + + /** + * 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 0000000000000..ab9c705820588 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAgentDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Replication agent details. */ +@Immutable +public final class ReplicationAgentDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationAgentDetails.class); + + /* + * 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 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; + + /** + * 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 version property: The replication agent 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 0000000000000..943bb09268829 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationAlertSettings.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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 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. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String alertSettingName, Context context); + + /** + * 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. + */ + Alert getById(String id); + + /** + * 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. + */ + 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/ReplicationEligibilityResults.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResults.java new file mode 100644 index 0000000000000..2ab19fcdeef5a --- /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 0000000000000..1aef221dd614a --- /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 0000000000000..8b58fee617630 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsErrorInfo.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Error model that can be exposed to the user. */ +@Immutable +public final class ReplicationEligibilityResultsErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationEligibilityResultsErrorInfo.class); + + /* + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * 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 status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * 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 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 0000000000000..f349c05751bb3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEligibilityResultsOperations.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.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationEligibilityResultsOperations. */ +public interface ReplicationEligibilityResultsOperations { + /** + * 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); + + /** + * 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. + */ + Response listWithResponse( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceGroupName, String virtualMachineName, Context context); +} 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 0000000000000..a23247fbbd7f0 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties model for replication eligibility results API. */ +@Fluent +public final class ReplicationEligibilityResultsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationEligibilityResultsProperties.class); + + /* + * The client request Id. + */ + @JsonProperty(value = "clientRequestId", access = JsonProperty.Access.WRITE_ONLY) + private String clientRequestId; + + /* + * The error details. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * 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 0000000000000..ddd63176cebda --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationEvents.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.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 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse(String resourceName, String resourceGroupName, String eventName, Context context); +} 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 0000000000000..0ba5b48fd3b90 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationFabrics.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if 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. + */ + Response getWithResponse(String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 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 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. + */ + Fabric getById(String id); + + /** + * Gets the details of an Azure Site Recovery fabric. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Azure Site Recovery fabric. + */ + Response getByIdWithResponse(String id, 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 0000000000000..993ed2daa0319 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Replication group details. This will be used in case of San and Wvr. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("ReplicationGroupDetails") +@Immutable +public final class ReplicationGroupDetails extends ConfigurationSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationGroupDetails.class); + + /** + * 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 0000000000000..dea1131be60f3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationJobs.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.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 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, String filter, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse(String resourceName, String resourceGroupName, String jobName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 0000000000000..020bb08cdd8d3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationLogicalNetworks.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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationLogicalNetworks. */ +public interface ReplicationLogicalNetworks { + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String logicalNetworkName, Context context); +} 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 0000000000000..d294cd615168f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationMigrationItems.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String migrationItemName, + Context context); + + /** + * 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 com.azure.core.management.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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + 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 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. + */ + PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, 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. + */ + 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. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * 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); + + /** + * 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 0000000000000..46bb681747e9f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworkMappings.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationNetworkMappings. */ +public interface ReplicationNetworkMappings { + /** + * 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. + */ + PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName); + + /** + * 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. + */ + PagedIterable listByReplicationNetworks( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String networkName, + String networkMappingName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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. + */ + NetworkMapping getById(String id); + + /** + * 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. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * 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); + + /** + * 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 0000000000000..649f0d9214fc9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationNetworks.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationNetworks. */ +public interface ReplicationNetworks { + /** + * 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. + */ + PagedIterable listByReplicationFabrics(String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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 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. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String networkName, Context context); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + 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 0000000000000..2c7ce83a0fec9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationPolicies.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationPolicies. */ +public interface ReplicationPolicies { + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse(String resourceName, String resourceGroupName, String policyName, Context context); + + /** + * 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); + + /** + * 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 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. + */ + Policy getById(String id); + + /** + * 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. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * 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); + + /** + * 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 0000000000000..2a76bbd1990fc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectableItems.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 { + /** + * 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. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String filter, + Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String protectableItemName, + Context context); +} 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 0000000000000..31e700fcc2396 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItem.java @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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(); + + /** + * 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); + + /** + * Operation to initiate a planned failover of the replication protected item. + * + * @param failoverInput 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 replication protected item. + */ + ReplicationProtectedItem plannedFailover(PlannedFailoverInput failoverInput); + + /** + * Operation to initiate a planned failover of the replication protected item. + * + * @param failoverInput 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 replication protected item. + */ + ReplicationProtectedItem plannedFailover(PlannedFailoverInput failoverInput, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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(); + + /** + * 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); + + /** + * Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param rrInput 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 replication protected item. + */ + ReplicationProtectedItem reprotect(ReverseReplicationInput rrInput); + + /** + * Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @param rrInput 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 replication protected item. + */ + ReplicationProtectedItem reprotect(ReverseReplicationInput rrInput, Context context); + + /** + * 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); + + /** + * 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); + + /** + * Operation to perform a test failover of the replication protected item. + * + * @param failoverInput 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 failoverInput); + + /** + * Operation to perform a test failover of the replication protected item. + * + * @param failoverInput 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 failoverInput, Context context); + + /** + * 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); + + /** + * 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); + + /** + * Operation to initiate a failover of the replication protected item. + * + * @param failoverInput 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 replication protected item. + */ + ReplicationProtectedItem unplannedFailover(UnplannedFailoverInput failoverInput); + + /** + * Operation to initiate a failover of the replication protected item. + * + * @param failoverInput 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 replication protected item. + */ + ReplicationProtectedItem unplannedFailover(UnplannedFailoverInput failoverInput, 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 0000000000000..c6cc85fd15144 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectedItemInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication protected item collection. */ +@Fluent +public final class ReplicationProtectedItemCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationProtectedItemCollection.class); + + /* + * The Replication protected item details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..049ddb25e54fb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemOperation.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.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 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); + } + + /** @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 0000000000000..ae76c24e0d516 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItemProperties.java @@ -0,0 +1,749 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationProtectedItemProperties.class); + + /* + * 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 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; + + /** + * 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 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; + } + + /** + * 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 0000000000000..47d79b487f60b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectedItems.java @@ -0,0 +1,784 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * 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. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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's 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); + + /** + * 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's 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 replication protected item. + */ + ReplicationProtectedItem plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput); + + /** + * 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 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 replication protected item. + */ + ReplicationProtectedItem plannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + PlannedFailoverInput failoverInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 rrInput 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 replication protected item. + */ + ReplicationProtectedItem reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput); + + /** + * 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 rrInput 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 replication protected item. + */ + ReplicationProtectedItem reprotect( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + ReverseReplicationInput rrInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 failoverInput 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 failoverInput); + + /** + * 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 failoverInput 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 failoverInput, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 replication protected item. + */ + ReplicationProtectedItem unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput); + + /** + * 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 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 replication protected item. + */ + ReplicationProtectedItem unplannedFailover( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName, + UnplannedFailoverInput failoverInput, + Context context); + + /** + * 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 replicationProtectedItemName 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 replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest); + + /** + * 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 replicationProtectedItemName 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 replicationProtectedItemName, + UpdateMobilityServiceRequest updateMobilityServiceRequest, + Context context); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list( + String resourceName, String resourceGroupName, String skipToken, String filter, Context context); + + /** + * 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. + */ + ReplicationProtectedItem getById(String id); + + /** + * 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. + */ + 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 0000000000000..d05155256f635 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainerMappings.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights 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 { + /** + * 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. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, String resourceGroupName, String fabricName, String protectionContainerName); + + /** + * 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. + */ + PagedIterable listByReplicationProtectionContainers( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String mappingName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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. + */ + ProtectionContainerMapping getById(String id); + + /** + * 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. + */ + 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 0000000000000..d706a1beb602c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionContainers.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights 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 { + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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. + */ + ProtectionContainer getById(String id); + + /** + * 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. + */ + 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 0000000000000..67c5009a7193f --- /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 0000000000000..3b2185a08be2b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.ReplicationProtectionIntentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication protection intent objects collection. */ +@Fluent +public final class ReplicationProtectionIntentCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationProtectionIntentCollection.class); + + /* + * The Replication protection intent details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..7589da9439fc4 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication protection intent custom data details. */ +@Fluent +public final class ReplicationProtectionIntentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationProtectionIntentProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..7a8b45ab1d193 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntentProviderSpecificSettings.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ReplicationProtectionIntentProviderSpecificSettings.class); + + /** + * 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 0000000000000..a1f0c95f69df8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProtectionIntents.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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 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. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String intentObjectName, Context context); + + /** + * 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. + */ + ReplicationProtectionIntent getById(String id); + + /** + * 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. + */ + 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 0000000000000..a720fac528e5e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Provider specific input for unpairing operations. */ +@Fluent +public final class ReplicationProviderContainerUnmappingInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationProviderContainerUnmappingInput.class); + + /* + * The class type. + */ + @JsonProperty(value = "instanceType") + private String instanceType; + + /** + * 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 0000000000000..a5e125b0af3b7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = "6c7da455-506f-43ff-a16a-8eb101aebb70", value = VMwareCbtContainerCreationInput.class) +}) +@Immutable +public class ReplicationProviderSpecificContainerCreationInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ReplicationProviderSpecificContainerCreationInput.class); + + /** + * 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 0000000000000..e5fd1f4f9eec9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificContainerMappingInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ReplicationProviderSpecificContainerMappingInput.class); + + /** + * 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 0000000000000..b4dcb1cb2c7b2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificSettings.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.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 = "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 = "InMageRcm", value = InMageRcmReplicationDetails.class), + @JsonSubTypes.Type(name = "InMage", value = InMageReplicationDetails.class) +}) +@Immutable +public class ReplicationProviderSpecificSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationProviderSpecificSettings.class); + + /** + * 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 0000000000000..2461f9a6bab4a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationProviderSpecificUpdateContainerMappingInput.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.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)}) +@Immutable +public class ReplicationProviderSpecificUpdateContainerMappingInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ReplicationProviderSpecificUpdateContainerMappingInput.class); + + /** + * 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 0000000000000..6c1a515dda7b8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryPlans.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights 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 { + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String recoveryPlanName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * The operation to commit the fail over 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); + + /** + * The operation to commit the fail over 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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); + + /** + * 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 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); + + /** + * 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 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); + + /** + * 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 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); + + /** + * The operation to start 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 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 unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input); + + /** + * The operation to start 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 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 unplannedFailover( + String resourceName, + String resourceGroupName, + String recoveryPlanName, + RecoveryPlanUnplannedFailoverInput input, + Context context); + + /** + * 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. + */ + RecoveryPlan getById(String id); + + /** + * 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. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * 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); + + /** + * 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 0000000000000..8bff62d6e0df6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationRecoveryServicesProviders.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationRecoveryServicesProviders. */ +public interface ReplicationRecoveryServicesProviders { + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String providerName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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. + */ + RecoveryServicesProvider getById(String id); + + /** + * 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. + */ + 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 0000000000000..cb4deb41ec127 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassificationMappings.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationStorageClassificationMappings. */ +public interface ReplicationStorageClassificationMappings { + /** + * 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. + */ + PagedIterable listByReplicationStorageClassifications( + String resourceName, String resourceGroupName, String fabricName, String storageClassificationName); + + /** + * 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. + */ + PagedIterable listByReplicationStorageClassifications( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + String storageClassificationMappingName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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. + */ + StorageClassificationMapping getById(String id); + + /** + * 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. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * 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); + + /** + * 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 0000000000000..bf27a8573bdb8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationStorageClassifications.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 { + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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 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. + */ + Response getWithResponse( + String resourceName, + String resourceGroupName, + String fabricName, + String storageClassificationName, + Context context); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + 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 0000000000000..e95fe8276fa76 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultHealths.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.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationVaultHealths. */ +public interface ReplicationVaultHealths { + /** + * 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); + + /** + * 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. + */ + Response getWithResponse(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. + */ + 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 0000000000000..cc03a0a2fdb48 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationVaultSettings.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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. 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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. 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. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String vaultSettingName, Context context); + + /** + * 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. + */ + VaultSetting getById(String id); + + /** + * 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. + */ + 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 0000000000000..244916bb5aec9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReplicationvCenters.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights 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 { + /** + * 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. + */ + PagedIterable listByReplicationFabrics(String resourceName, String resourceGroupName, String fabricName); + + /** + * 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. + */ + PagedIterable listByReplicationFabrics( + String resourceName, String resourceGroupName, String fabricName, Context context); + + /** + * 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceName, String resourceGroupName, String fabricName, String vCenterName, Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName); + + /** + * 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. + */ + PagedIterable list(String resourceName, String resourceGroupName, Context context); + + /** + * 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. + */ + VCenter getById(String id); + + /** + * 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. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * 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); + + /** + * 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 0000000000000..08e2ead335448 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReprotectAgentDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Reprotect agent details. */ +@Immutable +public final class ReprotectAgentDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReprotectAgentDetails.class); + + /* + * 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 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; + + /** + * 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 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; + } + + /** + * 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 0000000000000..5d66e2bfe29ad --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resolve health errors input properties. */ +@Fluent +public final class ResolveHealthError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResolveHealthError.class); + + /* + * Health error id. + */ + @JsonProperty(value = "healthErrorId") + private String healthErrorId; + + /** + * 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 0000000000000..5fcdeaec509c1 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resolve health input. */ +@Fluent +public final class ResolveHealthInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResolveHealthInput.class); + + /* + * Disable resolve health input properties. + */ + @JsonProperty(value = "properties") + private ResolveHealthInputProperties properties; + + /** + * 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 0000000000000..e3b7024cdc499 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Resolve health input properties. */ +@Fluent +public final class ResolveHealthInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResolveHealthInputProperties.class); + + /* + * Health errors. + */ + @JsonProperty(value = "healthErrors") + private List healthErrors; + + /** + * 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 0000000000000..5d1c75f1a8047 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResourceHealthSummary.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Base class to define the health summary of the resources contained under an Arm resource. */ +@Fluent +public final class ResourceHealthSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceHealthSummary.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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 0000000000000..0dfb4bba343f4 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resume job params. */ +@Fluent +public final class ResumeJobParams { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResumeJobParams.class); + + /* + * Resume job properties. + */ + @JsonProperty(value = "properties") + private ResumeJobParamsProperties properties; + + /** + * 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 0000000000000..47b8407da63ee --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resume job properties. */ +@Fluent +public final class ResumeJobParamsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResumeJobParamsProperties.class); + + /* + * Resume job comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /** + * 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/ResyncState.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncState.java new file mode 100644 index 0000000000000..773bf578d0ff0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ResyncState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResyncState. */ +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); + } + + /** @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 0000000000000..81b4b4d96181f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The retention details of the MT. */ +@Fluent +public final class RetentionVolume { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionVolume.class); + + /* + * 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; + + /** + * 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 0000000000000..e2684876a0614 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reverse replication input. */ +@Fluent +public final class ReverseReplicationInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReverseReplicationInput.class); + + /* + * Reverse replication properties + */ + @JsonProperty(value = "properties") + private ReverseReplicationInputProperties properties; + + /** + * 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 0000000000000..77af13a626f47 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reverse replication input properties. */ +@Fluent +public final class ReverseReplicationInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReverseReplicationInputProperties.class); + + /* + * Failover direction. + */ + @JsonProperty(value = "failoverDirection") + private String failoverDirection; + + /* + * Provider specific reverse replication input. + */ + @JsonProperty(value = "providerSpecificDetails") + private ReverseReplicationProviderSpecificInput providerSpecificDetails; + + /** + * 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 0000000000000..a5526fa97392a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ReverseReplicationProviderSpecificInput.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = "InMage", value = InMageReprotectInput.class) +}) +@Immutable +public class ReverseReplicationProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReverseReplicationProviderSpecificInput.class); + + /** + * 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 0000000000000..44a3d8351fa56 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/RpInMageRecoveryPointType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RpInMageRecoveryPointType. */ +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); + } + + /** @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 0000000000000..538dd2ea98c08 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** CS Accounts Details. */ +@Fluent +public final class RunAsAccount { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunAsAccount.class); + + /* + * The CS RunAs account Id. + */ + @JsonProperty(value = "accountId") + private String accountId; + + /* + * The CS RunAs account name. + */ + @JsonProperty(value = "accountName") + private String accountName; + + /** + * 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/SanEnableProtectionInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SanEnableProtectionInput.java new file mode 100644 index 0000000000000..4c0d71d297adf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SanEnableProtectionInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** San enable protection provider specific input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("San") +@Immutable +public final class SanEnableProtectionInput extends EnableProtectionProviderSpecificInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SanEnableProtectionInput.class); + + /** + * 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/ScriptActionTaskDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/ScriptActionTaskDetails.java new file mode 100644 index 0000000000000..702a045694002 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptActionTaskDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..e54f4d9f42e4f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ASR error model. */ +@Fluent +public final class ServiceError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceError.class); + + /* + * 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; + + /** + * 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 0000000000000..5048b34a6b3f5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SetMultiVmSyncStatus.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SetMultiVmSyncStatus. */ +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); + } + + /** @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 0000000000000..bd9f82f0e2e81 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/Severity.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; + +/** Defines values for Severity. */ +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); + } + + /** @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 0000000000000..ebd18ba099457 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SourceSiteOperations.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SourceSiteOperations. */ +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); + } + + /** @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/StorageAccountCustomDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/StorageAccountCustomDetails.java new file mode 100644 index 0000000000000..d7f79788ed0c4 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountCustomDetails.class); + + /** + * 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 0000000000000..5a39d816f41f2 --- /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 0000000000000..f68634fa50c56 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of storage details. */ +@Fluent +public final class StorageClassificationCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageClassificationCollection.class); + + /* + * The storage details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..ff4b9ac2b8a7f --- /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 0000000000000..c04d0bb265686 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.StorageClassificationMappingInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of storage mapping details. */ +@Fluent +public final class StorageClassificationMappingCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageClassificationMappingCollection.class); + + /* + * The storage details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..046dc6734d9a3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage mapping input. */ +@Fluent +public final class StorageClassificationMappingInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageClassificationMappingInput.class); + + /* + * Storage mapping input properties. + */ + @JsonProperty(value = "properties") + private StorageMappingInputProperties properties; + + /** + * 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 0000000000000..b65cb71f07142 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage mapping properties. */ +@Fluent +public final class StorageClassificationMappingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageClassificationMappingProperties.class); + + /* + * Target storage object Id. + */ + @JsonProperty(value = "targetStorageClassificationId") + private String targetStorageClassificationId; + + /** + * 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 0000000000000..429928c4993b8 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage object properties. */ +@Fluent +public final class StorageClassificationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageClassificationProperties.class); + + /* + * Friendly name of the Storage classification. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * 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 0000000000000..10f5ccafc5a40 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage mapping input properties. */ +@Fluent +public final class StorageMappingInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageMappingInputProperties.class); + + /* + * The ID of the storage object. + */ + @JsonProperty(value = "targetStorageClassificationId") + private String targetStorageClassificationId; + + /** + * 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 0000000000000..9c4b30cc65039 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnets of the network. */ +@Fluent +public final class Subnet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Subnet.class); + + /* + * 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; + + /** + * 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 0000000000000..731dc6bf99403 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Supported Operating system details. */ +@Fluent +public final class SupportedOSDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedOSDetails.class); + + /* + * The name. + */ + @JsonProperty(value = "osName") + private String osName; + + /* + * The type. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * List of version for OS. + */ + @JsonProperty(value = "osVersions") + private List osVersions; + + /** + * 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: List of version for OS. + * + * @return the osVersions value. + */ + public List osVersions() { + return this.osVersions; + } + + /** + * Set the osVersions property: List of version for OS. + * + * @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 0000000000000..073ccad2ecb32 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties model for supported OS API. */ +@Fluent +public final class SupportedOSProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedOSProperties.class); + + /* + * The supported OS List. + */ + @JsonProperty(value = "supportedOsList") + private List supportedOsList; + + /** + * Get the supportedOsList property: The supported OS List. + * + * @return the supportedOsList value. + */ + public List supportedOsList() { + return this.supportedOsList; + } + + /** + * Set the supportedOsList property: The supported OS 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 0000000000000..3be040226ce32 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOSProperty.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Property object for supported OS api. */ +@Fluent +public final class SupportedOSProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedOSProperty.class); + + /* + * Gets the replication provider type. + */ + @JsonProperty(value = "instanceType", access = JsonProperty.Access.WRITE_ONLY) + private String instanceType; + + /* + * List of supported OS. + */ + @JsonProperty(value = "supportedOs") + private List supportedOs; + + /** + * Get the instanceType property: Gets the replication provider type. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Get the supportedOs property: List of supported OS. + * + * @return the supportedOs value. + */ + public List supportedOs() { + return this.supportedOs; + } + + /** + * Set the supportedOs property: List of supported OS. + * + * @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 0000000000000..ee7b89ffb708e --- /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: Properties model for supported OS API. + * + * @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 0000000000000..b067938381b54 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/SupportedOperatingSystemsOperations.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.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SupportedOperatingSystemsOperations. */ +public interface SupportedOperatingSystemsOperations { + /** + * Gets the data of supported OSes 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 OSes by SRS. + */ + SupportedOperatingSystems get(String resourceName, String resourceGroupName); + + /** + * Gets the data of supported OSes 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 OSes by SRS. + */ + Response getWithResponse(String resourceName, String resourceGroupName, Context context); +} 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 0000000000000..880e60f7df23d --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Switch protection input. */ +@Fluent +public final class SwitchProtectionInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SwitchProtectionInput.class); + + /* + * Switch protection properties + */ + @JsonProperty(value = "properties") + private SwitchProtectionInputProperties properties; + + /** + * 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 0000000000000..3843fb98a7a40 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Switch protection input properties. */ +@Fluent +public final class SwitchProtectionInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SwitchProtectionInputProperties.class); + + /* + * The unique replication protected item name. + */ + @JsonProperty(value = "replicationProtectedItemName") + private String replicationProtectedItemName; + + /* + * Provider specific switch protection input. + */ + @JsonProperty(value = "providerSpecificDetails") + private SwitchProtectionProviderSpecificInput providerSpecificDetails; + + /** + * 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 0000000000000..bc58d9121c751 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SwitchProtectionJobDetails.class); + + /* + * ARM Id of the new replication protected item. + */ + @JsonProperty(value = "newReplicationProtectedItemId") + private String newReplicationProtectedItemId; + + /** + * 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 0000000000000..5bb70065468c2 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SwitchProtectionProviderSpecificInput.class); + + /** + * 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 0000000000000..3409ae9ac67b2 --- /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 0000000000000..2943069a3049b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.TargetComputeSizeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Target compute size collection. */ +@Fluent +public final class TargetComputeSizeCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetComputeSizeCollection.class); + + /* + * The list of target compute sizes. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..76bf52105e1de --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizeProperties.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents applicable recovery vm sizes properties. */ +@Fluent +public final class TargetComputeSizeProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetComputeSizeProperties.class); + + /* + * 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", access = JsonProperty.Access.WRITE_ONLY) + private List hyperVGenerations; + + /** + * 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; + } + + /** + * 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 0000000000000..1645a5862bad6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TargetComputeSizes.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.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of TargetComputeSizes. */ +public interface TargetComputeSizes { + /** + * 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. + */ + PagedIterable listByReplicationProtectedItems( + String resourceName, + String resourceGroupName, + String fabricName, + String protectionContainerName, + String replicatedProtectedItemName); + + /** + * 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. + */ + 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 0000000000000..8394201b138ac --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TaskTypeDetails.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.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 = "FabricReplicationGroupTaskDetails", value = FabricReplicationGroupTaskDetails.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 = "VirtualMachineTaskDetails", value = VirtualMachineTaskDetails.class), + @JsonSubTypes.Type(name = "VmNicUpdatesTaskDetails", value = VmNicUpdatesTaskDetails.class) +}) +@Immutable +public class TaskTypeDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskTypeDetails.class); + + /** + * 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 0000000000000..32791317742b2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverCleanupInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for test failover cleanup. */ +@Fluent +public final class TestFailoverCleanupInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestFailoverCleanupInput.class); + + /* + * Test failover cleanup input properties. + */ + @JsonProperty(value = "properties", required = true) + private TestFailoverCleanupInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..4fb5f7608093e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for test failover cleanup input properties. */ +@Fluent +public final class TestFailoverCleanupInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestFailoverCleanupInputProperties.class); + + /* + * Test failover cleanup comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /** + * 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 0000000000000..8857c1b99b1d0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for test failover. */ +@Fluent +public final class TestFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestFailoverInput.class); + + /* + * test failover input properties + */ + @JsonProperty(value = "properties") + private TestFailoverInputProperties properties; + + /** + * 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) { + properties().validate(); + } + } +} 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 0000000000000..f1d0735f47ba6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestFailoverInputProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for test failover input properties. */ +@Fluent +public final class TestFailoverInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestFailoverInputProperties.class); + + /* + * 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; + + /* + * A value indicating whether the test failover cleanup is to be skipped. + */ + @JsonProperty(value = "skipTestFailoverCleanup") + private String skipTestFailoverCleanup; + + /* + * Provider specific settings + */ + @JsonProperty(value = "providerSpecificDetails") + private TestFailoverProviderSpecificInput providerSpecificDetails; + + /** + * 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 skipTestFailoverCleanup property: A value indicating whether the test failover cleanup is to be skipped. + * + * @return the skipTestFailoverCleanup value. + */ + public String skipTestFailoverCleanup() { + return this.skipTestFailoverCleanup; + } + + /** + * Set the skipTestFailoverCleanup property: A value indicating whether the test failover cleanup is to be skipped. + * + * @param skipTestFailoverCleanup the skipTestFailoverCleanup value to set. + * @return the TestFailoverInputProperties object itself. + */ + public TestFailoverInputProperties withSkipTestFailoverCleanup(String skipTestFailoverCleanup) { + this.skipTestFailoverCleanup = skipTestFailoverCleanup; + 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 0000000000000..5b4f14cb820b0 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestFailoverJobDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..d696c16965035 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestFailoverProviderSpecificInput.class); + + /** + * 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 0000000000000..3e5ac503a4e7d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateCleanupInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for test migrate cleanup. */ +@Fluent +public final class TestMigrateCleanupInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestMigrateCleanupInput.class); + + /* + * Test migrate cleanup input properties. + */ + @JsonProperty(value = "properties", required = true) + private TestMigrateCleanupInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..038d3b26fe81f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Test migrate cleanup input properties. */ +@Fluent +public final class TestMigrateCleanupInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestMigrateCleanupInputProperties.class); + + /* + * Test migrate cleanup comments. + */ + @JsonProperty(value = "comments") + private String comments; + + /** + * 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 0000000000000..809719716a540 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for test migrate. */ +@Fluent +public final class TestMigrateInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestMigrateInput.class); + + /* + * Test migrate input properties. + */ + @JsonProperty(value = "properties", required = true) + private TestMigrateInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..e9e527b20d106 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrateInputProperties.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Test migrate input properties. */ +@Fluent +public final class TestMigrateInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestMigrateInputProperties.class); + + /* + * The provider specific details. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private TestMigrateProviderSpecificInput providerSpecificDetails; + + /** + * 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(); + } + } +} 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 0000000000000..6ef5e4ec97cf1 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestMigrateProviderSpecificInput.class); + + /** + * 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 0000000000000..2f5b41b8a4843 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/TestMigrationState.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; + +/** Defines values for TestMigrationState. */ +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"); + + /** + * 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); + } + + /** @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 0000000000000..7c88464d015e8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UnplannedFailoverInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for unplanned failover. */ +@Fluent +public final class UnplannedFailoverInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnplannedFailoverInput.class); + + /* + * Unplanned failover input properties. + */ + @JsonProperty(value = "properties") + private UnplannedFailoverInputProperties properties; + + /** + * 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) { + properties().validate(); + } + } +} 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 0000000000000..4edc15ef97578 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input definition for unplanned failover input properties. */ +@Fluent +public final class UnplannedFailoverInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnplannedFailoverInputProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..b0e698322d814 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnplannedFailoverProviderSpecificInput.class); + + /** + * 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/UpdateMigrationItemInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInput.java new file mode 100644 index 0000000000000..0394714bb1e82 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update migration item input. */ +@Fluent +public final class UpdateMigrationItemInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateMigrationItemInput.class); + + /* + * Update migration item input properties. + */ + @JsonProperty(value = "properties") + private UpdateMigrationItemInputProperties properties; + + /** + * 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 0000000000000..76a268aba4264 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateMigrationItemInputProperties.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update migration item input properties. */ +@Fluent +public final class UpdateMigrationItemInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateMigrationItemInputProperties.class); + + /* + * The provider specific input to update migration item. + */ + @JsonProperty(value = "providerSpecificDetails", required = true) + private UpdateMigrationItemProviderSpecificInput providerSpecificDetails; + + /** + * 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(); + } + } +} 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 0000000000000..9a12a93c693c8 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateMigrationItemProviderSpecificInput.class); + + /** + * 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 0000000000000..22d3e4ed9fb87 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to update the mobility service on a protected item. */ +@Fluent +public final class UpdateMobilityServiceRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateMobilityServiceRequest.class); + + /* + * The properties of the update mobility service request. + */ + @JsonProperty(value = "properties") + private UpdateMobilityServiceRequestProperties properties; + + /** + * 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 0000000000000..9b2d4838cec3f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an update mobility service request. */ +@Fluent +public final class UpdateMobilityServiceRequestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateMobilityServiceRequestProperties.class); + + /* + * The CS run as account Id. + */ + @JsonProperty(value = "runAsAccountId") + private String runAsAccountId; + + /** + * 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 0000000000000..b248d71e30930 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update network mapping input. */ +@Fluent +public final class UpdateNetworkMappingInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateNetworkMappingInput.class); + + /* + * The input properties needed to update network mapping. + */ + @JsonProperty(value = "properties") + private UpdateNetworkMappingInputProperties properties; + + /** + * 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 0000000000000..c2b61460c3cb3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common input details for network mapping operation. */ +@Fluent +public final class UpdateNetworkMappingInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateNetworkMappingInputProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..f44d1de1709ee --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update policy input. */ +@Fluent +public final class UpdatePolicyInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdatePolicyInput.class); + + /* + * The ReplicationProviderSettings. + */ + @JsonProperty(value = "properties") + private UpdatePolicyInputProperties properties; + + /** + * 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 0000000000000..7cb0ce74fd8f2 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Policy update properties. */ +@Fluent +public final class UpdatePolicyInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdatePolicyInputProperties.class); + + /* + * The ReplicationProviderSettings. + */ + @JsonProperty(value = "replicationProviderSettings") + private PolicyProviderSpecificInput replicationProviderSettings; + + /** + * 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 0000000000000..cea634f197e1e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container pairing update input. */ +@Fluent +public final class UpdateProtectionContainerMappingInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateProtectionContainerMappingInput.class); + + /* + * Update protection container mapping input properties. + */ + @JsonProperty(value = "properties") + private UpdateProtectionContainerMappingInputProperties properties; + + /** + * 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 0000000000000..975a2ff8f8f17 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateProtectionContainerMappingInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container pairing update input. */ +@Fluent +public final class UpdateProtectionContainerMappingInputProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(UpdateProtectionContainerMappingInputProperties.class); + + /* + * Provider specific input for updating protection container mapping. + */ + @JsonProperty(value = "providerSpecificInput") + private ReplicationProviderSpecificUpdateContainerMappingInput providerSpecificInput; + + /** + * 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 0000000000000..f89d3fb378ad5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update recovery plan input class. */ +@Fluent +public final class UpdateRecoveryPlanInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateRecoveryPlanInput.class); + + /* + * Recovery plan update properties. + */ + @JsonProperty(value = "properties") + private UpdateRecoveryPlanInputProperties properties; + + /** + * 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 0000000000000..3c682431d155f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery plan update properties. */ +@Fluent +public final class UpdateRecoveryPlanInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateRecoveryPlanInputProperties.class); + + /* + * The recovery plan groups. + */ + @JsonProperty(value = "groups") + private List groups; + + /** + * 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 0000000000000..e551351d9f873 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update replication protected item input. */ +@Fluent +public final class UpdateReplicationProtectedItemInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateReplicationProtectedItemInput.class); + + /* + * Update replication protected item properties. + */ + @JsonProperty(value = "properties") + private UpdateReplicationProtectedItemInputProperties properties; + + /** + * 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 0000000000000..855791ec0c2fe --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/UpdateReplicationProtectedItemInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Update protected item input properties. */ +@Fluent +public final class UpdateReplicationProtectedItemInputProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(UpdateReplicationProtectedItemInputProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..ed9479585f1e3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateReplicationProtectedItemProviderInput.class); + + /** + * 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 0000000000000..5244a93450436 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input required to update vCenter. */ +@Fluent +public final class UpdateVCenterRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateVCenterRequest.class); + + /* + * The update VCenter Request Properties. + */ + @JsonProperty(value = "properties") + private UpdateVCenterRequestProperties properties; + + /** + * 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 0000000000000..4dda8a61f6b6b --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an update vCenter request. */ +@Fluent +public final class UpdateVCenterRequestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateVCenterRequestProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..bac1c1d557144 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VCenter.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.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 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 0000000000000..89d1e37f6939e --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VCenterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of vCenter details. */ +@Fluent +public final class VCenterCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VCenterCollection.class); + + /* + * The vCenter details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..be96bf5162de6 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** vCenter properties. */ +@Fluent +public final class VCenterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VCenterProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..a8cd0cbf24387 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicDetails.java @@ -0,0 +1,745 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Hyper V VM network details. */ +@Fluent +public final class VMNicDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMNicDetails.class); + + /* + * 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 subnet name. + */ + @JsonProperty(value = "vMSubnetName") + private String vMSubnetName; + + /* + * VM network name. + */ + @JsonProperty(value = "vMNetworkName") + private String vMNetworkName; + + /* + * Recovery VM network Id. + */ + @JsonProperty(value = "recoveryVMNetworkId") + private String recoveryVMNetworkId; + + /* + * Recovery VM subnet name. + */ + @JsonProperty(value = "recoveryVMSubnetName") + private String recoveryVMSubnetName; + + /* + * Ip address type. + */ + @JsonProperty(value = "ipAddressType") + private String ipAddressType; + + /* + * Primary nic static IP address. + */ + @JsonProperty(value = "primaryNicStaticIPAddress") + private String primaryNicStaticIpAddress; + + /* + * Replica nic static IP address. + */ + @JsonProperty(value = "replicaNicStaticIPAddress") + private String replicaNicStaticIpAddress; + + /* + * Selection type for failover. + */ + @JsonProperty(value = "selectionType") + private String selectionType; + + /* + * IP allocation type for recovery VM. + */ + @JsonProperty(value = "recoveryNicIpAddressType") + private String recoveryNicIpAddressType; + + /* + * The id of the public IP address resource associated with the NIC. + */ + @JsonProperty(value = "recoveryPublicIpAddressId") + private String recoveryPublicIpAddressId; + + /* + * The id of the NSG associated with the NIC. + */ + @JsonProperty(value = "recoveryNetworkSecurityGroupId") + private String recoveryNetworkSecurityGroupId; + + /* + * The target backend address pools for the NIC. + */ + @JsonProperty(value = "recoveryLBBackendAddressPoolIds") + private List recoveryLBBackendAddressPoolIds; + + /* + * 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 subnet to be used by NIC during test failover. + */ + @JsonProperty(value = "tfoVMSubnetName") + private String tfoVMSubnetName; + + /* + * The NSG to be used by NIC during test failover. + */ + @JsonProperty(value = "tfoNetworkSecurityGroupId") + private String tfoNetworkSecurityGroupId; + + /* + * Whether the test failover NIC has accelerated networking enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworkingOnTfo") + private Boolean enableAcceleratedNetworkingOnTfo; + + /* + * The IP configurations to be used by NIC during test failover. + */ + @JsonProperty(value = "tfoIPConfigs") + private List tfoIpConfigs; + + /* + * 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; + + /** + * 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 vMSubnetName property: VM subnet name. + * + * @return the vMSubnetName value. + */ + public String vMSubnetName() { + return this.vMSubnetName; + } + + /** + * Set the vMSubnetName property: VM subnet name. + * + * @param vMSubnetName the vMSubnetName value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withVMSubnetName(String vMSubnetName) { + this.vMSubnetName = vMSubnetName; + 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 recoveryVMSubnetName property: Recovery VM subnet name. + * + * @return the recoveryVMSubnetName value. + */ + public String recoveryVMSubnetName() { + return this.recoveryVMSubnetName; + } + + /** + * Set the recoveryVMSubnetName property: Recovery VM subnet name. + * + * @param recoveryVMSubnetName the recoveryVMSubnetName value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withRecoveryVMSubnetName(String recoveryVMSubnetName) { + this.recoveryVMSubnetName = recoveryVMSubnetName; + return this; + } + + /** + * Get the ipAddressType property: Ip address type. + * + * @return the ipAddressType value. + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Set the ipAddressType property: Ip address type. + * + * @param ipAddressType the ipAddressType value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withIpAddressType(String ipAddressType) { + this.ipAddressType = ipAddressType; + return this; + } + + /** + * Get the primaryNicStaticIpAddress property: Primary nic static IP address. + * + * @return the primaryNicStaticIpAddress value. + */ + public String primaryNicStaticIpAddress() { + return this.primaryNicStaticIpAddress; + } + + /** + * Set the primaryNicStaticIpAddress property: Primary nic static IP address. + * + * @param primaryNicStaticIpAddress the primaryNicStaticIpAddress value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withPrimaryNicStaticIpAddress(String primaryNicStaticIpAddress) { + this.primaryNicStaticIpAddress = primaryNicStaticIpAddress; + return this; + } + + /** + * Get the replicaNicStaticIpAddress property: Replica nic static IP address. + * + * @return the replicaNicStaticIpAddress value. + */ + public String replicaNicStaticIpAddress() { + return this.replicaNicStaticIpAddress; + } + + /** + * Set the replicaNicStaticIpAddress property: Replica nic static IP address. + * + * @param replicaNicStaticIpAddress the replicaNicStaticIpAddress value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withReplicaNicStaticIpAddress(String replicaNicStaticIpAddress) { + this.replicaNicStaticIpAddress = replicaNicStaticIpAddress; + 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 recoveryNicIpAddressType property: IP allocation type for recovery VM. + * + * @return the recoveryNicIpAddressType value. + */ + public String recoveryNicIpAddressType() { + return this.recoveryNicIpAddressType; + } + + /** + * Set the recoveryNicIpAddressType property: IP allocation type for recovery VM. + * + * @param recoveryNicIpAddressType the recoveryNicIpAddressType value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withRecoveryNicIpAddressType(String recoveryNicIpAddressType) { + this.recoveryNicIpAddressType = recoveryNicIpAddressType; + return this; + } + + /** + * Get the recoveryPublicIpAddressId property: The id of the public IP address resource associated with the NIC. + * + * @return the recoveryPublicIpAddressId value. + */ + public String recoveryPublicIpAddressId() { + return this.recoveryPublicIpAddressId; + } + + /** + * Set the recoveryPublicIpAddressId property: The id of the public IP address resource associated with the NIC. + * + * @param recoveryPublicIpAddressId the recoveryPublicIpAddressId value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withRecoveryPublicIpAddressId(String recoveryPublicIpAddressId) { + this.recoveryPublicIpAddressId = recoveryPublicIpAddressId; + 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 recoveryLBBackendAddressPoolIds property: The target backend address pools for the NIC. + * + * @return the recoveryLBBackendAddressPoolIds value. + */ + public List recoveryLBBackendAddressPoolIds() { + return this.recoveryLBBackendAddressPoolIds; + } + + /** + * Set the recoveryLBBackendAddressPoolIds property: The target backend address pools for the NIC. + * + * @param recoveryLBBackendAddressPoolIds the recoveryLBBackendAddressPoolIds value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withRecoveryLBBackendAddressPoolIds(List recoveryLBBackendAddressPoolIds) { + this.recoveryLBBackendAddressPoolIds = recoveryLBBackendAddressPoolIds; + 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 tfoVMSubnetName property: The subnet to be used by NIC during test failover. + * + * @return the tfoVMSubnetName value. + */ + public String tfoVMSubnetName() { + return this.tfoVMSubnetName; + } + + /** + * Set the tfoVMSubnetName property: The subnet to be used by NIC during test failover. + * + * @param tfoVMSubnetName the tfoVMSubnetName value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withTfoVMSubnetName(String tfoVMSubnetName) { + this.tfoVMSubnetName = tfoVMSubnetName; + 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 test failover NIC has accelerated networking + * enabled. + * + * @return the enableAcceleratedNetworkingOnTfo value. + */ + public Boolean enableAcceleratedNetworkingOnTfo() { + return this.enableAcceleratedNetworkingOnTfo; + } + + /** + * Set the enableAcceleratedNetworkingOnTfo property: Whether the test failover 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 tfoIpConfigs property: The IP configurations to be used by NIC during test failover. + * + * @return the tfoIpConfigs value. + */ + public List tfoIpConfigs() { + return this.tfoIpConfigs; + } + + /** + * Set the tfoIpConfigs property: The IP configurations to be used by NIC during test failover. + * + * @param tfoIpConfigs the tfoIpConfigs value to set. + * @return the VMNicDetails object itself. + */ + public VMNicDetails withTfoIpConfigs(List tfoIpConfigs) { + this.tfoIpConfigs = tfoIpConfigs; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tfoIpConfigs() != null) { + tfoIpConfigs().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 0000000000000..f12fcdace7766 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMNicInputDetails.java @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Hyper V VM network input details. */ +@Fluent +public final class VMNicInputDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMNicInputDetails.class); + + /* + * The nic Id. + */ + @JsonProperty(value = "nicId") + private String nicId; + + /* + * Recovery VM subnet name. + */ + @JsonProperty(value = "recoveryVMSubnetName") + private String recoveryVMSubnetName; + + /* + * Replica nic static IP address. + */ + @JsonProperty(value = "replicaNicStaticIPAddress") + private String replicaNicStaticIpAddress; + + /* + * Selection type for failover. + */ + @JsonProperty(value = "selectionType") + private String selectionType; + + /* + * The id of the public IP address resource associated with the NIC. + */ + @JsonProperty(value = "recoveryPublicIpAddressId") + private String recoveryPublicIpAddressId; + + /* + * The id of the NSG associated with the NIC. + */ + @JsonProperty(value = "recoveryNetworkSecurityGroupId") + private String recoveryNetworkSecurityGroupId; + + /* + * The target backend address pools for the NIC. + */ + @JsonProperty(value = "recoveryLBBackendAddressPoolIds") + private List recoveryLBBackendAddressPoolIds; + + /* + * Whether the NIC has accelerated networking enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworkingOnRecovery") + private Boolean enableAcceleratedNetworkingOnRecovery; + + /* + * The subnet to be used by NIC during test failover. + */ + @JsonProperty(value = "tfoVMSubnetName") + private String tfoVMSubnetName; + + /* + * 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 IP configurations to be used by NIC during test failover. + */ + @JsonProperty(value = "tfoIPConfigs") + private List tfoIpConfigs; + + /* + * 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; + + /** + * 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 recoveryVMSubnetName property: Recovery VM subnet name. + * + * @return the recoveryVMSubnetName value. + */ + public String recoveryVMSubnetName() { + return this.recoveryVMSubnetName; + } + + /** + * Set the recoveryVMSubnetName property: Recovery VM subnet name. + * + * @param recoveryVMSubnetName the recoveryVMSubnetName value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withRecoveryVMSubnetName(String recoveryVMSubnetName) { + this.recoveryVMSubnetName = recoveryVMSubnetName; + return this; + } + + /** + * Get the replicaNicStaticIpAddress property: Replica nic static IP address. + * + * @return the replicaNicStaticIpAddress value. + */ + public String replicaNicStaticIpAddress() { + return this.replicaNicStaticIpAddress; + } + + /** + * Set the replicaNicStaticIpAddress property: Replica nic static IP address. + * + * @param replicaNicStaticIpAddress the replicaNicStaticIpAddress value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withReplicaNicStaticIpAddress(String replicaNicStaticIpAddress) { + this.replicaNicStaticIpAddress = replicaNicStaticIpAddress; + 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 recoveryPublicIpAddressId property: The id of the public IP address resource associated with the NIC. + * + * @return the recoveryPublicIpAddressId value. + */ + public String recoveryPublicIpAddressId() { + return this.recoveryPublicIpAddressId; + } + + /** + * Set the recoveryPublicIpAddressId property: The id of the public IP address resource associated with the NIC. + * + * @param recoveryPublicIpAddressId the recoveryPublicIpAddressId value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withRecoveryPublicIpAddressId(String recoveryPublicIpAddressId) { + this.recoveryPublicIpAddressId = recoveryPublicIpAddressId; + 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 recoveryLBBackendAddressPoolIds property: The target backend address pools for the NIC. + * + * @return the recoveryLBBackendAddressPoolIds value. + */ + public List recoveryLBBackendAddressPoolIds() { + return this.recoveryLBBackendAddressPoolIds; + } + + /** + * Set the recoveryLBBackendAddressPoolIds property: The target backend address pools for the NIC. + * + * @param recoveryLBBackendAddressPoolIds the recoveryLBBackendAddressPoolIds value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withRecoveryLBBackendAddressPoolIds(List recoveryLBBackendAddressPoolIds) { + this.recoveryLBBackendAddressPoolIds = recoveryLBBackendAddressPoolIds; + 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 tfoVMSubnetName property: The subnet to be used by NIC during test failover. + * + * @return the tfoVMSubnetName value. + */ + public String tfoVMSubnetName() { + return this.tfoVMSubnetName; + } + + /** + * Set the tfoVMSubnetName property: The subnet to be used by NIC during test failover. + * + * @param tfoVMSubnetName the tfoVMSubnetName value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withTfoVMSubnetName(String tfoVMSubnetName) { + this.tfoVMSubnetName = tfoVMSubnetName; + 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 tfoIpConfigs property: The IP configurations to be used by NIC during test failover. + * + * @return the tfoIpConfigs value. + */ + public List tfoIpConfigs() { + return this.tfoIpConfigs; + } + + /** + * Set the tfoIpConfigs property: The IP configurations to be used by NIC during test failover. + * + * @param tfoIpConfigs the tfoIpConfigs value to set. + * @return the VMNicInputDetails object itself. + */ + public VMNicInputDetails withTfoIpConfigs(List tfoIpConfigs) { + this.tfoIpConfigs = tfoIpConfigs; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tfoIpConfigs() != null) { + tfoIpConfigs().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 0000000000000..0fcc9888ab9ff --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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("6c7da455-506f-43ff-a16a-8eb101aebb70") +@Immutable +public final class VMwareCbtContainerCreationInput extends ReplicationProviderSpecificContainerCreationInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtContainerCreationInput.class); + + /** + * 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 0000000000000..c97b95ec2669a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtContainerMappingInput.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtContainerMappingInput.class); + + /* + * The target key vault ARM Id. + */ + @JsonProperty(value = "keyVaultId", required = true) + private String keyVaultId; + + /* + * The target key vault URL. + */ + @JsonProperty(value = "keyVaultUri", required = true) + 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", required = true) + private String storageAccountSasSecretName; + + /* + * The secret name of the service bus connection string. + */ + @JsonProperty(value = "serviceBusConnectionStringSecretName", required = true) + private String serviceBusConnectionStringSecretName; + + /* + * The target location. + */ + @JsonProperty(value = "targetLocation", required = true) + private String targetLocation; + + /** + * 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 (keyVaultId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultId in model VMwareCbtContainerMappingInput")); + } + if (keyVaultUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultUri in model VMwareCbtContainerMappingInput")); + } + if (storageAccountId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageAccountId in model VMwareCbtContainerMappingInput")); + } + if (storageAccountSasSecretName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageAccountSasSecretName in model" + + " VMwareCbtContainerMappingInput")); + } + if (serviceBusConnectionStringSecretName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceBusConnectionStringSecretName in model" + + " VMwareCbtContainerMappingInput")); + } + if (targetLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetLocation in model VMwareCbtContainerMappingInput")); + } + } +} 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 0000000000000..112972be0cde0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtDiskInput.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareCbt disk input. */ +@Fluent +public final class VMwareCbtDiskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtDiskInput.class); + + /* + * The disk Id. + */ + @JsonProperty(value = "diskId", required = true) + private String diskId; + + /* + * 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 disk type. + */ + @JsonProperty(value = "diskType") + private DiskAccountType diskType; + + /** + * 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 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 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; + } + + /** + * 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")); + } + } +} 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 0000000000000..5c6348b6b6949 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtEnableMigrationInput.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtEnableMigrationInput.class); + + /* + * 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 data mover RunAs account Id. + */ + @JsonProperty(value = "dataMoverRunAsAccountId", required = true) + private String dataMoverRunAsAccountId; + + /* + * The snapshot RunAs 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 target subnet name. + */ + @JsonProperty(value = "targetSubnetName") + private String targetSubnetName; + + /* + * The target availability set ARM Id. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /* + * The target boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId") + private String targetBootDiagnosticsStorageAccountId; + + /** + * 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 dataMoverRunAsAccountId property: The data mover RunAs account Id. + * + * @return the dataMoverRunAsAccountId value. + */ + public String dataMoverRunAsAccountId() { + return this.dataMoverRunAsAccountId; + } + + /** + * Set the dataMoverRunAsAccountId property: The data mover RunAs 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 RunAs account Id. + * + * @return the snapshotRunAsAccountId value. + */ + public String snapshotRunAsAccountId() { + return this.snapshotRunAsAccountId; + } + + /** + * Set the snapshotRunAsAccountId property: The snapshot RunAs 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 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 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 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; + } + + /** + * 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")); + } + } +} 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 0000000000000..dfd4a0bcbdbca --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrateInput.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtMigrateInput.class); + + /* + * A value indicating whether VM is to be shutdown. + */ + @JsonProperty(value = "performShutdown", required = true) + private String performShutdown; + + /** + * 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")); + } + } +} 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 0000000000000..21693e2ea2811 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtMigrationDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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; + +/** VMwareCbt provider specific settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareCbt") +@Fluent +public final class VMwareCbtMigrationDetails extends MigrationProviderSpecificSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtMigrationDetails.class); + + /* + * 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; + + /* + * License Type of the VM to be used. + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * The data mover RunAs account Id. + */ + @JsonProperty(value = "dataMoverRunAsAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String dataMoverRunAsAccountId; + + /* + * The snapshot RunAs account Id. + */ + @JsonProperty(value = "snapshotRunAsAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String snapshotRunAsAccountId; + + /* + * 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 boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId") + private String targetBootDiagnosticsStorageAccountId; + + /* + * The list of protected disks. + */ + @JsonProperty(value = "protectedDisks") + private List protectedDisks; + + /* + * The target network Id. + */ + @JsonProperty(value = "targetNetworkId") + private String targetNetworkId; + + /* + * The network details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * 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; + + /** + * 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 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 dataMoverRunAsAccountId property: The data mover RunAs account Id. + * + * @return the dataMoverRunAsAccountId value. + */ + public String dataMoverRunAsAccountId() { + return this.dataMoverRunAsAccountId; + } + + /** + * Get the snapshotRunAsAccountId property: The snapshot RunAs account Id. + * + * @return the snapshotRunAsAccountId value. + */ + public String snapshotRunAsAccountId() { + return this.snapshotRunAsAccountId; + } + + /** + * 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 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 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 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 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; + } + + /** + * 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 0000000000000..642b8a8cc22e3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareCbt NIC details. */ +@Fluent +public final class VMwareCbtNicDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtNicDetails.class); + + /* + * 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; + + /* + * A value indicating whether this NIC is selected for migration. + */ + @JsonProperty(value = "isSelectedForMigration") + private String isSelectedForMigration; + + /** + * 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 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 0000000000000..9a5f8a16e21c6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtNicInput.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareCbt NIC input. */ +@Fluent +public final class VMwareCbtNicInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtNicInput.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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")); + } + } +} 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 0000000000000..d90176d9d34d2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtPolicyCreationInput.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtPolicyCreationInput.class); + + /* + * 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; + + /** + * 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 0000000000000..29167345f161c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectedDiskDetails.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareCbt protected disk details. */ +@Fluent +public final class VMwareCbtProtectedDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtProtectedDiskDetails.class); + + /* + * 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 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 ARM Id of the seed managed disk. + */ + @JsonProperty(value = "seedManagedDiskId", access = JsonProperty.Access.WRITE_ONLY) + private String seedManagedDiskId; + + /* + * 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 DiskType diskType; + + /** + * 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 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 seedManagedDiskId property: The ARM Id of the seed managed disk. + * + * @return the seedManagedDiskId value. + */ + public String seedManagedDiskId() { + return this.seedManagedDiskId; + } + + /** + * 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 DiskType 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(DiskType diskType) { + this.diskType = diskType; + 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 0000000000000..6e34bae0aa21e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtProtectionContainerMappingDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtProtectionContainerMappingDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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/VMwareCbtTestMigrateInput.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtTestMigrateInput.java new file mode 100644 index 0000000000000..bd3bb4731b6a2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtTestMigrateInput.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtTestMigrateInput.class); + + /* + * The recovery point Id. + */ + @JsonProperty(value = "recoveryPointId", required = true) + private String recoveryPointId; + + /* + * The test network Id. + */ + @JsonProperty(value = "networkId", required = true) + private String networkId; + + /** + * 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; + } + + /** + * 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")); + } + } +} 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 0000000000000..99e51234bc6f4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareCbtUpdateMigrationItemInput.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicessiterecovery.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareCbtUpdateMigrationItemInput.class); + + /* + * 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 boot diagnostics storage account ARM Id. + */ + @JsonProperty(value = "targetBootDiagnosticsStorageAccountId") + private String targetBootDiagnosticsStorageAccountId; + + /* + * The target network ARM Id. + */ + @JsonProperty(value = "targetNetworkId") + private String targetNetworkId; + + /* + * The list of NIC details. + */ + @JsonProperty(value = "vmNics") + private List vmNics; + + /* + * The license type. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /** + * 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 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 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 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; + } + + /** + * 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/VMwareDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareDetails.java new file mode 100644 index 0000000000000..d50e62d6465a3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareDetails.java @@ -0,0 +1,876 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareDetails.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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(); + } + } +} 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 0000000000000..6e4ad3107a57c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricCreationInput.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareV2FabricCreationInput.class); + + /* + * The ARM Id of the VMware site. + */ + @JsonProperty(value = "vmwareSiteId", required = true) + private String vmwareSiteId; + + /* + * The ARM Id of the migration solution. + */ + @JsonProperty(value = "migrationSolutionId", required = true) + private String migrationSolutionId; + + /** + * 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 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 (vmwareSiteId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmwareSiteId in model VMwareV2FabricCreationInput")); + } + if (migrationSolutionId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property migrationSolutionId in model VMwareV2FabricCreationInput")); + } + } +} 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 0000000000000..66fe1e9acd936 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareV2FabricSpecificDetails.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMwareV2 fabric specific details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareV2") +@Immutable +public final class VMwareV2FabricSpecificDetails extends FabricSpecificDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareV2FabricSpecificDetails.class); + + /* + * The ARM Id of the VMware site. + */ + @JsonProperty(value = "vmwareSiteId", access = JsonProperty.Access.WRITE_ONLY) + private String vmwareSiteId; + + /* + * 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; + + /** + * Get the vmwareSiteId property: The ARM Id of the VMware site. + * + * @return the vmwareSiteId value. + */ + public String vmwareSiteId() { + return this.vmwareSiteId; + } + + /** + * 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; + } + + /** + * 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/VMwareVirtualMachineDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareVirtualMachineDetails.java new file mode 100644 index 0000000000000..91a82da5263d3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VMwareVirtualMachineDetails.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VMwareVirtualMachineDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..8461df2b66860 --- /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 0000000000000..020f9d4275b57 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** class to define the health summary of the Vault. */ +@Fluent +public final class VaultHealthProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultHealthProperties.class); + + /* + * 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; + + /** + * 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 0000000000000..b75b2170c4bff --- /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 0000000000000..64487eab56cb3 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicessiterecovery.fluent.models.VaultSettingInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vault setting collection. */ +@Fluent +public final class VaultSettingCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultSettingCollection.class); + + /* + * The list of vault setting. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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 0000000000000..9a1df86bfd592 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input to create vault setting. */ +@Fluent +public final class VaultSettingCreationInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultSettingCreationInput.class); + + /* + * Vault setting creation input properties. + */ + @JsonProperty(value = "properties", required = true) + private VaultSettingCreationInputProperties properties; + + /** + * 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(); + } + } +} 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 0000000000000..2edb139dba961 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingCreationInputProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input to create vault setting. */ +@Fluent +public final class VaultSettingCreationInputProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultSettingCreationInputProperties.class); + + /* + * The migration solution Id. + */ + @JsonProperty(value = "migrationSolutionId", required = true) + private String migrationSolutionId; + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migrationSolutionId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property migrationSolutionId in model VaultSettingCreationInputProperties")); + } + } +} 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 0000000000000..233ec374e9736 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VaultSettingProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault setting properties. */ +@Fluent +public final class VaultSettingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultSettingProperties.class); + + /* + * The migration solution ARM Id. + */ + @JsonProperty(value = "migrationSolutionId") + private String migrationSolutionId; + + /** + * 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; + } + + /** + * 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 0000000000000..5caf26f1d859c --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Version related details. */ +@Fluent +public final class VersionDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VersionDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..9c2f97c6017c7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VirtualMachineTaskDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 TaskTypeDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineTaskDetails.class); + + /* + * The skipped reason. + */ + @JsonProperty(value = "skippedReason") + private String skippedReason; + + /* + * The skipped reason string. + */ + @JsonProperty(value = "skippedReasonString") + private String skippedReasonString; + + /* + * The job entity. + */ + @JsonProperty(value = "jobTask") + private JobEntity jobTask; + + /** + * 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; + } + + /** + * 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 VirtualMachineTaskDetails object itself. + */ + public VirtualMachineTaskDetails 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/VmEncryptionType.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmEncryptionType.java new file mode 100644 index 0000000000000..1dc37c6735df7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmEncryptionType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VmEncryptionType. */ +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); + } + + /** @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 0000000000000..ec54165d0d4b8 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmNicUpdatesTaskDetails.class); + + /* + * 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; + + /** + * 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/VmmDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmDetails.java new file mode 100644 index 0000000000000..2da815e8de7d2 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmmDetails.class); + + /** + * 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 0000000000000..94b33619e76b9 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmmToAzureCreateNetworkMappingInput.class); + + /** + * 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 0000000000000..267ce15cf991a --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmmToAzureNetworkMappingSettings.class); + + /** + * 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 0000000000000..b2a89d151f32f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmmToAzureUpdateNetworkMappingInput.class); + + /** + * 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 0000000000000..7e8ddbaa5b56e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmmToVmmCreateNetworkMappingInput.class); + + /** + * 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 0000000000000..0c91cbecd2139 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmmToVmmNetworkMappingSettings.class); + + /** + * 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 0000000000000..18e99ba8863f9 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmmToVmmUpdateNetworkMappingInput.class); + + /** + * 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 0000000000000..cb8f6225a0f0d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmmVirtualMachineDetails.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 ConfigurationSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmmVirtualMachineDetails.class); + + /* + * 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; + + /** + * 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 VmmVirtualMachineDetails object itself. + */ + public VmmVirtualMachineDetails 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 VmmVirtualMachineDetails object itself. + */ + public VmmVirtualMachineDetails 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 VmmVirtualMachineDetails object itself. + */ + public VmmVirtualMachineDetails 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 VmmVirtualMachineDetails object itself. + */ + public VmmVirtualMachineDetails 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 VmmVirtualMachineDetails object itself. + */ + public VmmVirtualMachineDetails 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 VmmVirtualMachineDetails object itself. + */ + public VmmVirtualMachineDetails 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 VmmVirtualMachineDetails object itself. + */ + public VmmVirtualMachineDetails withHasSharedVhd(PresenceStatus hasSharedVhd) { + this.hasSharedVhd = hasSharedVhd; + 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/VmwareCbtPolicyDetails.java b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmwareCbtPolicyDetails.java new file mode 100644 index 0000000000000..7045c7367727c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/VmwareCbtPolicyDetails.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmwareCbtPolicyDetails.class); + + /* + * 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; + + /** + * 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 0000000000000..81415c28aea33 --- /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 0000000000000..0b0e18cfe67f9 --- /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 0000000000000..d7afbb4514ed2 --- /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/ci.yml b/sdk/recoveryservicessiterecovery/ci.yml new file mode 100644 index 0000000000000..9d265253b8727 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicessiterecovery/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicessiterecovery/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recoveryservicessiterecovery + Artifacts: + - name: azure-resourcemanager-recoveryservicessiterecovery + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerrecoveryservicessiterecovery diff --git a/sdk/recoveryservicessiterecovery/pom.xml b/sdk/recoveryservicessiterecovery/pom.xml new file mode 100644 index 0000000000000..c9defa4bea50b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-recoveryservicessiterecovery-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-recoveryservicessiterecovery + + + +