From d5f091b120a17bd22d40c065c94b6113ce37709a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 18 Jan 2022 15:21:55 +0000 Subject: [PATCH] CodeGen from PR 17271 in Azure/azure-rest-api-specs Merge e449c7f8b3b173377dd08accac0c625f5c54ef06 into 37b6a9860ec36270081e7dcb8f18eaaf591e67f5 --- ...repareDataMoveOperationResultOperations.cs | 254 +++ ...MoveOperationResultOperationsExtensions.cs | 71 + .../src/Generated/BackupEnginesOperations.cs | 673 +++++++ .../BackupEnginesOperationsExtensions.cs | 178 ++ .../src/Generated/BackupJobsOperations.cs | 445 +++++ .../BackupJobsOperationsExtensions.cs | 114 ++ .../BackupOperationResultsOperations.cs | 245 +++ ...kupOperationResultsOperationsExtensions.cs | 82 + .../BackupOperationStatusesOperations.cs | 265 +++ ...upOperationStatusesOperationsExtensions.cs | 83 + .../src/Generated/BackupPoliciesOperations.cs | 441 +++++ .../BackupPoliciesOperationsExtensions.cs | 116 ++ .../BackupProtectableItemsOperations.cs | 449 +++++ ...kupProtectableItemsOperationsExtensions.cs | 122 ++ .../BackupProtectedItemsOperations.cs | 445 +++++ ...ackupProtectedItemsOperationsExtensions.cs | 114 ++ .../BackupProtectionContainersOperations.cs | 437 +++++ ...rotectionContainersOperationsExtensions.cs | 108 ++ .../BackupProtectionIntentOperations.cs | 445 +++++ ...kupProtectionIntentOperationsExtensions.cs | 114 ++ ...ckupResourceEncryptionConfigsOperations.cs | 431 +++++ ...ceEncryptionConfigsOperationsExtensions.cs | 112 ++ ...pResourceStorageConfigsNonCRROperations.cs | 637 +++++++ ...torageConfigsNonCRROperationsExtensions.cs | 160 ++ .../BackupResourceVaultConfigsOperations.cs | 658 +++++++ ...esourceVaultConfigsOperationsExtensions.cs | 163 ++ .../src/Generated/BackupStatusOperations.cs | 255 +++ .../BackupStatusOperationsExtensions.cs | 65 + .../BackupUsageSummariesOperations.cs | 272 +++ ...ackupUsageSummariesOperationsExtensions.cs | 82 + .../BackupWorkloadItemsOperations.cs | 467 +++++ ...BackupWorkloadItemsOperationsExtensions.cs | 134 ++ .../src/Generated/BackupsOperations.cs | 273 +++ .../Generated/BackupsOperationsExtensions.cs | 92 + .../ExportJobsOperationResultsOperations.cs | 281 +++ ...obsOperationResultsOperationsExtensions.cs | 79 + .../src/Generated/FeatureSupportOperations.cs | 256 +++ .../FeatureSupportOperationsExtensions.cs | 67 + ...repareDataMoveOperationResultOperations.cs | 55 + .../src/Generated/IBackupEnginesOperations.cs | 120 ++ .../src/Generated/IBackupJobsOperations.cs | 82 + .../IBackupOperationResultsOperations.cs | 59 + .../IBackupOperationStatusesOperations.cs | 61 + .../Generated/IBackupPoliciesOperations.cs | 83 + .../IBackupProtectableItemsOperations.cs | 86 + .../IBackupProtectedItemsOperations.cs | 84 + .../IBackupProtectionContainersOperations.cs | 79 + .../IBackupProtectionIntentOperations.cs | 84 + ...ckupResourceEncryptionConfigsOperations.cs | 79 + ...pResourceStorageConfigsNonCRROperations.cs | 108 ++ .../IBackupResourceVaultConfigsOperations.cs | 111 ++ .../src/Generated/IBackupStatusOperations.cs | 52 + .../IBackupUsageSummariesOperations.cs | 60 + .../IBackupWorkloadItemsOperations.cs | 92 + .../src/Generated/IBackupsOperations.cs | 64 + .../IExportJobsOperationResultsOperations.cs | 59 + .../Generated/IFeatureSupportOperations.cs | 53 + ...IItemLevelRecoveryConnectionsOperations.cs | 111 ++ .../Generated/IJobCancellationsOperations.cs | 55 + .../src/Generated/IJobDetailsOperations.cs | 56 + .../IJobOperationResultsOperations.cs | 57 + .../src/Generated/IJobsOperations.cs | 55 + .../src/Generated/IOperationOperations.cs | 57 + .../src/Generated/IOperations.cs | 68 + .../IPrivateEndpointConnectionOperations.cs | 176 ++ .../Generated/IPrivateEndpointOperations.cs | 59 + .../IProtectableContainersOperations.cs | 83 + ...ProtectedItemOperationResultsOperations.cs | 66 + ...rotectedItemOperationStatusesOperations.cs | 71 + .../Generated/IProtectedItemsOperations.cs | 143 ++ ...tionContainerOperationResultsOperations.cs | 63 + ...tainerRefreshOperationResultsOperations.cs | 58 + .../IProtectionContainersOperations.cs | 200 +++ .../Generated/IProtectionIntentOperations.cs | 154 ++ .../IProtectionPoliciesOperations.cs | 151 ++ ...tectionPolicyOperationResultsOperations.cs | 60 + ...ectionPolicyOperationStatusesOperations.cs | 65 + .../Generated/IRecoveryPointsOperations.cs | 129 ++ ...overyPointsRecommendedForMoveOperations.cs | 84 + .../IRecoveryServicesBackupClient.cs | 479 +++++ .../IResourceGuardProxiesOperations.cs | 75 + .../IResourceGuardProxyOperations.cs | 141 ++ .../src/Generated/IRestoresOperations.cs | 109 ++ .../src/Generated/ISecurityPINsOperations.cs | 56 + .../Generated/IValidateOperationOperations.cs | 83 + .../IValidateOperationResultsOperations.cs | 57 + .../IValidateOperationStatusesOperations.cs | 62 + .../ItemLevelRecoveryConnectionsOperations.cs | 503 ++++++ ...RecoveryConnectionsOperationsExtensions.cs | 179 ++ .../Generated/JobCancellationsOperations.cs | 241 +++ .../JobCancellationsOperationsExtensions.cs | 74 + .../src/Generated/JobDetailsOperations.cs | 260 +++ .../JobDetailsOperationsExtensions.cs | 73 + .../JobOperationResultsOperations.cs | 248 +++ ...JobOperationResultsOperationsExtensions.cs | 76 + .../src/Generated/JobsOperations.cs | 244 +++ .../src/Generated/JobsOperationsExtensions.cs | 73 + .../Models/AcquireStorageAccountLock.cs | 22 + .../AzureBackupGoalFeatureSupportRequest.cs | 38 + .../Models/AzureBackupServerContainer.cs | 69 + .../Models/AzureBackupServerEngine.cs | 68 + .../Models/AzureFileShareBackupRequest.cs | 55 + .../Models/AzureFileShareProtectableItem.cs | 87 + .../Models/AzureFileShareProtectionPolicy.cs | 98 ++ .../AzureFileShareProvisionILRRequest.cs | 63 + .../Models/AzureFileShareRecoveryPoint.cs | 83 + .../Models/AzureFileShareRestoreRequest.cs | 110 ++ .../Generated/Models/AzureFileShareType.cs | 23 + .../Models/AzureFileshareProtectedItem.cs | 155 ++ ...AzureFileshareProtectedItemExtendedInfo.cs | 95 + .../AzureIaaSClassicComputeVMContainer.cs | 66 + ...zureIaaSClassicComputeVMProtectableItem.cs | 63 + .../AzureIaaSClassicComputeVMProtectedItem.cs | 111 ++ .../Models/AzureIaaSComputeVMContainer.cs | 66 + .../AzureIaaSComputeVMProtectableItem.cs | 63 + .../Models/AzureIaaSComputeVMProtectedItem.cs | 111 ++ .../Generated/Models/AzureIaaSVMErrorInfo.cs | 79 + .../Models/AzureIaaSVMHealthDetails.cs | 49 + .../src/Generated/Models/AzureIaaSVMJob.cs | 124 ++ .../Models/AzureIaaSVMJobExtendedInfo.cs | 98 ++ .../Models/AzureIaaSVMJobTaskDetails.cs | 110 ++ .../src/Generated/Models/AzureIaaSVMJobV2.cs | 114 ++ .../Models/AzureIaaSVMProtectedItem.cs | 196 +++ .../AzureIaaSVMProtectedItemExtendedInfo.cs | 74 + .../Models/AzureIaaSVMProtectionPolicy.cs | 106 ++ ...ureRecoveryServiceVaultProtectionIntent.cs | 60 + .../Models/AzureResourceProtectionIntent.cs | 70 + ...LAGWorkloadContainerProtectionContainer.cs | 71 + .../src/Generated/Models/AzureSqlContainer.cs | 54 + .../Generated/Models/AzureSqlProtectedItem.cs | 117 ++ .../AzureSqlProtectedItemExtendedInfo.cs | 75 + .../Models/AzureSqlProtectionPolicy.cs | 59 + .../Generated/Models/AzureStorageContainer.cs | 103 ++ .../Generated/Models/AzureStorageErrorInfo.cs | 71 + .../src/Generated/Models/AzureStorageJob.cs | 124 ++ .../Models/AzureStorageJobExtendedInfo.cs | 72 + .../Models/AzureStorageJobTaskDetails.cs | 59 + .../AzureStorageProtectableContainer.cs | 56 + ...AzureVMAppContainerProtectableContainer.cs | 56 + .../AzureVMAppContainerProtectionContainer.cs | 71 + .../AzureVMResourceFeatureSupportRequest.cs | 65 + .../AzureVMResourceFeatureSupportResponse.cs | 56 + .../Generated/Models/AzureVmWorkloadItem.cs | 98 ++ .../Models/AzureVmWorkloadProtectableItem.cs | 132 ++ .../Models/AzureVmWorkloadProtectedItem.cs | 216 +++ ...zureVmWorkloadProtectedItemExtendedInfo.cs | 84 + .../Models/AzureVmWorkloadProtectionPolicy.cs | 97 + ...reVmWorkloadSAPAseDatabaseProtectedItem.cs | 117 ++ ...ureVmWorkloadSAPAseDatabaseWorkloadItem.cs | 65 + ...reVmWorkloadSAPAseSystemProtectableItem.cs | 74 + ...AzureVmWorkloadSAPAseSystemWorkloadItem.cs | 65 + ...mWorkloadSAPHanaDatabaseProtectableItem.cs | 74 + ...eVmWorkloadSAPHanaDatabaseProtectedItem.cs | 117 ++ ...reVmWorkloadSAPHanaDatabaseWorkloadItem.cs | 66 + ...eVmWorkloadSAPHanaSystemProtectableItem.cs | 74 + ...zureVmWorkloadSAPHanaSystemWorkloadItem.cs | 65 + ...loadSQLAvailabilityGroupProtectableItem.cs | 74 + ...ureVmWorkloadSQLDatabaseProtectableItem.cs | 73 + ...AzureVmWorkloadSQLDatabaseProtectedItem.cs | 116 ++ .../AzureVmWorkloadSQLDatabaseWorkloadItem.cs | 65 + ...ureVmWorkloadSQLInstanceProtectableItem.cs | 73 + .../AzureVmWorkloadSQLInstanceWorkloadItem.cs | 76 + .../AzureWorkloadAutoProtectionIntent.cs | 58 + .../Models/AzureWorkloadBackupRequest.cs | 74 + .../Models/AzureWorkloadContainer.cs | 110 ++ ...reWorkloadContainerAutoProtectionIntent.cs | 58 + .../AzureWorkloadContainerExtendedInfo.cs | 74 + .../Models/AzureWorkloadErrorInfo.cs | 90 + .../src/Generated/Models/AzureWorkloadJob.cs | 102 ++ .../Models/AzureWorkloadJobExtendedInfo.cs | 72 + .../Models/AzureWorkloadJobTaskDetails.cs | 61 + .../AzureWorkloadPointInTimeRecoveryPoint.cs | 64 + .../AzureWorkloadPointInTimeRestoreRequest.cs | 71 + .../Models/AzureWorkloadRecoveryPoint.cs | 83 + .../Models/AzureWorkloadRestoreRequest.cs | 110 ++ ...WorkloadSAPHanaPointInTimeRecoveryPoint.cs | 56 + ...orkloadSAPHanaPointInTimeRestoreRequest.cs | 71 + ...aPointInTimeRestoreWithRehydrateRequest.cs | 73 + .../AzureWorkloadSAPHanaRecoveryPoint.cs | 56 + .../AzureWorkloadSAPHanaRestoreRequest.cs | 61 + ...kloadSAPHanaRestoreWithRehydrateRequest.cs | 72 + .../AzureWorkloadSQLAutoProtectionIntent.cs | 73 + ...zureWorkloadSQLPointInTimeRecoveryPoint.cs | 69 + ...ureWorkloadSQLPointInTimeRestoreRequest.cs | 78 + ...LPointInTimeRestoreWithRehydrateRequest.cs | 80 + .../Models/AzureWorkloadSQLRecoveryPoint.cs | 73 + ...ureWorkloadSQLRecoveryPointExtendedInfo.cs | 65 + .../Models/AzureWorkloadSQLRestoreRequest.cs | 92 + ...eWorkloadSQLRestoreWithRehydrateRequest.cs | 79 + .../src/Generated/Models/BEKDetails.cs | 68 + .../Models/BMSBackupEngineQueryObject.cs | 51 + .../Models/BMSBackupEnginesQueryObject.cs | 76 + .../Models/BMSBackupSummariesQueryObject.cs | 58 + .../Models/BMSContainerQueryObject.cs | 124 ++ .../Models/BMSContainersInquiryQueryObject.cs | 75 + .../src/Generated/Models/BMSPOQueryObject.cs | 98 ++ .../src/Generated/Models/BMSRPQueryObject.cs | 92 + .../Models/BMSRefreshContainersQueryObject.cs | 59 + .../Models/BMSWorkloadItemQueryObject.cs | 96 + .../src/Generated/Models/BackupEngineBase.cs | 158 ++ .../Models/BackupEngineBaseResource.cs | 65 + .../Models/BackupEngineExtendedInfo.cs | 114 ++ .../src/Generated/Models/BackupItemType.cs | 35 + .../Generated/Models/BackupManagementType.cs | 29 + .../Generated/Models/BackupManagementUsage.cs | 94 + .../src/Generated/Models/BackupRequest.cs | 36 + .../Generated/Models/BackupRequestResource.cs | 64 + .../Generated/Models/BackupResourceConfig.cs | 109 ++ .../Models/BackupResourceConfigResource.cs | 66 + .../Models/BackupResourceEncryptionConfig.cs | 91 + .../BackupResourceEncryptionConfigExtended.cs | 72 + ...esourceEncryptionConfigExtendedResource.cs | 65 + .../BackupResourceEncryptionConfigResource.cs | 63 + .../Models/BackupResourceVaultConfig.cs | 120 ++ .../BackupResourceVaultConfigResource.cs | 66 + .../Generated/Models/BackupStatusRequest.cs | 77 + .../Generated/Models/BackupStatusResponse.cs | 131 ++ .../src/Generated/Models/BackupType.cs | 26 + .../Models/ClientDiscoveryDisplay.cs | 80 + .../ClientDiscoveryForLogSpecification.cs | 70 + .../Models/ClientDiscoveryForProperties.cs | 53 + .../ClientDiscoveryForServiceSpecification.cs | 57 + .../ClientDiscoveryValueForSingleApi.cs | 83 + .../Models/ClientScriptForConnect.cs | 96 + .../Generated/Models/ContainerIdentityInfo.cs | 78 + .../src/Generated/Models/ContainerType.cs | 35 + .../src/Generated/Models/CopyOptions.cs | 25 + .../src/Generated/Models/CreateMode.cs | 23 + .../Models/DPMContainerExtendedInfo.cs | 52 + .../src/Generated/Models/DPMProtectedItem.cs | 124 ++ .../Models/DPMProtectedItemExtendedInfo.cs | 173 ++ .../Generated/Models/DailyRetentionFormat.cs | 53 + .../Models/DailyRetentionSchedule.cs | 63 + .../src/Generated/Models/DailySchedule.cs | 51 + .../src/Generated/Models/DataMoveLevel.cs | 23 + .../src/Generated/Models/DataSourceType.cs | 35 + .../src/Generated/Models/Day.cs | 59 + .../src/Generated/Models/DayOfWeek.cs | 90 + .../src/Generated/Models/DedupState.cs | 23 + .../Models/DiskExclusionProperties.cs | 62 + .../src/Generated/Models/DiskInformation.cs | 55 + .../Generated/Models/DistributedNodesInfo.cs | 72 + .../src/Generated/Models/DpmBackupEngine.cs | 67 + .../src/Generated/Models/DpmContainer.cs | 127 ++ .../src/Generated/Models/DpmErrorInfo.cs | 63 + .../src/Generated/Models/DpmJob.cs | 128 ++ .../Generated/Models/DpmJobExtendedInfo.cs | 71 + .../src/Generated/Models/DpmJobTaskDetails.cs | 83 + .../Generated/Models/EncryptionAtRestType.cs | 23 + .../src/Generated/Models/EncryptionDetails.cs | 87 + .../Generated/Models/EnhancedSecurityState.cs | 23 + .../Generated/Models/ErrorAdditionalInfo.cs | 59 + .../src/Generated/Models/ErrorDetail.cs | 71 + .../Models/ExportJobsOperationResultInfo.cs | 82 + .../Generated/Models/ExtendedProperties.cs | 60 + .../src/Generated/Models/FabricName.cs | 22 + .../Generated/Models/FeatureSupportRequest.cs | 35 + .../src/Generated/Models/GenericContainer.cs | 73 + .../Models/GenericContainerExtendedInfo.cs | 73 + .../Generated/Models/GenericProtectedItem.cs | 141 ++ .../Models/GenericProtectionPolicy.cs | 78 + .../Generated/Models/GenericRecoveryPoint.cs | 79 + .../Models/GetProtectedItemQueryObject.cs | 55 + .../src/Generated/Models/HealthState.cs | 24 + .../src/Generated/Models/HealthStatus.cs | 24 + .../src/Generated/Models/HourlySchedule.cs | 70 + .../src/Generated/Models/HttpStatusCode.cs | 330 ++++ .../src/Generated/Models/IAASVMPolicyType.cs | 23 + .../src/Generated/Models/ILRRequest.cs | 35 + .../Generated/Models/ILRRequestResource.cs | 63 + .../src/Generated/Models/IaaSVMContainer.cs | 85 + .../Generated/Models/IaaSVMProtectableItem.cs | 81 + .../Generated/Models/IaasVMBackupRequest.cs | 53 + .../Models/IaasVMILRRegistrationRequest.cs | 84 + .../Generated/Models/IaasVMRecoveryPoint.cs | 183 ++ .../Generated/Models/IaasVMRestoreRequest.cs | 267 +++ .../IaasVMRestoreWithRehydrationRequest.cs | 113 ++ .../Models/IdentityBasedRestoreDetails.cs | 63 + .../src/Generated/Models/IdentityInfo.cs | 66 + .../Models/InfrastructureEncryptionState.cs | 23 + .../src/Generated/Models/InquiryInfo.cs | 77 + .../src/Generated/Models/InquiryStatus.cs | 23 + .../src/Generated/Models/InquiryValidation.cs | 69 + .../Models/InstantItemRecoveryTarget.cs | 53 + .../Models/InstantRPAdditionalDetails.cs | 52 + .../src/Generated/Models/IntentItemType.cs | 23 + .../src/Generated/Models/Job.cs | 107 ++ .../src/Generated/Models/JobOperationType.cs | 31 + .../src/Generated/Models/JobQueryObject.cs | 110 ++ .../src/Generated/Models/JobResource.cs | 63 + .../src/Generated/Models/JobStatus.cs | 27 + .../Generated/Models/JobSupportedAction.cs | 66 + .../src/Generated/Models/KEKDetails.cs | 68 + .../Models/KPIResourceHealthDetails.cs | 66 + .../Generated/Models/KeyAndSecretDetails.cs | 74 + .../src/Generated/Models/LastBackupStatus.cs | 24 + .../src/Generated/Models/LastUpdateStatus.cs | 28 + ...RecoveryPointsRecommendedForMoveRequest.cs | 64 + .../src/Generated/Models/LogSchedulePolicy.cs | 53 + .../Models/LongTermRetentionPolicy.cs | 79 + .../Models/LongTermSchedulePolicy.cs | 35 + .../Models/MABContainerHealthDetails.cs | 77 + .../src/Generated/Models/MabContainer.cs | 120 ++ .../Models/MabContainerExtendedInfo.cs | 98 ++ .../src/Generated/Models/MabErrorInfo.cs | 62 + .../Models/MabFileFolderProtectedItem.cs | 149 ++ .../MabFileFolderProtectedItemExtendedInfo.cs | 73 + .../src/Generated/Models/MabJob.cs | 136 ++ .../Generated/Models/MabJobExtendedInfo.cs | 70 + .../src/Generated/Models/MabJobTaskDetails.cs | 83 + .../Generated/Models/MabProtectionPolicy.cs | 68 + .../src/Generated/Models/MabServerType.cs | 35 + .../src/Generated/Models/MonthOfYear.cs | 126 ++ .../Models/MonthlyRetentionSchedule.cs | 92 + .../Models/MoveRPAcrossTiersRequest.cs | 70 + .../src/Generated/Models/NameInfo.cs | 59 + .../src/Generated/Models/NewErrorResponse.cs | 51 + .../Generated/Models/NewErrorResponseError.cs | 85 + .../Models/NewErrorResponseException.cs | 62 + .../Generated/Models/OperationResultInfo.cs | 54 + .../Models/OperationResultInfoBase.cs | 35 + .../Models/OperationResultInfoBaseResource.cs | 74 + .../src/Generated/Models/OperationStatus.cs | 104 ++ .../Generated/Models/OperationStatusError.cs | 60 + .../Models/OperationStatusExtendedInfo.cs | 36 + .../Models/OperationStatusJobExtendedInfo.cs | 54 + .../Models/OperationStatusJobsExtendedInfo.cs | 66 + ...OperationStatusProvisionILRExtendedInfo.cs | 54 + ...tionStatusValidateOperationExtendedInfo.cs | 54 + .../Generated/Models/OperationStatusValues.cs | 25 + .../src/Generated/Models/OperationType.cs | 23 + .../Models/OperationWorkerResponse.cs | 90 + .../src/Generated/Models/OverwriteOptions.cs | 23 + .../src/Generated/Models/Page.cs | 53 + .../src/Generated/Models/Page1.cs | 53 + .../src/Generated/Models/PointInTimeRange.cs | 61 + .../src/Generated/Models/PolicyType.cs | 26 + .../Generated/Models/PreBackupValidation.cs | 73 + .../Models/PreValidateEnableBackupRequest.cs | 93 + .../Models/PreValidateEnableBackupResponse.cs | 103 ++ .../Models/PrepareDataMoveRequest.cs | 114 ++ .../Models/PrepareDataMoveResponse.cs | 62 + .../src/Generated/Models/PrivateEndpoint.cs | 52 + .../Models/PrivateEndpointConnection.cs | 74 + .../PrivateEndpointConnectionResource.cs | 66 + .../Models/PrivateEndpointConnectionStatus.cs | 24 + .../PrivateLinkServiceConnectionState.cs | 71 + .../Generated/Models/ProtectableContainer.cs | 83 + .../Models/ProtectableContainerResource.cs | 66 + .../src/Generated/Models/ProtectedItem.cs | 212 +++ .../Models/ProtectedItemHealthStatus.cs | 25 + .../Models/ProtectedItemQueryObject.cs | 133 ++ .../Generated/Models/ProtectedItemResource.cs | 63 + .../Generated/Models/ProtectedItemState.cs | 26 + .../Generated/Models/ProtectionContainer.cs | 95 + .../Models/ProtectionContainerResource.cs | 67 + .../src/Generated/Models/ProtectionIntent.cs | 98 ++ .../Models/ProtectionIntentQueryObject.cs | 86 + .../Models/ProtectionIntentResource.cs | 64 + .../src/Generated/Models/ProtectionPolicy.cs | 64 + .../Models/ProtectionPolicyQueryObject.cs | 83 + .../Models/ProtectionPolicyResource.cs | 65 + .../src/Generated/Models/ProtectionState.cs | 26 + .../src/Generated/Models/ProtectionStatus.cs | 25 + .../src/Generated/Models/ProvisioningState.cs | 24 + .../src/Generated/Models/RecoveryMode.cs | 23 + .../src/Generated/Models/RecoveryPoint.cs | 36 + .../Models/RecoveryPointDiskConfiguration.cs | 83 + .../Models/RecoveryPointMoveReadinessInfo.cs | 54 + .../Models/RecoveryPointRehydrationInfo.cs | 66 + .../Generated/Models/RecoveryPointResource.cs | 64 + .../Models/RecoveryPointTierInformation.cs | 76 + .../Models/RecoveryPointTierInformationV2.cs | 53 + .../Models/RecoveryPointTierStatus.cs | 78 + .../Generated/Models/RecoveryPointTierType.cs | 72 + .../src/Generated/Models/RecoveryType.cs | 25 + .../Generated/Models/RehydrationPriority.cs | 22 + .../src/Generated/Models/Resource.cs | 99 ++ .../Models/ResourceGuardOperationDetail.cs | 54 + .../Models/ResourceGuardProxyBase.cs | 66 + .../Models/ResourceGuardProxyBaseResource.cs | 63 + .../Generated/Models/ResourceHealthDetails.cs | 77 + .../Generated/Models/ResourceHealthStatus.cs | 26 + .../src/Generated/Models/ResourceList.cs | 53 + .../src/Generated/Models/RestoreFileSpecs.cs | 69 + .../Generated/Models/RestorePointQueryType.cs | 27 + .../src/Generated/Models/RestorePointType.cs | 25 + .../src/Generated/Models/RestoreRequest.cs | 36 + .../Models/RestoreRequestResource.cs | 64 + .../Generated/Models/RestoreRequestType.cs | 23 + .../src/Generated/Models/RetentionDuration.cs | 68 + .../Generated/Models/RetentionDurationType.cs | 25 + .../src/Generated/Models/RetentionPolicy.cs | 35 + .../Models/RetentionScheduleFormat.cs | 23 + .../src/Generated/Models/SQLDataDirectory.cs | 69 + .../Models/SQLDataDirectoryMapping.cs | 78 + .../Generated/Models/SQLDataDirectoryType.cs | 23 + .../src/Generated/Models/SchedulePolicy.cs | 35 + .../src/Generated/Models/ScheduleRunType.cs | 24 + .../src/Generated/Models/SecurityPinBase.cs | 54 + .../src/Generated/Models/Settings.cs | 74 + .../Generated/Models/SimpleRetentionPolicy.cs | 52 + .../Generated/Models/SimpleSchedulePolicy.cs | 91 + .../Models/SimpleSchedulePolicyV2.cs | 78 + .../Models/SoftDeleteFeatureState.cs | 23 + .../src/Generated/Models/StorageType.cs | 25 + .../src/Generated/Models/StorageTypeState.cs | 23 + .../Generated/Models/SubProtectionPolicy.cs | 74 + .../src/Generated/Models/SupportStatus.cs | 25 + .../Generated/Models/TargetAFSRestoreInfo.cs | 60 + .../src/Generated/Models/TargetRestoreInfo.cs | 83 + .../src/Generated/Models/TokenInformation.cs | 67 + .../Models/TriggerDataMoveRequest.cs | 121 ++ .../src/Generated/Models/Type.cs | 23 + .../Generated/Models/UnlockDeleteRequest.cs | 57 + .../Generated/Models/UnlockDeleteResponse.cs | 53 + .../src/Generated/Models/UsagesUnit.cs | 26 + .../ValidateIaasVMRestoreOperationRequest.cs | 47 + .../Models/ValidateOperationRequest.cs | 35 + .../Models/ValidateOperationResponse.cs | 53 + .../Models/ValidateOperationsResponse.cs | 46 + .../Models/ValidateRestoreOperationRequest.cs | 54 + .../src/Generated/Models/ValidationStatus.cs | 23 + .../src/Generated/Models/VaultJob.cs | 94 + .../src/Generated/Models/VaultJobErrorInfo.cs | 71 + .../Generated/Models/VaultJobExtendedInfo.cs | 53 + ...ultStorageConfigOperationResultResponse.cs | 36 + .../src/Generated/Models/WeekOfMonth.cs | 84 + .../Generated/Models/WeeklyRetentionFormat.cs | 61 + .../Models/WeeklyRetentionSchedule.cs | 72 + .../src/Generated/Models/WeeklySchedule.cs | 57 + .../Models/WorkloadInquiryDetails.cs | 72 + .../src/Generated/Models/WorkloadItem.cs | 83 + .../Generated/Models/WorkloadItemResource.cs | 64 + .../src/Generated/Models/WorkloadItemType.cs | 27 + .../Models/WorkloadProtectableItem.cs | 83 + .../Models/WorkloadProtectableItemResource.cs | 67 + .../src/Generated/Models/WorkloadType.cs | 35 + .../src/Generated/Models/XcoolState.cs | 23 + .../Models/YearlyRetentionSchedule.cs | 101 ++ .../src/Generated/OperationOperations.cs | 266 +++ .../OperationOperationsExtensions.cs | 75 + .../src/Generated/Operations.cs | 400 +++++ .../src/Generated/OperationsExtensions.cs | 87 + .../PrivateEndpointConnectionOperations.cs | 735 ++++++++ ...eEndpointConnectionOperationsExtensions.cs | 275 +++ .../Generated/PrivateEndpointOperations.cs | 264 +++ .../PrivateEndpointOperationsExtensions.cs | 79 + .../ProtectableContainersOperations.cs | 445 +++++ ...otectableContainersOperationsExtensions.cs | 112 ++ ...ProtectedItemOperationResultsOperations.cs | 288 +++ ...temOperationResultsOperationsExtensions.cs | 93 + ...rotectedItemOperationStatusesOperations.cs | 292 +++ ...emOperationStatusesOperationsExtensions.cs | 101 ++ .../src/Generated/ProtectedItemsOperations.cs | 739 ++++++++ .../ProtectedItemsOperationsExtensions.cs | 229 +++ ...tionContainerOperationResultsOperations.cs | 279 +++ ...nerOperationResultsOperationsExtensions.cs | 87 + ...tainerRefreshOperationResultsOperations.cs | 250 +++ ...eshOperationResultsOperationsExtensions.cs | 80 + .../ProtectionContainersOperations.cs | 1111 ++++++++++++ ...rotectionContainersOperationsExtensions.cs | 329 ++++ .../Generated/ProtectionIntentOperations.cs | 899 ++++++++++ .../ProtectionIntentOperationsExtensions.cs | 242 +++ .../Generated/ProtectionPoliciesOperations.cs | 700 ++++++++ .../ProtectionPoliciesOperationsExtensions.cs | 235 +++ ...tectionPolicyOperationResultsOperations.cs | 270 +++ ...icyOperationResultsOperationsExtensions.cs | 81 + ...ectionPolicyOperationStatusesOperations.cs | 275 +++ ...cyOperationStatusesOperationsExtensions.cs | 91 + .../src/Generated/RecoveryPointsOperations.cs | 700 ++++++++ .../RecoveryPointsOperationsExtensions.cs | 198 +++ ...overyPointsRecommendedForMoveOperations.cs | 462 +++++ ...sRecommendedForMoveOperationsExtensions.cs | 119 ++ .../Generated/RecoveryServicesBackupClient.cs | 1568 +++++++++++++++++ .../RecoveryServicesBackupClientExtensions.cs | 373 ++++ .../ResourceGuardProxiesOperations.cs | 424 +++++ ...esourceGuardProxiesOperationsExtensions.cs | 101 ++ .../Generated/ResourceGuardProxyOperations.cs | 869 +++++++++ .../ResourceGuardProxyOperationsExtensions.cs | 216 +++ .../src/Generated/RestoresOperations.cs | 322 ++++ .../Generated/RestoresOperationsExtensions.cs | 171 ++ .../SdkInfo_RecoveryServicesBackupClient.cs | 78 + .../src/Generated/SecurityPINsOperations.cs | 267 +++ .../SecurityPINsOperationsExtensions.cs | 75 + .../Generated/ValidateOperationOperations.cs | 274 +++ .../ValidateOperationOperationsExtensions.cs | 123 ++ .../ValidateOperationResultsOperations.cs | 261 +++ ...ateOperationResultsOperationsExtensions.cs | 75 + .../ValidateOperationStatusesOperations.cs | 265 +++ ...teOperationStatusesOperationsExtensions.cs | 83 + 491 files changed, 56778 insertions(+) create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBMSPrepareDataMoveOperationResultOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupEnginesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupJobsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationStatusesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupPoliciesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectableItemsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionContainersOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionIntentOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceEncryptionConfigsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceStorageConfigsNonCRROperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceVaultConfigsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupStatusOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupUsageSummariesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupWorkloadItemsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IExportJobsOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IFeatureSupportOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IItemLevelRecoveryConnectionsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobCancellationsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobDetailsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperationOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointConnectionOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectableContainersOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationStatusesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerRefreshOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainersOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionIntentOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPoliciesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationStatusesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsRecommendedForMoveOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryServicesBackupClient.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IResourceGuardProxiesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IResourceGuardProxyOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRestoresOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ISecurityPINsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationStatusesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AcquireStorageAccountLock.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupGoalFeatureSupportRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerEngine.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareBackupRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProtectionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProvisionILRRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRestoreRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItemExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMErrorInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMHealthDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJob.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobTaskDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobV2.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItemExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureRecoveryServiceVaultProtectionIntent.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureResourceProtectionIntent.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItemExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageErrorInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJob.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJobExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJobTaskDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageProtectableContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectableContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectionContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMResourceFeatureSupportRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMResourceFeatureSupportResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItemExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseWorkloadItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseSystemProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseSystemWorkloadItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseWorkloadItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaSystemProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaSystemWorkloadItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseWorkloadItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLInstanceProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLInstanceWorkloadItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadAutoProtectionIntent.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadBackupRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerAutoProtectionIntent.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadErrorInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJob.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJobExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJobTaskDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRestoreRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRestoreRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLAutoProtectionIntent.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPointExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BEKDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupEngineQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupEnginesQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupSummariesQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSContainerQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSContainersInquiryQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSPOQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRPQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRefreshContainersQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSWorkloadItemQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineBase.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineBaseResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupItemType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupManagementType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupManagementUsage.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupRequestResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfig.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfigResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfig.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigExtended.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigExtendedResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfig.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfigResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupStatusRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupStatusResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryDisplay.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForLogSpecification.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForProperties.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForServiceSpecification.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryValueForSingleApi.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientScriptForConnect.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ContainerIdentityInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ContainerType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CopyOptions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CreateMode.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMContainerExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItemExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailyRetentionFormat.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailyRetentionSchedule.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailySchedule.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DataMoveLevel.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DataSourceType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Day.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DayOfWeek.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DedupState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DiskExclusionProperties.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DiskInformation.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DistributedNodesInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmBackupEngine.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmErrorInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJob.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJobExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJobTaskDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EncryptionAtRestType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EncryptionDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EnhancedSecurityState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorAdditionalInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorDetail.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExportJobsOperationResultInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExtendedProperties.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/FabricName.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/FeatureSupportRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainerExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericRecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GetProtectedItemQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HealthState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HealthStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HourlySchedule.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HttpStatusCode.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IAASVMPolicyType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ILRRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ILRRequestResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMBackupRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMILRRegistrationRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityBasedRestoreDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InfrastructureEncryptionState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryValidation.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InstantItemRecoveryTarget.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InstantRPAdditionalDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IntentItemType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Job.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobOperationType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobSupportedAction.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KEKDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KPIResourceHealthDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KeyAndSecretDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LastBackupStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LastUpdateStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ListRecoveryPointsRecommendedForMoveRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LogSchedulePolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LongTermRetentionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LongTermSchedulePolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MABContainerHealthDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainerExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabErrorInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItemExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJob.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJobExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJobTaskDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabProtectionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabServerType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MonthOfYear.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MonthlyRetentionSchedule.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MoveRPAcrossTiersRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NameInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponseError.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponseException.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfoBase.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfoBaseResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusError.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusJobExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusJobsExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusProvisionILRExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValidateOperationExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValues.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationWorkerResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OverwriteOptions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Page.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Page1.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PointInTimeRange.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PolicyType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreBackupValidation.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreValidateEnableBackupRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreValidateEnableBackupResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrepareDataMoveRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrepareDataMoveResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnection.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnectionResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnectionStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateLinkServiceConnectionState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectableContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectableContainerResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemHealthStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainer.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainerResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntent.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntentQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntentResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicyQueryObject.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicyResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryMode.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPoint.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointDiskConfiguration.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointMoveReadinessInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointRehydrationInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformation.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformationV2.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RehydrationPriority.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Resource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardOperationDetail.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardProxyBase.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardProxyBaseResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceHealthDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceHealthStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceList.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreFileSpecs.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestorePointQueryType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestorePointType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequestResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequestType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionDuration.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionDurationType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionScheduleFormat.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectory.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectoryMapping.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectoryType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SchedulePolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ScheduleRunType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SecurityPinBase.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Settings.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleRetentionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicyV2.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SoftDeleteFeatureState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/StorageType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/StorageTypeState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SubProtectionPolicy.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SupportStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TargetAFSRestoreInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TargetRestoreInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TokenInformation.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TriggerDataMoveRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Type.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UnlockDeleteRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UnlockDeleteResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UsagesUnit.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateIaasVMRestoreOperationRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationsResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateRestoreOperationRequest.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidationStatus.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJob.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJobErrorInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJobExtendedInfo.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultStorageConfigOperationResultResponse.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeekOfMonth.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklyRetentionFormat.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklyRetentionSchedule.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklySchedule.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadInquiryDetails.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItemResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItemType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadProtectableItem.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadProtectableItemResource.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadType.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/XcoolState.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/YearlyRetentionSchedule.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Operations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClient.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClientExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperationsExtensions.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperations.cs create mode 100644 sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperationsExtensions.cs diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperations.cs new file mode 100644 index 000000000000..5d4913bdd700 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperations.cs @@ -0,0 +1,254 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BMSPrepareDataMoveOperationResultOperations operations. + /// + internal partial class BMSPrepareDataMoveOperationResultOperations : IServiceOperations, IBMSPrepareDataMoveOperationResultOperations + { + /// + /// Initializes a new instance of the BMSPrepareDataMoveOperationResultOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BMSPrepareDataMoveOperationResultOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches Operation Result for Prepare Data Move + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperationsExtensions.cs new file mode 100644 index 000000000000..4ec03a992792 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BMSPrepareDataMoveOperationResultOperations. + /// + public static partial class BMSPrepareDataMoveOperationResultOperationsExtensions + { + /// + /// Fetches Operation Result for Prepare Data Move + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + public static VaultStorageConfigOperationResultResponse Get(this IBMSPrepareDataMoveOperationResultOperations operations, string vaultName, string resourceGroupName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches Operation Result for Prepare Data Move + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBMSPrepareDataMoveOperationResultOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperations.cs new file mode 100644 index 000000000000..822f5cfc137f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperations.cs @@ -0,0 +1,673 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupEnginesOperations operations. + /// + internal partial class BackupEnginesOperations : IServiceOperations, IBackupEnginesOperations + { + /// + /// Initializes a new instance of the BackupEnginesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupEnginesOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Backup management servers registered to Recovery Services Vault. Returns a + /// pageable list of servers. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns backup management server registered to Recovery Services Vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the backup management server. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupEngineName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (backupEngineName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupEngineName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("backupEngineName", backupEngineName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{backupEngineName}", System.Uri.EscapeDataString(backupEngineName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Backup management servers registered to Recovery Services Vault. Returns a + /// pageable list of servers. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperationsExtensions.cs new file mode 100644 index 000000000000..0a0bfd4c53bb --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperationsExtensions.cs @@ -0,0 +1,178 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupEnginesOperations. + /// + public static partial class BackupEnginesOperationsExtensions + { + /// + /// Backup management servers registered to Recovery Services Vault. Returns a + /// pageable list of servers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + public static IPage List(this IBackupEnginesOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Backup management servers registered to Recovery Services Vault. Returns a + /// pageable list of servers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBackupEnginesOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns backup management server registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the backup management server. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + public static BackupEngineBaseResource Get(this IBackupEnginesOperations operations, string vaultName, string resourceGroupName, string backupEngineName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.GetAsync(vaultName, resourceGroupName, backupEngineName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Returns backup management server registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the backup management server. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBackupEnginesOperations operations, string vaultName, string resourceGroupName, string backupEngineName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, backupEngineName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Backup management servers registered to Recovery Services Vault. Returns a + /// pageable list of servers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IBackupEnginesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Backup management servers registered to Recovery Services Vault. Returns a + /// pageable list of servers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IBackupEnginesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs new file mode 100644 index 000000000000..d40858c5223e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs @@ -0,0 +1,445 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupJobsOperations operations. + /// + internal partial class BackupJobsOperations : IServiceOperations, IBackupJobsOperations + { + /// + /// Initializes a new instance of the BackupJobsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupJobsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides a pageable list of jobs. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provides a pageable list of jobs. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperationsExtensions.cs new file mode 100644 index 000000000000..cb0d02b53ef6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperationsExtensions.cs @@ -0,0 +1,114 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupJobsOperations. + /// + public static partial class BackupJobsOperationsExtensions + { + /// + /// Provides a pageable list of jobs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + public static IPage List(this IBackupJobsOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of jobs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBackupJobsOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provides a pageable list of jobs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IBackupJobsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of jobs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IBackupJobsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs new file mode 100644 index 000000000000..72ae92f70f0f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs @@ -0,0 +1,245 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupOperationResultsOperations operations. + /// + internal partial class BackupOperationResultsOperations : IServiceOperations, IBackupOperationResultsOperations + { + /// + /// Initializes a new instance of the BackupOperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides the status of the delete operations such as deleting backed up + /// item. Once the operation has started, the + /// status code in the response would be Accepted. It will continue to be in + /// this state till it reaches completion. On + /// successful completion, the status code will be OK. This method expects + /// OperationID as an argument. OperationID is + /// part of the Location header of the operation response. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..2d74f93aaeb9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperationsExtensions.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupOperationResultsOperations. + /// + public static partial class BackupOperationResultsOperationsExtensions + { + /// + /// Provides the status of the delete operations such as deleting backed up + /// item. Once the operation has started, the + /// status code in the response would be Accepted. It will continue to be in + /// this state till it reaches completion. On + /// successful completion, the status code will be OK. This method expects + /// OperationID as an argument. OperationID is + /// part of the Location header of the operation response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation. + /// + public static void Get(this IBackupOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId) + { + operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Provides the status of the delete operations such as deleting backed up + /// item. Once the operation has started, the + /// status code in the response would be Accepted. It will continue to be in + /// this state till it reaches completion. On + /// successful completion, the status code will be OK. This method expects + /// OperationID as an argument. OperationID is + /// part of the Location header of the operation response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBackupOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs new file mode 100644 index 000000000000..5fc0eb2d099a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs @@ -0,0 +1,265 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupOperationStatusesOperations operations. + /// + internal partial class BackupOperationStatusesOperations : IServiceOperations, IBackupOperationStatusesOperations + { + /// + /// Initializes a new instance of the BackupOperationStatusesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches the status of an operation such as triggering a backup, restore. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs when the operation is + /// complete. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperationsExtensions.cs new file mode 100644 index 000000000000..90b00f6d8a16 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperationsExtensions.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupOperationStatusesOperations. + /// + public static partial class BackupOperationStatusesOperationsExtensions + { + /// + /// Fetches the status of an operation such as triggering a backup, restore. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs when the operation is + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation. + /// + public static OperationStatus Get(this IBackupOperationStatusesOperations operations, string vaultName, string resourceGroupName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches the status of an operation such as triggering a backup, restore. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs when the operation is + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBackupOperationStatusesOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs new file mode 100644 index 000000000000..36b1209b1b32 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs @@ -0,0 +1,441 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupPoliciesOperations operations. + /// + internal partial class BackupPoliciesOperations : IServiceOperations, IBackupPoliciesOperations + { + /// + /// Initializes a new instance of the BackupPoliciesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupPoliciesOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Lists of backup policies associated with Recovery Services Vault. API + /// provides pagination parameters to fetch + /// scoped results. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists of backup policies associated with Recovery Services Vault. API + /// provides pagination parameters to fetch + /// scoped results. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperationsExtensions.cs new file mode 100644 index 000000000000..a3367259ef1c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperationsExtensions.cs @@ -0,0 +1,116 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupPoliciesOperations. + /// + public static partial class BackupPoliciesOperationsExtensions + { + /// + /// Lists of backup policies associated with Recovery Services Vault. API + /// provides pagination parameters to fetch + /// scoped results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this IBackupPoliciesOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(vaultName, resourceGroupName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Lists of backup policies associated with Recovery Services Vault. API + /// provides pagination parameters to fetch + /// scoped results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBackupPoliciesOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists of backup policies associated with Recovery Services Vault. API + /// provides pagination parameters to fetch + /// scoped results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IBackupPoliciesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists of backup policies associated with Recovery Services Vault. API + /// provides pagination parameters to fetch + /// scoped results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IBackupPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs new file mode 100644 index 000000000000..228280dc1748 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs @@ -0,0 +1,449 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupProtectableItemsOperations operations. + /// + internal partial class BackupProtectableItemsOperations : IServiceOperations, IBackupProtectableItemsOperations + { + /// + /// Initializes a new instance of the BackupProtectableItemsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides a pageable list of protectable objects within your subscription + /// according to the query filter and the + /// pagination parameters. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provides a pageable list of protectable objects within your subscription + /// according to the query filter and the + /// pagination parameters. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperationsExtensions.cs new file mode 100644 index 000000000000..de4445d8d0fc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperationsExtensions.cs @@ -0,0 +1,122 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupProtectableItemsOperations. + /// + public static partial class BackupProtectableItemsOperationsExtensions + { + /// + /// Provides a pageable list of protectable objects within your subscription + /// according to the query filter and the + /// pagination parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + public static IPage List(this IBackupProtectableItemsOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of protectable objects within your subscription + /// according to the query filter and the + /// pagination parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBackupProtectableItemsOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provides a pageable list of protectable objects within your subscription + /// according to the query filter and the + /// pagination parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IBackupProtectableItemsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of protectable objects within your subscription + /// according to the query filter and the + /// pagination parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IBackupProtectableItemsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs new file mode 100644 index 000000000000..944a3d5027b0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs @@ -0,0 +1,445 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupProtectedItemsOperations operations. + /// + internal partial class BackupProtectedItemsOperations : IServiceOperations, IBackupProtectedItemsOperations + { + /// + /// Initializes a new instance of the BackupProtectedItemsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides a pageable list of all items that are backed up within a vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provides a pageable list of all items that are backed up within a vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperationsExtensions.cs new file mode 100644 index 000000000000..a894e3315ba5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperationsExtensions.cs @@ -0,0 +1,114 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupProtectedItemsOperations. + /// + public static partial class BackupProtectedItemsOperationsExtensions + { + /// + /// Provides a pageable list of all items that are backed up within a vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + public static IPage List(this IBackupProtectedItemsOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of all items that are backed up within a vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBackupProtectedItemsOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provides a pageable list of all items that are backed up within a vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IBackupProtectedItemsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of all items that are backed up within a vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IBackupProtectedItemsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs new file mode 100644 index 000000000000..01ed97d6584e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs @@ -0,0 +1,437 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupProtectionContainersOperations operations. + /// + internal partial class BackupProtectionContainersOperations : IServiceOperations, IBackupProtectionContainersOperations + { + /// + /// Initializes a new instance of the BackupProtectionContainersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupProtectionContainersOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Lists the containers registered to Recovery Services Vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the containers registered to Recovery Services Vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperationsExtensions.cs new file mode 100644 index 000000000000..299f062ab42b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperationsExtensions.cs @@ -0,0 +1,108 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupProtectionContainersOperations. + /// + public static partial class BackupProtectionContainersOperationsExtensions + { + /// + /// Lists the containers registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this IBackupProtectionContainersOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(vaultName, resourceGroupName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Lists the containers registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBackupProtectionContainersOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the containers registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IBackupProtectionContainersOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the containers registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IBackupProtectionContainersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperations.cs new file mode 100644 index 000000000000..276b87c0cab8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperations.cs @@ -0,0 +1,445 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupProtectionIntentOperations operations. + /// + internal partial class BackupProtectionIntentOperations : IServiceOperations, IBackupProtectionIntentOperations + { + /// + /// Initializes a new instance of the BackupProtectionIntentOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupProtectionIntentOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides a pageable list of all intents that are present within a vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionIntents").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provides a pageable list of all intents that are present within a vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperationsExtensions.cs new file mode 100644 index 000000000000..8edea65a64f6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperationsExtensions.cs @@ -0,0 +1,114 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupProtectionIntentOperations. + /// + public static partial class BackupProtectionIntentOperationsExtensions + { + /// + /// Provides a pageable list of all intents that are present within a vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + public static IPage List(this IBackupProtectionIntentOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of all intents that are present within a vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBackupProtectionIntentOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provides a pageable list of all intents that are present within a vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IBackupProtectionIntentOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of all intents that are present within a vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IBackupProtectionIntentOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs new file mode 100644 index 000000000000..8394b46cc46b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs @@ -0,0 +1,431 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupResourceEncryptionConfigsOperations operations. + /// + internal partial class BackupResourceEncryptionConfigsOperations : IServiceOperations, IBackupResourceEncryptionConfigsOperations + { + /// + /// Initializes a new instance of the BackupResourceEncryptionConfigsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches Vault Encryption config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates Vault encryption config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault encryption input config request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceEncryptionConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperationsExtensions.cs new file mode 100644 index 000000000000..c7a57b1de17e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperationsExtensions.cs @@ -0,0 +1,112 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupResourceEncryptionConfigsOperations. + /// + public static partial class BackupResourceEncryptionConfigsOperationsExtensions + { + /// + /// Fetches Vault Encryption config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + public static BackupResourceEncryptionConfigExtendedResource Get(this IBackupResourceEncryptionConfigsOperations operations, string vaultName, string resourceGroupName) + { + return operations.GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Fetches Vault Encryption config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBackupResourceEncryptionConfigsOperations operations, string vaultName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates Vault encryption config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault encryption input config request + /// + public static void Update(this IBackupResourceEncryptionConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceEncryptionConfigResource parameters) + { + operations.UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates Vault encryption config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault encryption input config request + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IBackupResourceEncryptionConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceEncryptionConfigResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperations.cs new file mode 100644 index 000000000000..589e741ffccc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperations.cs @@ -0,0 +1,637 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupResourceStorageConfigsNonCRROperations operations. + /// + internal partial class BackupResourceStorageConfigsNonCRROperations : IServiceOperations, IBackupResourceStorageConfigsNonCRROperations + { + /// + /// Initializes a new instance of the BackupResourceStorageConfigsNonCRROperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches resource storage config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates vault storage model type. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault storage config request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates vault storage model type. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault storage config request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperationsExtensions.cs new file mode 100644 index 000000000000..f8327055149d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperationsExtensions.cs @@ -0,0 +1,160 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupResourceStorageConfigsNonCRROperations. + /// + public static partial class BackupResourceStorageConfigsNonCRROperationsExtensions + { + /// + /// Fetches resource storage config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + public static BackupResourceConfigResource Get(this IBackupResourceStorageConfigsNonCRROperations operations, string vaultName, string resourceGroupName) + { + return operations.GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Fetches resource storage config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBackupResourceStorageConfigsNonCRROperations operations, string vaultName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates vault storage model type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault storage config request + /// + public static BackupResourceConfigResource Update(this IBackupResourceStorageConfigsNonCRROperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters) + { + return operations.UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates vault storage model type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault storage config request + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IBackupResourceStorageConfigsNonCRROperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates vault storage model type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault storage config request + /// + public static void Patch(this IBackupResourceStorageConfigsNonCRROperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters) + { + operations.PatchAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates vault storage model type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault storage config request + /// + /// + /// The cancellation token. + /// + public static async Task PatchAsync(this IBackupResourceStorageConfigsNonCRROperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.PatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperations.cs new file mode 100644 index 000000000000..1539936618cc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperations.cs @@ -0,0 +1,658 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupResourceVaultConfigsOperations operations. + /// + internal partial class BackupResourceVaultConfigsOperations : IServiceOperations, IBackupResourceVaultConfigsOperations + { + /// + /// Initializes a new instance of the BackupResourceVaultConfigsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches resource vault config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates vault security config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource config request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates vault security config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource config request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperationsExtensions.cs new file mode 100644 index 000000000000..c7208951dd7b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperationsExtensions.cs @@ -0,0 +1,163 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupResourceVaultConfigsOperations. + /// + public static partial class BackupResourceVaultConfigsOperationsExtensions + { + /// + /// Fetches resource vault config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName) + { + return operations.GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Fetches resource vault config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates vault security config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource config request + /// + public static BackupResourceVaultConfigResource Update(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters) + { + return operations.UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates vault security config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource config request + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates vault security config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource config request + /// + public static BackupResourceVaultConfigResource Put(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters) + { + return operations.PutAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates vault security config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource config request + /// + /// + /// The cancellation token. + /// + public static async Task PutAsync(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperations.cs new file mode 100644 index 000000000000..8fe4f52de154 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperations.cs @@ -0,0 +1,255 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupStatusOperations operations. + /// + internal partial class BackupStatusOperations : IServiceOperations, IBackupStatusOperations + { + /// + /// Initializes a new instance of the BackupStatusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupStatusOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Get the container backup status + /// + /// + /// Azure region to hit Api + /// + /// + /// Container Backup Status Request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string azureRegion, BackupStatusRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (azureRegion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("azureRegion", azureRegion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus").ToString(); + _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperationsExtensions.cs new file mode 100644 index 000000000000..96955310faee --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperationsExtensions.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupStatusOperations. + /// + public static partial class BackupStatusOperationsExtensions + { + /// + /// Get the container backup status + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure region to hit Api + /// + /// + /// Container Backup Status Request + /// + public static BackupStatusResponse Get(this IBackupStatusOperations operations, string azureRegion, BackupStatusRequest parameters) + { + return operations.GetAsync(azureRegion, parameters).GetAwaiter().GetResult(); + } + + /// + /// Get the container backup status + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure region to hit Api + /// + /// + /// Container Backup Status Request + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBackupStatusOperations operations, string azureRegion, BackupStatusRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperations.cs new file mode 100644 index 000000000000..128be67bac7b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperations.cs @@ -0,0 +1,272 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupUsageSummariesOperations operations. + /// + internal partial class BackupUsageSummariesOperations : IServiceOperations, IBackupUsageSummariesOperations + { + /// + /// Initializes a new instance of the BackupUsageSummariesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupUsageSummariesOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches the backup management usage summaries of the vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperationsExtensions.cs new file mode 100644 index 000000000000..059c667ce1b7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperationsExtensions.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupUsageSummariesOperations. + /// + public static partial class BackupUsageSummariesOperationsExtensions + { + /// + /// Fetches the backup management usage summaries of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + public static IEnumerable List(this IBackupUsageSummariesOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Fetches the backup management usage summaries of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBackupUsageSummariesOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperations.cs new file mode 100644 index 000000000000..06d072331658 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperations.cs @@ -0,0 +1,467 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupWorkloadItemsOperations operations. + /// + internal partial class BackupWorkloadItemsOperations : IServiceOperations, IBackupWorkloadItemsOperations + { + /// + /// Initializes a new instance of the BackupWorkloadItemsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides a pageable list of workload item of a specific container according + /// to the query filter and the pagination + /// parameters. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Name of the container. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provides a pageable list of workload item of a specific container according + /// to the query filter and the pagination + /// parameters. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperationsExtensions.cs new file mode 100644 index 000000000000..be55e004e594 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperationsExtensions.cs @@ -0,0 +1,134 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupWorkloadItemsOperations. + /// + public static partial class BackupWorkloadItemsOperationsExtensions + { + /// + /// Provides a pageable list of workload item of a specific container according + /// to the query filter and the pagination + /// parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Name of the container. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + public static IPage List(this IBackupWorkloadItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.ListAsync(vaultName, resourceGroupName, fabricName, containerName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of workload item of a specific container according + /// to the query filter and the pagination + /// parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Name of the container. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IBackupWorkloadItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provides a pageable list of workload item of a specific container according + /// to the query filter and the pagination + /// parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IBackupWorkloadItemsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Provides a pageable list of workload item of a specific container according + /// to the query filter and the pagination + /// parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IBackupWorkloadItemsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs new file mode 100644 index 000000000000..8ec339518a32 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs @@ -0,0 +1,273 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupsOperations operations. + /// + internal partial class BackupsOperations : IServiceOperations, IBackupsOperations + { + /// + /// Initializes a new instance of the BackupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Triggers backup for specified backed up item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item for which backup needs to be triggered. + /// + /// + /// resource backup request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Trigger", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperationsExtensions.cs new file mode 100644 index 000000000000..da3da1d73abf --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperationsExtensions.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupsOperations. + /// + public static partial class BackupsOperationsExtensions + { + /// + /// Triggers backup for specified backed up item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item for which backup needs to be triggered. + /// + /// + /// resource backup request + /// + public static void Trigger(this IBackupsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters) + { + operations.TriggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Triggers backup for specified backed up item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item for which backup needs to be triggered. + /// + /// + /// resource backup request + /// + /// + /// The cancellation token. + /// + public static async Task TriggerAsync(this IBackupsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs new file mode 100644 index 000000000000..bca2e6e8e02c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs @@ -0,0 +1,281 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExportJobsOperationResultsOperations operations. + /// + internal partial class ExportJobsOperationResultsOperations : IServiceOperations, IExportJobsOperationResultsOperations + { + /// + /// Initializes a new instance of the ExportJobsOperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Gets the operation result of operation triggered by Export Jobs API. If the + /// operation is successful, then it also + /// contains URL of a Blob and a SAS key to access the same. The blob contains + /// exported jobs in JSON serialized format. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the export job. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/operationResults/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..677a335e5134 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperationsExtensions.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ExportJobsOperationResultsOperations. + /// + public static partial class ExportJobsOperationResultsOperationsExtensions + { + /// + /// Gets the operation result of operation triggered by Export Jobs API. If the + /// operation is successful, then it also + /// contains URL of a Blob and a SAS key to access the same. The blob contains + /// exported jobs in JSON serialized format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the export job. + /// + public static OperationResultInfoBaseResource Get(this IExportJobsOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets the operation result of operation triggered by Export Jobs API. If the + /// operation is successful, then it also + /// contains URL of a Blob and a SAS key to access the same. The blob contains + /// exported jobs in JSON serialized format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the export job. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExportJobsOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperations.cs new file mode 100644 index 000000000000..6850eef7a84f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperations.cs @@ -0,0 +1,256 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// FeatureSupportOperations operations. + /// + internal partial class FeatureSupportOperations : IServiceOperations, IFeatureSupportOperations + { + /// + /// Initializes a new instance of the FeatureSupportOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal FeatureSupportOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// It will validate if given feature with resource properties is supported in + /// service + /// + /// + /// Azure region to hit Api + /// + /// + /// Feature support request object + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ValidateWithHttpMessagesAsync(string azureRegion, FeatureSupportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (azureRegion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("azureRegion", azureRegion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Validate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures").ToString(); + _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperationsExtensions.cs new file mode 100644 index 000000000000..313340ae0c68 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for FeatureSupportOperations. + /// + public static partial class FeatureSupportOperationsExtensions + { + /// + /// It will validate if given feature with resource properties is supported in + /// service + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure region to hit Api + /// + /// + /// Feature support request object + /// + public static AzureVMResourceFeatureSupportResponse Validate(this IFeatureSupportOperations operations, string azureRegion, FeatureSupportRequest parameters) + { + return operations.ValidateAsync(azureRegion, parameters).GetAwaiter().GetResult(); + } + + /// + /// It will validate if given feature with resource properties is supported in + /// service + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure region to hit Api + /// + /// + /// Feature support request object + /// + /// + /// The cancellation token. + /// + public static async Task ValidateAsync(this IFeatureSupportOperations operations, string azureRegion, FeatureSupportRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(azureRegion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBMSPrepareDataMoveOperationResultOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBMSPrepareDataMoveOperationResultOperations.cs new file mode 100644 index 000000000000..b69d631e073b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBMSPrepareDataMoveOperationResultOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BMSPrepareDataMoveOperationResultOperations operations. + /// + public partial interface IBMSPrepareDataMoveOperationResultOperations + { + /// + /// Fetches Operation Result for Prepare Data Move + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupEnginesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupEnginesOperations.cs new file mode 100644 index 000000000000..d4655c357583 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupEnginesOperations.cs @@ -0,0 +1,120 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupEnginesOperations operations. + /// + public partial interface IBackupEnginesOperations + { + /// + /// Backup management servers registered to Recovery Services Vault. + /// Returns a pageable list of servers. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns backup management server registered to Recovery Services + /// Vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the backup management server. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupEngineName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Backup management servers registered to Recovery Services Vault. + /// Returns a pageable list of servers. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupJobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupJobsOperations.cs new file mode 100644 index 000000000000..5b1d7af253dd --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupJobsOperations.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupJobsOperations operations. + /// + public partial interface IBackupJobsOperations + { + /// + /// Provides a pageable list of jobs. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Provides a pageable list of jobs. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationResultsOperations.cs new file mode 100644 index 000000000000..be5b3099a3ac --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationResultsOperations.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupOperationResultsOperations operations. + /// + public partial interface IBackupOperationResultsOperations + { + /// + /// Provides the status of the delete operations such as deleting + /// backed up item. Once the operation has started, the + /// status code in the response would be Accepted. It will continue to + /// be in this state till it reaches completion. On + /// successful completion, the status code will be OK. This method + /// expects OperationID as an argument. OperationID is + /// part of the Location header of the operation response. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationStatusesOperations.cs new file mode 100644 index 000000000000..f514a80af475 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationStatusesOperations.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupOperationStatusesOperations operations. + /// + public partial interface IBackupOperationStatusesOperations + { + /// + /// Fetches the status of an operation such as triggering a backup, + /// restore. The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the + /// possible states of an operation. Some operations + /// create jobs. This method returns the list of jobs when the + /// operation is complete. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupPoliciesOperations.cs new file mode 100644 index 000000000000..0b5734870718 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupPoliciesOperations.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupPoliciesOperations operations. + /// + public partial interface IBackupPoliciesOperations + { + /// + /// Lists of backup policies associated with Recovery Services Vault. + /// API provides pagination parameters to fetch + /// scoped results. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists of backup policies associated with Recovery Services Vault. + /// API provides pagination parameters to fetch + /// scoped results. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectableItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectableItemsOperations.cs new file mode 100644 index 000000000000..94e07cee74b6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectableItemsOperations.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupProtectableItemsOperations operations. + /// + public partial interface IBackupProtectableItemsOperations + { + /// + /// Provides a pageable list of protectable objects within your + /// subscription according to the query filter and the + /// pagination parameters. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Provides a pageable list of protectable objects within your + /// subscription according to the query filter and the + /// pagination parameters. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsOperations.cs new file mode 100644 index 000000000000..457b5e1a0528 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsOperations.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupProtectedItemsOperations operations. + /// + public partial interface IBackupProtectedItemsOperations + { + /// + /// Provides a pageable list of all items that are backed up within a + /// vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Provides a pageable list of all items that are backed up within a + /// vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionContainersOperations.cs new file mode 100644 index 000000000000..716c158c6620 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionContainersOperations.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupProtectionContainersOperations operations. + /// + public partial interface IBackupProtectionContainersOperations + { + /// + /// Lists the containers registered to Recovery Services Vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the containers registered to Recovery Services Vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionIntentOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionIntentOperations.cs new file mode 100644 index 000000000000..34de2af2760c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionIntentOperations.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupProtectionIntentOperations operations. + /// + public partial interface IBackupProtectionIntentOperations + { + /// + /// Provides a pageable list of all intents that are present within a + /// vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Provides a pageable list of all intents that are present within a + /// vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceEncryptionConfigsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceEncryptionConfigsOperations.cs new file mode 100644 index 000000000000..e831f22920b8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceEncryptionConfigsOperations.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupResourceEncryptionConfigsOperations operations. + /// + public partial interface IBackupResourceEncryptionConfigsOperations + { + /// + /// Fetches Vault Encryption config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates Vault encryption config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault encryption input config request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceEncryptionConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceStorageConfigsNonCRROperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceStorageConfigsNonCRROperations.cs new file mode 100644 index 000000000000..13112dcfed1c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceStorageConfigsNonCRROperations.cs @@ -0,0 +1,108 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupResourceStorageConfigsNonCRROperations operations. + /// + public partial interface IBackupResourceStorageConfigsNonCRROperations + { + /// + /// Fetches resource storage config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates vault storage model type. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault storage config request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates vault storage model type. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Vault storage config request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceVaultConfigsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceVaultConfigsOperations.cs new file mode 100644 index 000000000000..0c94ca97a9a5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceVaultConfigsOperations.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupResourceVaultConfigsOperations operations. + /// + public partial interface IBackupResourceVaultConfigsOperations + { + /// + /// Fetches resource vault config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates vault security config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource config request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates vault security config. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource config request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupStatusOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupStatusOperations.cs new file mode 100644 index 000000000000..b93d51178ca8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupStatusOperations.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupStatusOperations operations. + /// + public partial interface IBackupStatusOperations + { + /// + /// Get the container backup status + /// + /// + /// Azure region to hit Api + /// + /// + /// Container Backup Status Request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string azureRegion, BackupStatusRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupUsageSummariesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupUsageSummariesOperations.cs new file mode 100644 index 000000000000..c84fbf81b462 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupUsageSummariesOperations.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupUsageSummariesOperations operations. + /// + public partial interface IBackupUsageSummariesOperations + { + /// + /// Fetches the backup management usage summaries of the vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupWorkloadItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupWorkloadItemsOperations.cs new file mode 100644 index 000000000000..74bdb3563556 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupWorkloadItemsOperations.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupWorkloadItemsOperations operations. + /// + public partial interface IBackupWorkloadItemsOperations + { + /// + /// Provides a pageable list of workload item of a specific container + /// according to the query filter and the pagination + /// parameters. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Name of the container. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// skipToken Filter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Provides a pageable list of workload item of a specific container + /// according to the query filter and the pagination + /// parameters. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupsOperations.cs new file mode 100644 index 000000000000..c152e3cd8a35 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupsOperations.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupsOperations operations. + /// + public partial interface IBackupsOperations + { + /// + /// Triggers backup for specified backed up item. This is an + /// asynchronous operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item for which backup needs to be triggered. + /// + /// + /// resource backup request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IExportJobsOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IExportJobsOperationResultsOperations.cs new file mode 100644 index 000000000000..ad084fd7013c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IExportJobsOperationResultsOperations.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExportJobsOperationResultsOperations operations. + /// + public partial interface IExportJobsOperationResultsOperations + { + /// + /// Gets the operation result of operation triggered by Export Jobs + /// API. If the operation is successful, then it also + /// contains URL of a Blob and a SAS key to access the same. The blob + /// contains exported jobs in JSON serialized format. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the export job. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IFeatureSupportOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IFeatureSupportOperations.cs new file mode 100644 index 000000000000..1870c7686202 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IFeatureSupportOperations.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// FeatureSupportOperations operations. + /// + public partial interface IFeatureSupportOperations + { + /// + /// It will validate if given feature with resource properties is + /// supported in service + /// + /// + /// Azure region to hit Api + /// + /// + /// Feature support request object + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ValidateWithHttpMessagesAsync(string azureRegion, FeatureSupportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IItemLevelRecoveryConnectionsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IItemLevelRecoveryConnectionsOperations.cs new file mode 100644 index 000000000000..770a73544040 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IItemLevelRecoveryConnectionsOperations.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ItemLevelRecoveryConnectionsOperations operations. + /// + public partial interface IItemLevelRecoveryConnectionsOperations + { + /// + /// Provisions a script which invokes an iSCSI connection to the backup + /// data. Executing this script opens a file + /// explorer displaying all the recoverable files and folders. This is + /// an asynchronous operation. To know the status of + /// provisioning, call GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item name whose files/folders are to be restored. + /// + /// + /// Recovery point ID which represents backed up data. iSCSI connection + /// will be provisioned + /// for this backed up data. + /// + /// + /// resource ILR request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ProvisionWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Revokes an iSCSI connection which can be used to download a script. + /// Executing this script opens a file explorer + /// displaying all recoverable files and folders. This is an + /// asynchronous operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item name whose files/folders are to be restored. + /// + /// + /// Recovery point ID which represents backed up data. iSCSI connection + /// will be revoked for + /// this backed up data. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RevokeWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobCancellationsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobCancellationsOperations.cs new file mode 100644 index 000000000000..4eccb07fd16b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobCancellationsOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobCancellationsOperations operations. + /// + public partial interface IJobCancellationsOperations + { + /// + /// Cancels a job. This is an asynchronous operation. To know the + /// status of the cancellation, call + /// GetCancelOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the job to cancel. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobDetailsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobDetailsOperations.cs new file mode 100644 index 000000000000..4b9d658775ab --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobDetailsOperations.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobDetailsOperations operations. + /// + public partial interface IJobDetailsOperations + { + /// + /// Gets extended information associated with the job. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the job whose details are to be fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobOperationResultsOperations.cs new file mode 100644 index 000000000000..12b9a3436927 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobOperationResultsOperations.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobOperationResultsOperations operations. + /// + public partial interface IJobOperationResultsOperations + { + /// + /// Fetches the result of any operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Job name whose operation result has to be fetched. + /// + /// + /// OperationID which represents the operation whose result has to be + /// fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobsOperations.cs new file mode 100644 index 000000000000..f228dcdf6e5e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobsOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobsOperations operations. + /// + public partial interface IJobsOperations + { + /// + /// Triggers export of jobs specified by filters and returns an + /// OperationID to track. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ExportWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperationOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperationOperations.cs new file mode 100644 index 000000000000..178ed8961c01 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperationOperations.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationOperations operations. + /// + public partial interface IOperationOperations + { + /// + /// Validate operation for specified backed up item. This is a + /// synchronous operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ValidateWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperations.cs new file mode 100644 index 000000000000..7b83082570bc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperations.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Returns the list of available operations. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns the list of available operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointConnectionOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointConnectionOperations.cs new file mode 100644 index 000000000000..2157123768fc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointConnectionOperations.cs @@ -0,0 +1,176 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionOperations operations. + /// + public partial interface IPrivateEndpointConnectionOperations + { + /// + /// Get Private Endpoint Connection. This call is made by Backup Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approve or Reject Private Endpoint requests. This call is made by + /// Backup Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Request body for operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete Private Endpoint requests. This call is made by Backup + /// Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approve or Reject Private Endpoint requests. This call is made by + /// Backup Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Request body for operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginPutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete Private Endpoint requests. This call is made by Backup + /// Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointOperations.cs new file mode 100644 index 000000000000..cd01ac1403a3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointOperations.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointOperations operations. + /// + public partial interface IPrivateEndpointOperations + { + /// + /// Gets the operation status for a private endpoint connection. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Operation id + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetOperationStatusWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectableContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectableContainersOperations.cs new file mode 100644 index 000000000000..cb141bd9cf19 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectableContainersOperations.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectableContainersOperations operations. + /// + public partial interface IProtectableContainersOperations + { + /// + /// Lists the containers that can be registered to Recovery Services + /// Vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the containers that can be registered to Recovery Services + /// Vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationResultsOperations.cs new file mode 100644 index 000000000000..e20249fe28b2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationResultsOperations.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectedItemOperationResultsOperations operations. + /// + public partial interface IProtectedItemOperationResultsOperations + { + /// + /// Fetches the result of any operation on the backup item. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item name whose details are to be fetched. + /// + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationStatusesOperations.cs new file mode 100644 index 000000000000..55f73b091aa0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationStatusesOperations.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectedItemOperationStatusesOperations operations. + /// + public partial interface IProtectedItemOperationStatusesOperations + { + /// + /// Fetches the status of an operation such as triggering a backup, + /// restore. The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the + /// possible states of the operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// the operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item name whose details are to be fetched. + /// + /// + /// OperationID represents the operation whose status needs to be + /// fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemsOperations.cs new file mode 100644 index 000000000000..2ec2ff0b561c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemsOperations.cs @@ -0,0 +1,143 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectedItemsOperations operations. + /// + public partial interface IProtectedItemsOperations + { + /// + /// Provides the details of the backed up item. This is an asynchronous + /// operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enables backup of an item or to modifies the backup policy + /// information of an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call + /// the GetItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Item name to be backed up. + /// + /// + /// resource backed up item + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Used to disable backup of an item within a container. This is an + /// asynchronous operation. To know the status of the + /// request, call the GetItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerOperationResultsOperations.cs new file mode 100644 index 000000000000..77f9daec1509 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerOperationResultsOperations.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionContainerOperationResultsOperations operations. + /// + public partial interface IProtectionContainerOperationResultsOperations + { + /// + /// Fetches the result of any operation on the container. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Container name whose information should be fetched. + /// + /// + /// Operation ID which represents the operation whose result needs to + /// be fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerRefreshOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerRefreshOperationResultsOperations.cs new file mode 100644 index 000000000000..92fc918f3bbf --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerRefreshOperationResultsOperations.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionContainerRefreshOperationResultsOperations operations. + /// + public partial interface IProtectionContainerRefreshOperationResultsOperations + { + /// + /// Provides the result of the refresh operation triggered by the + /// BeginRefresh operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Operation ID associated with the operation whose result needs to be + /// fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainersOperations.cs new file mode 100644 index 000000000000..6fefb5551645 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainersOperations.cs @@ -0,0 +1,200 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionContainersOperations operations. + /// + public partial interface IProtectionContainersOperations + { + /// + /// Gets details of the specific container registered to your Recovery + /// Services Vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the fabric where the container belongs. + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, + /// use location header to call get latest status of + /// the operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Name of the container to be registered. + /// + /// + /// Request body for operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> RegisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Unregisters the given container from your Recovery Services Vault. + /// This is an asynchronous operation. To determine + /// whether the backend service has finished processing the request, + /// call Get Container Operation Result API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the fabric where the container belongs. + /// + /// + /// Name of the container which needs to be unregistered from the + /// Recovery Services Vault. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task UnregisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Inquires all the protectable items under the given container. + /// + /// + /// This is an async operation and the results should be tracked using + /// location header or Azure-async-url. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric Name associated with the container. + /// + /// + /// Name of the container in which inquiry needs to be triggered. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task InquireWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Discovers all the containers in the subscription that can be backed + /// up to Recovery Services Vault. This is an + /// asynchronous operation. To know the status of the operation, call + /// GetRefreshOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated the container. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RefreshWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionIntentOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionIntentOperations.cs new file mode 100644 index 000000000000..86ded50cf6b2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionIntentOperations.cs @@ -0,0 +1,154 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionIntentOperations operations. + /// + public partial interface IProtectionIntentOperations + { + /// + /// It will validate followings + /// 1. Vault capacity + /// 2. VM is already protected + /// 3. Any VM related configuration passed in properties. + /// + /// + /// Azure region to hit Api + /// + /// + /// Enable backup validation request on Virtual Machine + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ValidateWithHttpMessagesAsync(string azureRegion, PreValidateEnableBackupRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Provides the details of the protection intent up item. This is an + /// asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create Intent for Enabling backup of an item. This is a synchronous + /// operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Intent object name. + /// + /// + /// resource backed up item + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Used to remove intent from an item + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the intent. + /// + /// + /// Intent to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPoliciesOperations.cs new file mode 100644 index 000000000000..f816e1096525 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPoliciesOperations.cs @@ -0,0 +1,151 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionPoliciesOperations operations. + /// + public partial interface IProtectionPoliciesOperations + { + /// + /// Provides the details of the backup policies associated to Recovery + /// Services Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using + /// GetPolicyOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy information to be fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or modifies a backup policy. This is an asynchronous + /// operation. Status of the operation can be fetched + /// using GetPolicyOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be created. + /// + /// + /// resource backup policy + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes specified backup policy from your Recovery Services Vault. + /// This is an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult + /// API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes specified backup policy from your Recovery Services Vault. + /// This is an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult + /// API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationResultsOperations.cs new file mode 100644 index 000000000000..06c0549fe83e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationResultsOperations.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionPolicyOperationResultsOperations operations. + /// + public partial interface IProtectionPolicyOperationResultsOperations + { + /// + /// Provides the result of an operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy name whose operation's result needs to be fetched. + /// + /// + /// Operation ID which represents the operation whose result needs to + /// be fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationStatusesOperations.cs new file mode 100644 index 000000000000..0a9ae300d3a3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationStatusesOperations.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionPolicyOperationStatusesOperations operations. + /// + public partial interface IProtectionPolicyOperationStatusesOperations + { + /// + /// Provides the status of the asynchronous operations like backup, + /// restore. The status can be in progress, completed + /// or failed. You can refer to the Operation Status enum for all the + /// possible states of an operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy name whose operation's status needs to be fetched. + /// + /// + /// Operation ID which represents an operation whose status needs to be + /// fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsOperations.cs new file mode 100644 index 000000000000..2d6874694647 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsOperations.cs @@ -0,0 +1,129 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RecoveryPointsOperations operations. + /// + public partial interface IRecoveryPointsOperations + { + /// + /// Lists the backup copies for the backed up item. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item whose backup copies are to be fetched. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Provides the information of the backed up data identified using + /// RecoveryPointID. This is an asynchronous operation. + /// To know the status of the operation, call the + /// GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with backed up item. + /// + /// + /// Container name associated with backed up item. + /// + /// + /// Backed up item name whose backup data needs to be fetched. + /// + /// + /// RecoveryPointID represents the backed up data to be fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the backup copies for the backed up item. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsRecommendedForMoveOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsRecommendedForMoveOperations.cs new file mode 100644 index 000000000000..c6228bc8cc2d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsRecommendedForMoveOperations.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RecoveryPointsRecommendedForMoveOperations operations. + /// + public partial interface IRecoveryPointsRecommendedForMoveOperations + { + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// List Recovery points Recommended for Move Request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryServicesBackupClient.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryServicesBackupClient.cs new file mode 100644 index 000000000000..472257ccabf6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryServicesBackupClient.cs @@ -0,0 +1,479 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Open API 2.0 Specs for Azure RecoveryServices Backup service + /// + public partial interface IRecoveryServicesBackupClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// The subscription Id. + /// + string SubscriptionId { get; set; } + + /// + /// Client Api Version. + /// + string ApiVersion { get; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IBackupResourceStorageConfigsNonCRROperations. + /// + IBackupResourceStorageConfigsNonCRROperations BackupResourceStorageConfigsNonCRR { get; } + + /// + /// Gets the IProtectionIntentOperations. + /// + IProtectionIntentOperations ProtectionIntent { get; } + + /// + /// Gets the IBackupStatusOperations. + /// + IBackupStatusOperations BackupStatus { get; } + + /// + /// Gets the IFeatureSupportOperations. + /// + IFeatureSupportOperations FeatureSupport { get; } + + /// + /// Gets the IBackupProtectionIntentOperations. + /// + IBackupProtectionIntentOperations BackupProtectionIntent { get; } + + /// + /// Gets the IBackupUsageSummariesOperations. + /// + IBackupUsageSummariesOperations BackupUsageSummaries { get; } + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IBackupResourceVaultConfigsOperations. + /// + IBackupResourceVaultConfigsOperations BackupResourceVaultConfigs { get; } + + /// + /// Gets the IBackupResourceEncryptionConfigsOperations. + /// + IBackupResourceEncryptionConfigsOperations BackupResourceEncryptionConfigs { get; } + + /// + /// Gets the IPrivateEndpointConnectionOperations. + /// + IPrivateEndpointConnectionOperations PrivateEndpointConnection { get; } + + /// + /// Gets the IPrivateEndpointOperations. + /// + IPrivateEndpointOperations PrivateEndpoint { get; } + + /// + /// Gets the IBMSPrepareDataMoveOperationResultOperations. + /// + IBMSPrepareDataMoveOperationResultOperations BMSPrepareDataMoveOperationResult { get; } + + /// + /// Gets the IProtectedItemsOperations. + /// + IProtectedItemsOperations ProtectedItems { get; } + + /// + /// Gets the IProtectedItemOperationResultsOperations. + /// + IProtectedItemOperationResultsOperations ProtectedItemOperationResults { get; } + + /// + /// Gets the IRecoveryPointsOperations. + /// + IRecoveryPointsOperations RecoveryPoints { get; } + + /// + /// Gets the IRestoresOperations. + /// + IRestoresOperations Restores { get; } + + /// + /// Gets the IBackupPoliciesOperations. + /// + IBackupPoliciesOperations BackupPolicies { get; } + + /// + /// Gets the IProtectionPoliciesOperations. + /// + IProtectionPoliciesOperations ProtectionPolicies { get; } + + /// + /// Gets the IProtectionPolicyOperationResultsOperations. + /// + IProtectionPolicyOperationResultsOperations ProtectionPolicyOperationResults { get; } + + /// + /// Gets the IBackupJobsOperations. + /// + IBackupJobsOperations BackupJobs { get; } + + /// + /// Gets the IJobDetailsOperations. + /// + IJobDetailsOperations JobDetails { get; } + + /// + /// Gets the IJobCancellationsOperations. + /// + IJobCancellationsOperations JobCancellations { get; } + + /// + /// Gets the IJobOperationResultsOperations. + /// + IJobOperationResultsOperations JobOperationResults { get; } + + /// + /// Gets the IExportJobsOperationResultsOperations. + /// + IExportJobsOperationResultsOperations ExportJobsOperationResults { get; } + + /// + /// Gets the IJobsOperations. + /// + IJobsOperations Jobs { get; } + + /// + /// Gets the IBackupProtectedItemsOperations. + /// + IBackupProtectedItemsOperations BackupProtectedItems { get; } + + /// + /// Gets the IOperationOperations. + /// + IOperationOperations Operation { get; } + + /// + /// Gets the IValidateOperationOperations. + /// + IValidateOperationOperations ValidateOperation { get; } + + /// + /// Gets the IValidateOperationResultsOperations. + /// + IValidateOperationResultsOperations ValidateOperationResults { get; } + + /// + /// Gets the IValidateOperationStatusesOperations. + /// + IValidateOperationStatusesOperations ValidateOperationStatuses { get; } + + /// + /// Gets the IBackupEnginesOperations. + /// + IBackupEnginesOperations BackupEngines { get; } + + /// + /// Gets the IProtectionContainerRefreshOperationResultsOperations. + /// + IProtectionContainerRefreshOperationResultsOperations ProtectionContainerRefreshOperationResults { get; } + + /// + /// Gets the IProtectableContainersOperations. + /// + IProtectableContainersOperations ProtectableContainers { get; } + + /// + /// Gets the IProtectionContainersOperations. + /// + IProtectionContainersOperations ProtectionContainers { get; } + + /// + /// Gets the IBackupWorkloadItemsOperations. + /// + IBackupWorkloadItemsOperations BackupWorkloadItems { get; } + + /// + /// Gets the IProtectionContainerOperationResultsOperations. + /// + IProtectionContainerOperationResultsOperations ProtectionContainerOperationResults { get; } + + /// + /// Gets the IBackupsOperations. + /// + IBackupsOperations Backups { get; } + + /// + /// Gets the IProtectedItemOperationStatusesOperations. + /// + IProtectedItemOperationStatusesOperations ProtectedItemOperationStatuses { get; } + + /// + /// Gets the IItemLevelRecoveryConnectionsOperations. + /// + IItemLevelRecoveryConnectionsOperations ItemLevelRecoveryConnections { get; } + + /// + /// Gets the IBackupOperationResultsOperations. + /// + IBackupOperationResultsOperations BackupOperationResults { get; } + + /// + /// Gets the IBackupOperationStatusesOperations. + /// + IBackupOperationStatusesOperations BackupOperationStatuses { get; } + + /// + /// Gets the IProtectionPolicyOperationStatusesOperations. + /// + IProtectionPolicyOperationStatusesOperations ProtectionPolicyOperationStatuses { get; } + + /// + /// Gets the IBackupProtectableItemsOperations. + /// + IBackupProtectableItemsOperations BackupProtectableItems { get; } + + /// + /// Gets the IBackupProtectionContainersOperations. + /// + IBackupProtectionContainersOperations BackupProtectionContainers { get; } + + /// + /// Gets the ISecurityPINsOperations. + /// + ISecurityPINsOperations SecurityPINs { get; } + + /// + /// Gets the IRecoveryPointsRecommendedForMoveOperations. + /// + IRecoveryPointsRecommendedForMoveOperations RecoveryPointsRecommendedForMove { get; } + + /// + /// Gets the IResourceGuardProxiesOperations. + /// + IResourceGuardProxiesOperations ResourceGuardProxies { get; } + + /// + /// Gets the IResourceGuardProxyOperations. + /// + IResourceGuardProxyOperations ResourceGuardProxy { get; } + + /// + /// Fetches operation status for data move operation on vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetOperationStatusWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Triggers Data Move Operation on target vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Trigger data move request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task MoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BeginBMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Triggers Data Move Operation on target vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Trigger data move request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BeginBMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BeginMoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IResourceGuardProxiesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IResourceGuardProxiesOperations.cs new file mode 100644 index 000000000000..c9136c39db8e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IResourceGuardProxiesOperations.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ResourceGuardProxiesOperations operations. + /// + public partial interface IResourceGuardProxiesOperations + { + /// + /// List the ResourceGuardProxies under vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List the ResourceGuardProxies under vault + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IResourceGuardProxyOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IResourceGuardProxyOperations.cs new file mode 100644 index 000000000000..e7580fbde6be --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IResourceGuardProxyOperations.cs @@ -0,0 +1,141 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ResourceGuardProxyOperations operations. + /// + public partial interface IResourceGuardProxyOperations + { + /// + /// Returns ResourceGuardProxy under vault and with the name referenced + /// in request + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete ResourceGuardProxy under vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Secures delete ResourceGuardProxy operations. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// Request body for operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UnlockDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, UnlockDeleteRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRestoresOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRestoresOperations.cs new file mode 100644 index 000000000000..b28a4e2c03e3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRestoresOperations.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RestoresOperations operations. + /// + public partial interface IRestoresOperations + { + /// + /// Restores the specified backed up data. This is an asynchronous + /// operation. To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be + /// restored. + /// + /// + /// resource restore request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Restores the specified backed up data. This is an asynchronous + /// operation. To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be + /// restored. + /// + /// + /// resource restore request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ISecurityPINsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ISecurityPINsOperations.cs new file mode 100644 index 000000000000..66a54ba927b4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ISecurityPINsOperations.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SecurityPINsOperations operations. + /// + public partial interface ISecurityPINsOperations + { + /// + /// Get the security PIN. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// ResourceGuard Operation Requests + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, IList resourceGuardOperationRequests = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationOperations.cs new file mode 100644 index 000000000000..80c77bb50e78 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationOperations.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ValidateOperationOperations operations. + /// + public partial interface IValidateOperationOperations + { + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be + /// tracked using GetValidateOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be + /// tracked using GetValidateOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationResultsOperations.cs new file mode 100644 index 000000000000..26b982ac7108 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationResultsOperations.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ValidateOperationResultsOperations operations. + /// + public partial interface IValidateOperationResultsOperations + { + /// + /// Fetches the result of a triggered validate operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationStatusesOperations.cs new file mode 100644 index 000000000000..cc157a42ad9b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationStatusesOperations.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ValidateOperationStatusesOperations operations. + /// + public partial interface IValidateOperationStatusesOperations + { + /// + /// Fetches the status of a triggered validate operation. The status + /// can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the + /// possible states of the operation. + /// If operation has completed, this method returns the list of errors + /// obtained while validating the operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID represents the operation whose status needs to be + /// fetched. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperations.cs new file mode 100644 index 000000000000..3d4450b76e3a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperations.cs @@ -0,0 +1,503 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ItemLevelRecoveryConnectionsOperations operations. + /// + internal partial class ItemLevelRecoveryConnectionsOperations : IServiceOperations, IItemLevelRecoveryConnectionsOperations + { + /// + /// Initializes a new instance of the ItemLevelRecoveryConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provisions a script which invokes an iSCSI connection to the backup data. + /// Executing this script opens a file + /// explorer displaying all the recoverable files and folders. This is an + /// asynchronous operation. To know the status of + /// provisioning, call GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item name whose files/folders are to be restored. + /// + /// + /// Recovery point ID which represents backed up data. iSCSI connection will be + /// provisioned + /// for this backed up data. + /// + /// + /// resource ILR request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ProvisionWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (recoveryPointId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("recoveryPointId", recoveryPointId); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Provision", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Revokes an iSCSI connection which can be used to download a script. + /// Executing this script opens a file explorer + /// displaying all recoverable files and folders. This is an asynchronous + /// operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item name whose files/folders are to be restored. + /// + /// + /// Recovery point ID which represents backed up data. iSCSI connection will be + /// revoked for + /// this backed up data. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task RevokeWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (recoveryPointId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("recoveryPointId", recoveryPointId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Revoke", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..c3e25242af48 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperationsExtensions.cs @@ -0,0 +1,179 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ItemLevelRecoveryConnectionsOperations. + /// + public static partial class ItemLevelRecoveryConnectionsOperationsExtensions + { + /// + /// Provisions a script which invokes an iSCSI connection to the backup data. + /// Executing this script opens a file + /// explorer displaying all the recoverable files and folders. This is an + /// asynchronous operation. To know the status of + /// provisioning, call GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item name whose files/folders are to be restored. + /// + /// + /// Recovery point ID which represents backed up data. iSCSI connection will be + /// provisioned + /// for this backed up data. + /// + /// + /// resource ILR request + /// + public static void Provision(this IItemLevelRecoveryConnectionsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters) + { + operations.ProvisionAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Provisions a script which invokes an iSCSI connection to the backup data. + /// Executing this script opens a file + /// explorer displaying all the recoverable files and folders. This is an + /// asynchronous operation. To know the status of + /// provisioning, call GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item name whose files/folders are to be restored. + /// + /// + /// Recovery point ID which represents backed up data. iSCSI connection will be + /// provisioned + /// for this backed up data. + /// + /// + /// resource ILR request + /// + /// + /// The cancellation token. + /// + public static async Task ProvisionAsync(this IItemLevelRecoveryConnectionsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ProvisionWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Revokes an iSCSI connection which can be used to download a script. + /// Executing this script opens a file explorer + /// displaying all recoverable files and folders. This is an asynchronous + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item name whose files/folders are to be restored. + /// + /// + /// Recovery point ID which represents backed up data. iSCSI connection will be + /// revoked for + /// this backed up data. + /// + public static void Revoke(this IItemLevelRecoveryConnectionsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId) + { + operations.RevokeAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).GetAwaiter().GetResult(); + } + + /// + /// Revokes an iSCSI connection which can be used to download a script. + /// Executing this script opens a file explorer + /// displaying all recoverable files and folders. This is an asynchronous + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item name whose files/folders are to be restored. + /// + /// + /// Recovery point ID which represents backed up data. iSCSI connection will be + /// revoked for + /// this backed up data. + /// + /// + /// The cancellation token. + /// + public static async Task RevokeAsync(this IItemLevelRecoveryConnectionsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RevokeWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs new file mode 100644 index 000000000000..d0860d8c4e8e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs @@ -0,0 +1,241 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobCancellationsOperations operations. + /// + internal partial class JobCancellationsOperations : IServiceOperations, IJobCancellationsOperations + { + /// + /// Initializes a new instance of the JobCancellationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal JobCancellationsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Cancels a job. This is an asynchronous operation. To know the status of the + /// cancellation, call + /// GetCancelOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the job to cancel. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (jobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("jobName", jobName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Trigger", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperationsExtensions.cs new file mode 100644 index 000000000000..b7f48e152ea6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperationsExtensions.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for JobCancellationsOperations. + /// + public static partial class JobCancellationsOperationsExtensions + { + /// + /// Cancels a job. This is an asynchronous operation. To know the status of the + /// cancellation, call + /// GetCancelOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the job to cancel. + /// + public static void Trigger(this IJobCancellationsOperations operations, string vaultName, string resourceGroupName, string jobName) + { + operations.TriggerAsync(vaultName, resourceGroupName, jobName).GetAwaiter().GetResult(); + } + + /// + /// Cancels a job. This is an asynchronous operation. To know the status of the + /// cancellation, call + /// GetCancelOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the job to cancel. + /// + /// + /// The cancellation token. + /// + public static async Task TriggerAsync(this IJobCancellationsOperations operations, string vaultName, string resourceGroupName, string jobName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, jobName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs new file mode 100644 index 000000000000..04b62e89ef0d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs @@ -0,0 +1,260 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobDetailsOperations operations. + /// + internal partial class JobDetailsOperations : IServiceOperations, IJobDetailsOperations + { + /// + /// Initializes a new instance of the JobDetailsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal JobDetailsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Gets extended information associated with the job. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the job whose details are to be fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (jobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("jobName", jobName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperationsExtensions.cs new file mode 100644 index 000000000000..37c20f7309c6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperationsExtensions.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for JobDetailsOperations. + /// + public static partial class JobDetailsOperationsExtensions + { + /// + /// Gets extended information associated with the job. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the job whose details are to be fetched. + /// + public static JobResource Get(this IJobDetailsOperations operations, string vaultName, string resourceGroupName, string jobName) + { + return operations.GetAsync(vaultName, resourceGroupName, jobName).GetAwaiter().GetResult(); + } + + /// + /// Gets extended information associated with the job. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the job whose details are to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IJobDetailsOperations operations, string vaultName, string resourceGroupName, string jobName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, jobName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs new file mode 100644 index 000000000000..bb11e13d4d4e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs @@ -0,0 +1,248 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobOperationResultsOperations operations. + /// + internal partial class JobOperationResultsOperations : IServiceOperations, IJobOperationResultsOperations + { + /// + /// Initializes a new instance of the JobOperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal JobOperationResultsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches the result of any operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Job name whose operation result has to be fetched. + /// + /// + /// OperationID which represents the operation whose result has to be fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (jobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("jobName", jobName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..21da091c2a80 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperationsExtensions.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for JobOperationResultsOperations. + /// + public static partial class JobOperationResultsOperationsExtensions + { + /// + /// Fetches the result of any operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Job name whose operation result has to be fetched. + /// + /// + /// OperationID which represents the operation whose result has to be fetched. + /// + public static void Get(this IJobOperationResultsOperations operations, string vaultName, string resourceGroupName, string jobName, string operationId) + { + operations.GetAsync(vaultName, resourceGroupName, jobName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches the result of any operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Job name whose operation result has to be fetched. + /// + /// + /// OperationID which represents the operation whose result has to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IJobOperationResultsOperations operations, string vaultName, string resourceGroupName, string jobName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, jobName, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs new file mode 100644 index 000000000000..5fb8984b9e4d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs @@ -0,0 +1,244 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobsOperations operations. + /// + internal partial class JobsOperations : IServiceOperations, IJobsOperations + { + /// + /// Initializes a new instance of the JobsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal JobsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Triggers export of jobs specified by filters and returns an OperationID to + /// track. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ExportWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Export", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobsExport").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperationsExtensions.cs new file mode 100644 index 000000000000..4c558e364303 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperationsExtensions.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for JobsOperations. + /// + public static partial class JobsOperationsExtensions + { + /// + /// Triggers export of jobs specified by filters and returns an OperationID to + /// track. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + public static void Export(this IJobsOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery)) + { + operations.ExportAsync(vaultName, resourceGroupName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Triggers export of jobs specified by filters and returns an OperationID to + /// track. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task ExportAsync(this IJobsOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ExportWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AcquireStorageAccountLock.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AcquireStorageAccountLock.cs new file mode 100644 index 000000000000..3f7b3c2b8aff --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AcquireStorageAccountLock.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for AcquireStorageAccountLock. + /// + public static class AcquireStorageAccountLock + { + public const string Acquire = "Acquire"; + public const string NotAcquire = "NotAcquire"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupGoalFeatureSupportRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupGoalFeatureSupportRequest.cs new file mode 100644 index 000000000000..86cca3ce5398 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupGoalFeatureSupportRequest.cs @@ -0,0 +1,38 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure backup goal feature specific request. + /// + [Newtonsoft.Json.JsonObject("AzureBackupGoals")] + public partial class AzureBackupGoalFeatureSupportRequest : FeatureSupportRequest + { + /// + /// Initializes a new instance of the + /// AzureBackupGoalFeatureSupportRequest class. + /// + public AzureBackupGoalFeatureSupportRequest() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerContainer.cs new file mode 100644 index 000000000000..824da1a679d4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerContainer.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureBackupServer (DPMVenus) workload-specific protection container. + /// + public partial class AzureBackupServerContainer : DpmContainer + { + /// + /// Initializes a new instance of the AzureBackupServerContainer class. + /// + public AzureBackupServerContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureBackupServerContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// Specifies whether the container is + /// re-registrable. + /// ID of container. + /// Number of protected items in the + /// BackupEngine + /// Backup engine Agent version + /// List of BackupEngines protecting the + /// container + /// To check if upgrade + /// available + /// Protection status of the + /// container. + /// Extended Info of the container. + public AzureBackupServerContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), IList dpmServers = default(IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, canReRegister, containerId, protectedItemCount, dpmAgentVersion, dpmServers, upgradeAvailable, protectionStatus, extendedInfo) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerEngine.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerEngine.cs new file mode 100644 index 000000000000..4f9fc53ab55f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerEngine.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Backup engine type when Azure Backup Server is used to manage the + /// backups. + /// + public partial class AzureBackupServerEngine : BackupEngineBase + { + /// + /// Initializes a new instance of the AzureBackupServerEngine class. + /// + public AzureBackupServerEngine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureBackupServerEngine class. + /// + /// Friendly name of the backup + /// engine. + /// Type of backup management for + /// the backup engine. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Registration status of the backup + /// engine with the Recovery Services Vault. + /// Status of the backup engine with + /// the Recovery Services Vault. = + /// {Active/Deleting/DeleteFailed} + /// Backup status of the backup + /// engine. + /// Flag indicating if the backup engine be + /// registered, once already registered. + /// ID of the backup engine. + /// Backup engine version + /// Backup agent version + /// To check if backup + /// agent upgrade available + /// To check if backup engine + /// upgrade available + /// Extended info of the + /// backupengine + public AzureBackupServerEngine(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string backupEngineState = default(string), string healthStatus = default(string), bool? canReRegister = default(bool?), string backupEngineId = default(string), string dpmVersion = default(string), string azureBackupAgentVersion = default(string), bool? isAzureBackupAgentUpgradeAvailable = default(bool?), bool? isDpmUpgradeAvailable = default(bool?), BackupEngineExtendedInfo extendedInfo = default(BackupEngineExtendedInfo)) + : base(friendlyName, backupManagementType, registrationStatus, backupEngineState, healthStatus, canReRegister, backupEngineId, dpmVersion, azureBackupAgentVersion, isAzureBackupAgentUpgradeAvailable, isDpmUpgradeAvailable, extendedInfo) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareBackupRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareBackupRequest.cs new file mode 100644 index 000000000000..31e193aded3f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareBackupRequest.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// AzureFileShare workload-specific backup request. + /// + public partial class AzureFileShareBackupRequest : BackupRequest + { + /// + /// Initializes a new instance of the AzureFileShareBackupRequest + /// class. + /// + public AzureFileShareBackupRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFileShareBackupRequest + /// class. + /// + /// Backup copy will expire + /// after the time specified (UTC). + public AzureFileShareBackupRequest(System.DateTime? recoveryPointExpiryTimeInUTC = default(System.DateTime?)) + { + RecoveryPointExpiryTimeInUTC = recoveryPointExpiryTimeInUTC; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup copy will expire after the time specified + /// (UTC). + /// + [JsonProperty(PropertyName = "recoveryPointExpiryTimeInUTC")] + public System.DateTime? RecoveryPointExpiryTimeInUTC { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProtectableItem.cs new file mode 100644 index 000000000000..3711ae672073 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProtectableItem.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Protectable item for Azure Fileshare workloads. + /// + [Newtonsoft.Json.JsonObject("AzureFileShare")] + public partial class AzureFileShareProtectableItem : WorkloadProtectableItem + { + /// + /// Initializes a new instance of the AzureFileShareProtectableItem + /// class. + /// + public AzureFileShareProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFileShareProtectableItem + /// class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Full Fabric ID of container + /// to which this protectable item belongs. For example, ARM + /// ID. + /// Friendly name of + /// container to which this protectable item belongs. + /// File Share type XSync or XSMB. + /// Possible values include: 'Invalid', 'XSMB', 'XSync' + public AzureFileShareProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentContainerFabricId = default(string), string parentContainerFriendlyName = default(string), string azureFileShareType = default(string)) + : base(backupManagementType, workloadType, friendlyName, protectionState) + { + ParentContainerFabricId = parentContainerFabricId; + ParentContainerFriendlyName = parentContainerFriendlyName; + AzureFileShareType = azureFileShareType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets full Fabric ID of container to which this protectable + /// item belongs. For example, ARM ID. + /// + [JsonProperty(PropertyName = "parentContainerFabricId")] + public string ParentContainerFabricId { get; set; } + + /// + /// Gets or sets friendly name of container to which this protectable + /// item belongs. + /// + [JsonProperty(PropertyName = "parentContainerFriendlyName")] + public string ParentContainerFriendlyName { get; set; } + + /// + /// Gets or sets file Share type XSync or XSMB. Possible values + /// include: 'Invalid', 'XSMB', 'XSync' + /// + [JsonProperty(PropertyName = "azureFileShareType")] + public string AzureFileShareType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProtectionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProtectionPolicy.cs new file mode 100644 index 000000000000..30e44d17d939 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProtectionPolicy.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureStorage backup policy. + /// + [Newtonsoft.Json.JsonObject("AzureStorage")] + public partial class AzureFileShareProtectionPolicy : ProtectionPolicy + { + /// + /// Initializes a new instance of the AzureFileShareProtectionPolicy + /// class. + /// + public AzureFileShareProtectionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFileShareProtectionPolicy + /// class. + /// + /// Number of items associated with + /// this policy. + /// ResourceGuard + /// Operation Requests + /// Type of workload for the backup + /// management. Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Backup schedule specified as part of + /// backup policy. + /// Retention policy with the details on + /// backup copy retention ranges. + /// TimeZone optional input as string. For + /// example: TimeZone = "Pacific Standard Time". + public AzureFileShareProtectionPolicy(int? protectedItemsCount = default(int?), IList resourceGuardOperationRequests = default(IList), string workLoadType = default(string), SchedulePolicy schedulePolicy = default(SchedulePolicy), RetentionPolicy retentionPolicy = default(RetentionPolicy), string timeZone = default(string)) + : base(protectedItemsCount, resourceGuardOperationRequests) + { + WorkLoadType = workLoadType; + SchedulePolicy = schedulePolicy; + RetentionPolicy = retentionPolicy; + TimeZone = timeZone; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of workload for the backup management. Possible + /// values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', + /// 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', + /// 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workLoadType")] + public string WorkLoadType { get; set; } + + /// + /// Gets or sets backup schedule specified as part of backup policy. + /// + [JsonProperty(PropertyName = "schedulePolicy")] + public SchedulePolicy SchedulePolicy { get; set; } + + /// + /// Gets or sets retention policy with the details on backup copy + /// retention ranges. + /// + [JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + + /// + /// Gets or sets timeZone optional input as string. For example: + /// TimeZone = "Pacific Standard Time". + /// + [JsonProperty(PropertyName = "timeZone")] + public string TimeZone { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProvisionILRRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProvisionILRRequest.cs new file mode 100644 index 000000000000..4223448c1d6d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareProvisionILRRequest.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Update snapshot Uri with the correct friendly Name of the source Azure + /// file share. + /// + public partial class AzureFileShareProvisionILRRequest : ILRRequest + { + /// + /// Initializes a new instance of the AzureFileShareProvisionILRRequest + /// class. + /// + public AzureFileShareProvisionILRRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFileShareProvisionILRRequest + /// class. + /// + /// Recovery point ID. + /// Source Storage account ARM + /// Id + public AzureFileShareProvisionILRRequest(string recoveryPointId = default(string), string sourceResourceId = default(string)) + { + RecoveryPointId = recoveryPointId; + SourceResourceId = sourceResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets recovery point ID. + /// + [JsonProperty(PropertyName = "recoveryPointId")] + public string RecoveryPointId { get; set; } + + /// + /// Gets or sets source Storage account ARM Id + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRecoveryPoint.cs new file mode 100644 index 000000000000..5489504fbc3c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRecoveryPoint.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure File Share workload specific backup copy. + /// + public partial class AzureFileShareRecoveryPoint : RecoveryPoint + { + /// + /// Initializes a new instance of the AzureFileShareRecoveryPoint + /// class. + /// + public AzureFileShareRecoveryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFileShareRecoveryPoint + /// class. + /// + /// Type of the backup copy. Specifies + /// whether it is a crash consistent backup or app consistent. + /// Time at which this backup copy was + /// created. + /// Contains Url to the snapshot of + /// fileshare, if applicable + /// Contains recovery point + /// size + public AzureFileShareRecoveryPoint(string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string fileShareSnapshotUri = default(string), int? recoveryPointSizeInGB = default(int?)) + { + RecoveryPointType = recoveryPointType; + RecoveryPointTime = recoveryPointTime; + FileShareSnapshotUri = fileShareSnapshotUri; + RecoveryPointSizeInGB = recoveryPointSizeInGB; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of the backup copy. Specifies whether it is a + /// crash consistent backup or app consistent. + /// + [JsonProperty(PropertyName = "recoveryPointType")] + public string RecoveryPointType { get; set; } + + /// + /// Gets or sets time at which this backup copy was created. + /// + [JsonProperty(PropertyName = "recoveryPointTime")] + public System.DateTime? RecoveryPointTime { get; set; } + + /// + /// Gets or sets contains Url to the snapshot of fileshare, if + /// applicable + /// + [JsonProperty(PropertyName = "fileShareSnapshotUri")] + public string FileShareSnapshotUri { get; set; } + + /// + /// Gets or sets contains recovery point size + /// + [JsonProperty(PropertyName = "recoveryPointSizeInGB")] + public int? RecoveryPointSizeInGB { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRestoreRequest.cs new file mode 100644 index 000000000000..45a52a72c995 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRestoreRequest.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureFileShare Restore Request + /// + public partial class AzureFileShareRestoreRequest : RestoreRequest + { + /// + /// Initializes a new instance of the AzureFileShareRestoreRequest + /// class. + /// + public AzureFileShareRestoreRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFileShareRestoreRequest + /// class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Source storage account ARM + /// Id + /// Options to resolve copy conflicts. + /// Possible values include: 'Invalid', 'CreateCopy', 'Skip', + /// 'Overwrite', 'FailOnConflict' + /// Restore Type (FullShareRestore or + /// ItemLevelRestore). Possible values include: 'Invalid', + /// 'FullShareRestore', 'ItemLevelRestore' + /// List of Source Files/Folders(which + /// need to recover) and TargetFolderPath details + /// Target File Share Details + public AzureFileShareRestoreRequest(string recoveryType = default(string), string sourceResourceId = default(string), string copyOptions = default(string), string restoreRequestType = default(string), IList restoreFileSpecs = default(IList), TargetAFSRestoreInfo targetDetails = default(TargetAFSRestoreInfo)) + { + RecoveryType = recoveryType; + SourceResourceId = sourceResourceId; + CopyOptions = copyOptions; + RestoreRequestType = restoreRequestType; + RestoreFileSpecs = restoreFileSpecs; + TargetDetails = targetDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of this recovery. Possible values include: + /// 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', + /// 'Offline' + /// + [JsonProperty(PropertyName = "recoveryType")] + public string RecoveryType { get; set; } + + /// + /// Gets or sets source storage account ARM Id + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + /// + /// Gets or sets options to resolve copy conflicts. Possible values + /// include: 'Invalid', 'CreateCopy', 'Skip', 'Overwrite', + /// 'FailOnConflict' + /// + [JsonProperty(PropertyName = "copyOptions")] + public string CopyOptions { get; set; } + + /// + /// Gets or sets restore Type (FullShareRestore or ItemLevelRestore). + /// Possible values include: 'Invalid', 'FullShareRestore', + /// 'ItemLevelRestore' + /// + [JsonProperty(PropertyName = "restoreRequestType")] + public string RestoreRequestType { get; set; } + + /// + /// Gets or sets list of Source Files/Folders(which need to recover) + /// and TargetFolderPath details + /// + [JsonProperty(PropertyName = "restoreFileSpecs")] + public IList RestoreFileSpecs { get; set; } + + /// + /// Gets or sets target File Share Details + /// + [JsonProperty(PropertyName = "targetDetails")] + public TargetAFSRestoreInfo TargetDetails { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareType.cs new file mode 100644 index 000000000000..7ac97297a1d5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for AzureFileShareType. + /// + public static class AzureFileShareType + { + public const string Invalid = "Invalid"; + public const string XSMB = "XSMB"; + public const string XSync = "XSync"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs new file mode 100644 index 000000000000..0b68140c1e37 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs @@ -0,0 +1,155 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure File Share workload-specific backup item. + /// + [Newtonsoft.Json.JsonObject("AzureFileShareProtectedItem")] + public partial class AzureFileshareProtectedItem : ProtectedItem + { + /// + /// Initializes a new instance of the AzureFileshareProtectedItem + /// class. + /// + public AzureFileshareProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFileshareProtectedItem + /// class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the fileshare + /// represented by this backup item. + /// Backup status of this backup + /// item. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Last backup operation status. + /// Possible values: Healthy, Unhealthy. + /// Timestamp of the last backup operation + /// on this backup item. + /// Health details of different KPIs + /// Additional information with this backup + /// item. + public AzureFileshareProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), IDictionary kpisHealths = default(IDictionary), AzureFileshareProtectedItemExtendedInfo extendedInfo = default(AzureFileshareProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) + { + FriendlyName = friendlyName; + ProtectionStatus = protectionStatus; + ProtectionState = protectionState; + LastBackupStatus = lastBackupStatus; + LastBackupTime = lastBackupTime; + KpisHealths = kpisHealths; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the fileshare represented by this + /// backup item. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets backup status of this backup item. + /// + [JsonProperty(PropertyName = "protectionStatus")] + public string ProtectionStatus { get; set; } + + /// + /// Gets or sets backup state of this backup item. Possible values + /// include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', + /// 'ProtectionStopped', 'ProtectionPaused' + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + /// + /// Gets or sets last backup operation status. Possible values: + /// Healthy, Unhealthy. + /// + [JsonProperty(PropertyName = "lastBackupStatus")] + public string LastBackupStatus { get; set; } + + /// + /// Gets or sets timestamp of the last backup operation on this backup + /// item. + /// + [JsonProperty(PropertyName = "lastBackupTime")] + public System.DateTime? LastBackupTime { get; set; } + + /// + /// Gets or sets health details of different KPIs + /// + [JsonProperty(PropertyName = "kpisHealths")] + public IDictionary KpisHealths { get; set; } + + /// + /// Gets or sets additional information with this backup item. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureFileshareProtectedItemExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItemExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..677953657036 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItemExtendedInfo.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional information about Azure File Share backup item. + /// + public partial class AzureFileshareProtectedItemExtendedInfo + { + /// + /// Initializes a new instance of the + /// AzureFileshareProtectedItemExtendedInfo class. + /// + public AzureFileshareProtectedItemExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureFileshareProtectedItemExtendedInfo class. + /// + /// The oldest backup copy available + /// for this item in the service. + /// Number of available backup copies + /// associated with this backup item. + /// Indicates consistency of policy object + /// and policy applied to this backup item. + /// Indicates the state of this resource. + /// Possible values are from enum ResourceState {Invalid, Active, + /// SoftDeleted, Deleted} + /// The resource state sync time + /// for this backup item. + public AzureFileshareProtectedItemExtendedInfo(System.DateTime? oldestRecoveryPoint = default(System.DateTime?), int? recoveryPointCount = default(int?), string policyState = default(string), string resourceState = default(string), System.DateTime? resourceStateSyncTime = default(System.DateTime?)) + { + OldestRecoveryPoint = oldestRecoveryPoint; + RecoveryPointCount = recoveryPointCount; + PolicyState = policyState; + ResourceState = resourceState; + ResourceStateSyncTime = resourceStateSyncTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the oldest backup copy available for this item in the + /// service. + /// + [JsonProperty(PropertyName = "oldestRecoveryPoint")] + public System.DateTime? OldestRecoveryPoint { get; set; } + + /// + /// Gets or sets number of available backup copies associated with this + /// backup item. + /// + [JsonProperty(PropertyName = "recoveryPointCount")] + public int? RecoveryPointCount { get; set; } + + /// + /// Gets or sets indicates consistency of policy object and policy + /// applied to this backup item. + /// + [JsonProperty(PropertyName = "policyState")] + public string PolicyState { get; set; } + + /// + /// Gets indicates the state of this resource. Possible values are from + /// enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + /// + [JsonProperty(PropertyName = "resourceState")] + public string ResourceState { get; private set; } + + /// + /// Gets the resource state sync time for this backup item. + /// + [JsonProperty(PropertyName = "resourceStateSyncTime")] + public System.DateTime? ResourceStateSyncTime { get; private set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMContainer.cs new file mode 100644 index 000000000000..8730ffa6a92b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMContainer.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// IaaS VM workload-specific backup item representing a classic virtual + /// machine. + /// + [Newtonsoft.Json.JsonObject("Microsoft.ClassicCompute/virtualMachines")] + public partial class AzureIaaSClassicComputeVMContainer : IaaSVMContainer + { + /// + /// Initializes a new instance of the + /// AzureIaaSClassicComputeVMContainer class. + /// + public AzureIaaSClassicComputeVMContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureIaaSClassicComputeVMContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// Fully qualified ARM url of the + /// virtual machine represented by this Azure IaaS VM + /// container. + /// Specifies whether the container + /// represents a Classic or an Azure Resource Manager VM. + /// Resource group name of Recovery + /// Services Vault. + public AzureIaaSClassicComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, virtualMachineId, virtualMachineVersion, resourceGroup) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectableItem.cs new file mode 100644 index 000000000000..fc0d07a25829 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectableItem.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// IaaS VM workload-specific backup item representing the Classic Compute + /// VM. + /// + [Newtonsoft.Json.JsonObject("Microsoft.ClassicCompute/virtualMachines")] + public partial class AzureIaaSClassicComputeVMProtectableItem : IaaSVMProtectableItem + { + /// + /// Initializes a new instance of the + /// AzureIaaSClassicComputeVMProtectableItem class. + /// + public AzureIaaSClassicComputeVMProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureIaaSClassicComputeVMProtectableItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Fully qualified ARM ID of the + /// virtual machine. + /// Specifies whether the container + /// represents a Classic or an Azure Resource Manager VM. + /// Resource group name of Recovery + /// Services Vault. + public AzureIaaSClassicComputeVMProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(backupManagementType, workloadType, friendlyName, protectionState, virtualMachineId, virtualMachineVersion, resourceGroup) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs new file mode 100644 index 000000000000..e5974333d78a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IaaS VM workload-specific backup item representing the Classic Compute + /// VM. + /// + [Newtonsoft.Json.JsonObject("Microsoft.ClassicCompute/virtualMachines")] + public partial class AzureIaaSClassicComputeVMProtectedItem : AzureIaaSVMProtectedItem + { + /// + /// Initializes a new instance of the + /// AzureIaaSClassicComputeVMProtectedItem class. + /// + public AzureIaaSClassicComputeVMProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureIaaSClassicComputeVMProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the VM represented by + /// this backup item. + /// Fully qualified ARM ID of the + /// virtual machine represented by this item. + /// Backup status of this backup + /// item. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Health status of protected item. + /// Possible values include: 'Passed', 'ActionRequired', + /// 'ActionSuggested', 'Invalid' + /// Health details on this backup + /// item. + /// Health details of different KPIs + /// Last backup operation + /// status. + /// Timestamp of the last backup operation + /// on this backup item. + /// Data ID of the protected + /// item. + /// Additional information for this backup + /// item. + public AzureIaaSClassicComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), IDictionary kpisHealths = default(IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMContainer.cs new file mode 100644 index 000000000000..2bdd6922652a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMContainer.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// IaaS VM workload-specific backup item representing an Azure Resource + /// Manager virtual machine. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Compute/virtualMachines")] + public partial class AzureIaaSComputeVMContainer : IaaSVMContainer + { + /// + /// Initializes a new instance of the AzureIaaSComputeVMContainer + /// class. + /// + public AzureIaaSComputeVMContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSComputeVMContainer + /// class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// Fully qualified ARM url of the + /// virtual machine represented by this Azure IaaS VM + /// container. + /// Specifies whether the container + /// represents a Classic or an Azure Resource Manager VM. + /// Resource group name of Recovery + /// Services Vault. + public AzureIaaSComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, virtualMachineId, virtualMachineVersion, resourceGroup) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectableItem.cs new file mode 100644 index 000000000000..59ac2c12a87b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectableItem.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// IaaS VM workload-specific backup item representing the Azure Resource + /// Manager VM. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Compute/virtualMachines")] + public partial class AzureIaaSComputeVMProtectableItem : IaaSVMProtectableItem + { + /// + /// Initializes a new instance of the AzureIaaSComputeVMProtectableItem + /// class. + /// + public AzureIaaSComputeVMProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSComputeVMProtectableItem + /// class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Fully qualified ARM ID of the + /// virtual machine. + /// Specifies whether the container + /// represents a Classic or an Azure Resource Manager VM. + /// Resource group name of Recovery + /// Services Vault. + public AzureIaaSComputeVMProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(backupManagementType, workloadType, friendlyName, protectionState, virtualMachineId, virtualMachineVersion, resourceGroup) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs new file mode 100644 index 000000000000..3f2dcc8302b7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IaaS VM workload-specific backup item representing the Azure Resource + /// Manager VM. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Compute/virtualMachines")] + public partial class AzureIaaSComputeVMProtectedItem : AzureIaaSVMProtectedItem + { + /// + /// Initializes a new instance of the AzureIaaSComputeVMProtectedItem + /// class. + /// + public AzureIaaSComputeVMProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSComputeVMProtectedItem + /// class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the VM represented by + /// this backup item. + /// Fully qualified ARM ID of the + /// virtual machine represented by this item. + /// Backup status of this backup + /// item. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Health status of protected item. + /// Possible values include: 'Passed', 'ActionRequired', + /// 'ActionSuggested', 'Invalid' + /// Health details on this backup + /// item. + /// Health details of different KPIs + /// Last backup operation + /// status. + /// Timestamp of the last backup operation + /// on this backup item. + /// Data ID of the protected + /// item. + /// Additional information for this backup + /// item. + public AzureIaaSComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), IDictionary kpisHealths = default(IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMErrorInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMErrorInfo.cs new file mode 100644 index 000000000000..3697f94b4e6f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMErrorInfo.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure IaaS VM workload-specific error information. + /// + public partial class AzureIaaSVMErrorInfo + { + /// + /// Initializes a new instance of the AzureIaaSVMErrorInfo class. + /// + public AzureIaaSVMErrorInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSVMErrorInfo class. + /// + /// Error code. + /// Title: Typically, the entity that the + /// error pertains to. + /// Localized error string. + /// List of localized recommendations for + /// above error code. + public AzureIaaSVMErrorInfo(int? errorCode = default(int?), string errorTitle = default(string), string errorString = default(string), IList recommendations = default(IList)) + { + ErrorCode = errorCode; + ErrorTitle = errorTitle; + ErrorString = errorString; + Recommendations = recommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error code. + /// + [JsonProperty(PropertyName = "errorCode")] + public int? ErrorCode { get; private set; } + + /// + /// Gets title: Typically, the entity that the error pertains to. + /// + [JsonProperty(PropertyName = "errorTitle")] + public string ErrorTitle { get; private set; } + + /// + /// Gets localized error string. + /// + [JsonProperty(PropertyName = "errorString")] + public string ErrorString { get; private set; } + + /// + /// Gets list of localized recommendations for above error code. + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; private set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMHealthDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMHealthDetails.cs new file mode 100644 index 000000000000..badee80b0b95 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMHealthDetails.cs @@ -0,0 +1,49 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure IaaS VM workload-specific Health Details. + /// + public partial class AzureIaaSVMHealthDetails : ResourceHealthDetails + { + /// + /// Initializes a new instance of the AzureIaaSVMHealthDetails class. + /// + public AzureIaaSVMHealthDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSVMHealthDetails class. + /// + /// Health Code + /// Health Title + /// Health Message + /// Health Recommended Actions + public AzureIaaSVMHealthDetails(int? code = default(int?), string title = default(string), string message = default(string), IList recommendations = default(IList)) + : base(code, title, message, recommendations) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJob.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJob.cs new file mode 100644 index 000000000000..28cf1f9e17e9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJob.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure IaaS VM workload-specific job object. + /// + public partial class AzureIaaSVMJob : Job + { + /// + /// Initializes a new instance of the AzureIaaSVMJob class. + /// + public AzureIaaSVMJob() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSVMJob class. + /// + /// Friendly name of the entity on + /// which the current job is executing. + /// Backup management type to + /// execute the current job. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// The operation name. + /// Job status. + /// The start time. + /// The end time. + /// ActivityId of job. + /// Time elapsed during the execution of this + /// job. + /// Gets or sets the state/actions applicable + /// on this job like cancel/retry. + /// Error details on execution of this + /// job. + /// Specifies whether the backup + /// item is a Classic or an Azure Resource Manager VM. + /// Additional information for this + /// job. + /// Container name of the entity on which + /// the current job is executing. + /// Indicated that whether the job is + /// adhoc(true) or scheduled(false) + public AzureIaaSVMJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList actionsInfo = default(IList), IList errorDetails = default(IList), string virtualMachineVersion = default(string), AzureIaaSVMJobExtendedInfo extendedInfo = default(AzureIaaSVMJobExtendedInfo), string containerName = default(string), bool? isUserTriggered = default(bool?)) + : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) + { + Duration = duration; + ActionsInfo = actionsInfo; + ErrorDetails = errorDetails; + VirtualMachineVersion = virtualMachineVersion; + ExtendedInfo = extendedInfo; + ContainerName = containerName; + IsUserTriggered = isUserTriggered; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets time elapsed during the execution of this job. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets the state/actions applicable on this job like + /// cancel/retry. + /// + [JsonProperty(PropertyName = "actionsInfo")] + public IList ActionsInfo { get; set; } + + /// + /// Gets or sets error details on execution of this job. + /// + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; set; } + + /// + /// Gets or sets specifies whether the backup item is a Classic or an + /// Azure Resource Manager VM. + /// + [JsonProperty(PropertyName = "virtualMachineVersion")] + public string VirtualMachineVersion { get; set; } + + /// + /// Gets or sets additional information for this job. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureIaaSVMJobExtendedInfo ExtendedInfo { get; set; } + + /// + /// Gets or sets container name of the entity on which the current job + /// is executing. + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets indicated that whether the job is adhoc(true) or + /// scheduled(false) + /// + [JsonProperty(PropertyName = "isUserTriggered")] + public bool? IsUserTriggered { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobExtendedInfo.cs new file mode 100644 index 000000000000..c5e810f56a75 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobExtendedInfo.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure IaaS VM workload-specific additional information for job. + /// + public partial class AzureIaaSVMJobExtendedInfo + { + /// + /// Initializes a new instance of the AzureIaaSVMJobExtendedInfo class. + /// + public AzureIaaSVMJobExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSVMJobExtendedInfo class. + /// + /// List of tasks associated with this + /// job. + /// Job properties. + /// Job internal properties. + /// Indicates progress of the job. + /// Null if it has not started or completed. + /// Time remaining for + /// execution of this job. + /// Non localized error message on + /// job execution. + public AzureIaaSVMJobExtendedInfo(IList tasksList = default(IList), IDictionary propertyBag = default(IDictionary), IDictionary internalPropertyBag = default(IDictionary), double? progressPercentage = default(double?), string estimatedRemainingDuration = default(string), string dynamicErrorMessage = default(string)) + { + TasksList = tasksList; + PropertyBag = propertyBag; + InternalPropertyBag = internalPropertyBag; + ProgressPercentage = progressPercentage; + EstimatedRemainingDuration = estimatedRemainingDuration; + DynamicErrorMessage = dynamicErrorMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of tasks associated with this job. + /// + [JsonProperty(PropertyName = "tasksList")] + public IList TasksList { get; set; } + + /// + /// Gets or sets job properties. + /// + [JsonProperty(PropertyName = "propertyBag")] + public IDictionary PropertyBag { get; set; } + + /// + /// Gets or sets job internal properties. + /// + [JsonProperty(PropertyName = "internalPropertyBag")] + public IDictionary InternalPropertyBag { get; set; } + + /// + /// Gets or sets indicates progress of the job. Null if it has not + /// started or completed. + /// + [JsonProperty(PropertyName = "progressPercentage")] + public double? ProgressPercentage { get; set; } + + /// + /// Gets or sets time remaining for execution of this job. + /// + [JsonProperty(PropertyName = "estimatedRemainingDuration")] + public string EstimatedRemainingDuration { get; set; } + + /// + /// Gets or sets non localized error message on job execution. + /// + [JsonProperty(PropertyName = "dynamicErrorMessage")] + public string DynamicErrorMessage { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobTaskDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobTaskDetails.cs new file mode 100644 index 000000000000..8dba5bff4bcf --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobTaskDetails.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure IaaS VM workload-specific job task details. + /// + public partial class AzureIaaSVMJobTaskDetails + { + /// + /// Initializes a new instance of the AzureIaaSVMJobTaskDetails class. + /// + public AzureIaaSVMJobTaskDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSVMJobTaskDetails class. + /// + /// The task display name. + /// The start time. + /// The end time. + /// The instanceId. + /// Time elapsed for task. + /// The status. + /// Progress of the task. + /// Details about execution of the + /// task. + /// eg: number of bytes transferred etc + public AzureIaaSVMJobTaskDetails(string taskId = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string instanceId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), string status = default(string), double? progressPercentage = default(double?), string taskExecutionDetails = default(string)) + { + TaskId = taskId; + StartTime = startTime; + EndTime = endTime; + InstanceId = instanceId; + Duration = duration; + Status = status; + ProgressPercentage = progressPercentage; + TaskExecutionDetails = taskExecutionDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the task display name. + /// + [JsonProperty(PropertyName = "taskId")] + public string TaskId { get; set; } + + /// + /// Gets or sets the start time. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the end time. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets the instanceId. + /// + [JsonProperty(PropertyName = "instanceId")] + public string InstanceId { get; set; } + + /// + /// Gets or sets time elapsed for task. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets the status. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets progress of the task. + /// + [JsonProperty(PropertyName = "progressPercentage")] + public double? ProgressPercentage { get; set; } + + /// + /// Gets or sets details about execution of the task. + /// eg: number of bytes transferred etc + /// + [JsonProperty(PropertyName = "taskExecutionDetails")] + public string TaskExecutionDetails { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobV2.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobV2.cs new file mode 100644 index 000000000000..784ea0361ec1 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobV2.cs @@ -0,0 +1,114 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure IaaS VM workload-specific job object. + /// + public partial class AzureIaaSVMJobV2 : Job + { + /// + /// Initializes a new instance of the AzureIaaSVMJobV2 class. + /// + public AzureIaaSVMJobV2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSVMJobV2 class. + /// + /// Friendly name of the entity on + /// which the current job is executing. + /// Backup management type to + /// execute the current job. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// The operation name. + /// Job status. + /// The start time. + /// The end time. + /// ActivityId of job. + /// Gets or sets the state/actions applicable + /// on this job like cancel/retry. + /// Container name of the entity on which + /// the current job is executing. + /// Time elapsed during the execution of this + /// job. + /// Error details on execution of this + /// job. + /// Specifies whether the backup + /// item is a Classic or an Azure Resource Manager VM. + /// Additional information for this + /// job. + public AzureIaaSVMJobV2(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), IList actionsInfo = default(IList), string containerName = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList errorDetails = default(IList), string virtualMachineVersion = default(string), AzureIaaSVMJobExtendedInfo extendedInfo = default(AzureIaaSVMJobExtendedInfo)) + : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) + { + ActionsInfo = actionsInfo; + ContainerName = containerName; + Duration = duration; + ErrorDetails = errorDetails; + VirtualMachineVersion = virtualMachineVersion; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the state/actions applicable on this job like + /// cancel/retry. + /// + [JsonProperty(PropertyName = "actionsInfo")] + public IList ActionsInfo { get; set; } + + /// + /// Gets or sets container name of the entity on which the current job + /// is executing. + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets time elapsed during the execution of this job. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets error details on execution of this job. + /// + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; set; } + + /// + /// Gets or sets specifies whether the backup item is a Classic or an + /// Azure Resource Manager VM. + /// + [JsonProperty(PropertyName = "virtualMachineVersion")] + public string VirtualMachineVersion { get; set; } + + /// + /// Gets or sets additional information for this job. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureIaaSVMJobExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs new file mode 100644 index 000000000000..556646ec9781 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs @@ -0,0 +1,196 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IaaS VM workload-specific backup item. + /// + public partial class AzureIaaSVMProtectedItem : ProtectedItem + { + /// + /// Initializes a new instance of the AzureIaaSVMProtectedItem class. + /// + public AzureIaaSVMProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSVMProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the VM represented by + /// this backup item. + /// Fully qualified ARM ID of the + /// virtual machine represented by this item. + /// Backup status of this backup + /// item. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Health status of protected item. + /// Possible values include: 'Passed', 'ActionRequired', + /// 'ActionSuggested', 'Invalid' + /// Health details on this backup + /// item. + /// Health details of different KPIs + /// Last backup operation + /// status. + /// Timestamp of the last backup operation + /// on this backup item. + /// Data ID of the protected + /// item. + /// Additional information for this backup + /// item. + public AzureIaaSVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), IDictionary kpisHealths = default(IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) + { + FriendlyName = friendlyName; + VirtualMachineId = virtualMachineId; + ProtectionStatus = protectionStatus; + ProtectionState = protectionState; + HealthStatus = healthStatus; + HealthDetails = healthDetails; + KpisHealths = kpisHealths; + LastBackupStatus = lastBackupStatus; + LastBackupTime = lastBackupTime; + ProtectedItemDataId = protectedItemDataId; + ExtendedInfo = extendedInfo; + ExtendedProperties = extendedProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the VM represented by this backup + /// item. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets fully qualified ARM ID of the virtual machine + /// represented by this item. + /// + [JsonProperty(PropertyName = "virtualMachineId")] + public string VirtualMachineId { get; set; } + + /// + /// Gets or sets backup status of this backup item. + /// + [JsonProperty(PropertyName = "protectionStatus")] + public string ProtectionStatus { get; set; } + + /// + /// Gets or sets backup state of this backup item. Possible values + /// include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', + /// 'ProtectionStopped', 'ProtectionPaused' + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + /// + /// Gets or sets health status of protected item. Possible values + /// include: 'Passed', 'ActionRequired', 'ActionSuggested', 'Invalid' + /// + [JsonProperty(PropertyName = "healthStatus")] + public string HealthStatus { get; set; } + + /// + /// Gets or sets health details on this backup item. + /// + [JsonProperty(PropertyName = "healthDetails")] + public IList HealthDetails { get; set; } + + /// + /// Gets or sets health details of different KPIs + /// + [JsonProperty(PropertyName = "kpisHealths")] + public IDictionary KpisHealths { get; set; } + + /// + /// Gets or sets last backup operation status. + /// + [JsonProperty(PropertyName = "lastBackupStatus")] + public string LastBackupStatus { get; set; } + + /// + /// Gets or sets timestamp of the last backup operation on this backup + /// item. + /// + [JsonProperty(PropertyName = "lastBackupTime")] + public System.DateTime? LastBackupTime { get; set; } + + /// + /// Gets or sets data ID of the protected item. + /// + [JsonProperty(PropertyName = "protectedItemDataId")] + public string ProtectedItemDataId { get; set; } + + /// + /// Gets or sets additional information for this backup item. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureIaaSVMProtectedItemExtendedInfo ExtendedInfo { get; set; } + + /// + /// + [JsonProperty(PropertyName = "extendedProperties")] + public ExtendedProperties ExtendedProperties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItemExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..eaabe79173b0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItemExtendedInfo.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional information on Azure IaaS VM specific backup item. + /// + public partial class AzureIaaSVMProtectedItemExtendedInfo + { + /// + /// Initializes a new instance of the + /// AzureIaaSVMProtectedItemExtendedInfo class. + /// + public AzureIaaSVMProtectedItemExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureIaaSVMProtectedItemExtendedInfo class. + /// + /// The oldest backup copy available + /// for this backup item. + /// Number of backup copies available + /// for this backup item. + /// Specifies if backup policy + /// associated with the backup item is inconsistent. + public AzureIaaSVMProtectedItemExtendedInfo(System.DateTime? oldestRecoveryPoint = default(System.DateTime?), int? recoveryPointCount = default(int?), bool? policyInconsistent = default(bool?)) + { + OldestRecoveryPoint = oldestRecoveryPoint; + RecoveryPointCount = recoveryPointCount; + PolicyInconsistent = policyInconsistent; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the oldest backup copy available for this backup item. + /// + [JsonProperty(PropertyName = "oldestRecoveryPoint")] + public System.DateTime? OldestRecoveryPoint { get; set; } + + /// + /// Gets or sets number of backup copies available for this backup + /// item. + /// + [JsonProperty(PropertyName = "recoveryPointCount")] + public int? RecoveryPointCount { get; set; } + + /// + /// Gets or sets specifies if backup policy associated with the backup + /// item is inconsistent. + /// + [JsonProperty(PropertyName = "policyInconsistent")] + public bool? PolicyInconsistent { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectionPolicy.cs new file mode 100644 index 000000000000..0f41ea7d07c9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectionPolicy.cs @@ -0,0 +1,106 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IaaS VM workload-specific backup policy. + /// + [Newtonsoft.Json.JsonObject("AzureIaasVM")] + public partial class AzureIaaSVMProtectionPolicy : ProtectionPolicy + { + /// + /// Initializes a new instance of the AzureIaaSVMProtectionPolicy + /// class. + /// + public AzureIaaSVMProtectionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSVMProtectionPolicy + /// class. + /// + /// Number of items associated with + /// this policy. + /// ResourceGuard + /// Operation Requests + /// Backup schedule specified as part of + /// backup policy. + /// Retention policy with the details on + /// backup copy retention ranges. + /// Instant RP retention + /// policy range in days + /// TimeZone optional input as string. For + /// example: TimeZone = "Pacific Standard Time". + /// Possible values include: 'Invalid', 'V1', + /// 'V2' + public AzureIaaSVMProtectionPolicy(int? protectedItemsCount = default(int?), IList resourceGuardOperationRequests = default(IList), InstantRPAdditionalDetails instantRPDetails = default(InstantRPAdditionalDetails), SchedulePolicy schedulePolicy = default(SchedulePolicy), RetentionPolicy retentionPolicy = default(RetentionPolicy), int? instantRpRetentionRangeInDays = default(int?), string timeZone = default(string), string policyType = default(string)) + : base(protectedItemsCount, resourceGuardOperationRequests) + { + InstantRPDetails = instantRPDetails; + SchedulePolicy = schedulePolicy; + RetentionPolicy = retentionPolicy; + InstantRpRetentionRangeInDays = instantRpRetentionRangeInDays; + TimeZone = timeZone; + PolicyType = policyType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "instantRPDetails")] + public InstantRPAdditionalDetails InstantRPDetails { get; set; } + + /// + /// Gets or sets backup schedule specified as part of backup policy. + /// + [JsonProperty(PropertyName = "schedulePolicy")] + public SchedulePolicy SchedulePolicy { get; set; } + + /// + /// Gets or sets retention policy with the details on backup copy + /// retention ranges. + /// + [JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + + /// + /// Gets or sets instant RP retention policy range in days + /// + [JsonProperty(PropertyName = "instantRpRetentionRangeInDays")] + public int? InstantRpRetentionRangeInDays { get; set; } + + /// + /// Gets or sets timeZone optional input as string. For example: + /// TimeZone = "Pacific Standard Time". + /// + [JsonProperty(PropertyName = "timeZone")] + public string TimeZone { get; set; } + + /// + /// Gets or sets possible values include: 'Invalid', 'V1', 'V2' + /// + [JsonProperty(PropertyName = "policyType")] + public string PolicyType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureRecoveryServiceVaultProtectionIntent.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureRecoveryServiceVaultProtectionIntent.cs new file mode 100644 index 000000000000..a6a3d241fe79 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureRecoveryServiceVaultProtectionIntent.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Recovery Services Vault specific protection intent item. + /// + [Newtonsoft.Json.JsonObject("RecoveryServiceVaultItem")] + public partial class AzureRecoveryServiceVaultProtectionIntent : ProtectionIntent + { + /// + /// Initializes a new instance of the + /// AzureRecoveryServiceVaultProtectionIntent class. + /// + public AzureRecoveryServiceVaultProtectionIntent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureRecoveryServiceVaultProtectionIntent class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// ARM ID of the resource to be backed + /// up. + /// ID of the item which is getting protected, In + /// case of Azure Vm , it is ProtectedItemId + /// ID of the backup policy with which this item + /// is backed up. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + public AzureRecoveryServiceVaultProtectionIntent(string backupManagementType = default(string), string sourceResourceId = default(string), string itemId = default(string), string policyId = default(string), string protectionState = default(string)) + : base(backupManagementType, sourceResourceId, itemId, policyId, protectionState) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureResourceProtectionIntent.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureResourceProtectionIntent.cs new file mode 100644 index 000000000000..393be97dec3c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureResourceProtectionIntent.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// IaaS VM specific backup protection intent item. + /// + [Newtonsoft.Json.JsonObject("AzureResourceItem")] + public partial class AzureResourceProtectionIntent : ProtectionIntent + { + /// + /// Initializes a new instance of the AzureResourceProtectionIntent + /// class. + /// + public AzureResourceProtectionIntent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureResourceProtectionIntent + /// class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// ARM ID of the resource to be backed + /// up. + /// ID of the item which is getting protected, In + /// case of Azure Vm , it is ProtectedItemId + /// ID of the backup policy with which this item + /// is backed up. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Friendly name of the VM represented by + /// this backup item. + public AzureResourceProtectionIntent(string backupManagementType = default(string), string sourceResourceId = default(string), string itemId = default(string), string policyId = default(string), string protectionState = default(string), string friendlyName = default(string)) + : base(backupManagementType, sourceResourceId, itemId, policyId, protectionState) + { + FriendlyName = friendlyName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the VM represented by this backup + /// item. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs new file mode 100644 index 000000000000..0a150f02a155 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Container for SQL workloads under SQL Availability Group. + /// + [Newtonsoft.Json.JsonObject("SQLAGWorkLoadContainer")] + public partial class AzureSQLAGWorkloadContainerProtectionContainer : AzureWorkloadContainer + { + /// + /// Initializes a new instance of the + /// AzureSQLAGWorkloadContainerProtectionContainer class. + /// + public AzureSQLAGWorkloadContainerProtectionContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureSQLAGWorkloadContainerProtectionContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// ARM ID of the virtual machine + /// represented by this Azure Workload Container + /// Time stamp when this container was + /// updated. + /// Additional details of a workload + /// container. + /// Workload type for which registration was + /// sent. Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Re-Do Operation. Possible values + /// include: 'Invalid', 'Register', 'Reregister' + public AzureSQLAGWorkloadContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlContainer.cs new file mode 100644 index 000000000000..3c46a7040160 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlContainer.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Azure Sql workload-specific container. + /// + public partial class AzureSqlContainer : ProtectionContainer + { + /// + /// Initializes a new instance of the AzureSqlContainer class. + /// + public AzureSqlContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureSqlContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + public AzureSqlContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs new file mode 100644 index 000000000000..c9027795bbe9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure SQL workload-specific backup item. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Sql/servers/databases")] + public partial class AzureSqlProtectedItem : ProtectedItem + { + /// + /// Initializes a new instance of the AzureSqlProtectedItem class. + /// + public AzureSqlProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureSqlProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Internal ID of a backup item. + /// Used by Azure SQL Backup engine to contact Recovery + /// Services. + /// Backup state of the backed up item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Additional information for this backup + /// item. + public AzureSqlProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string protectedItemDataId = default(string), string protectionState = default(string), AzureSqlProtectedItemExtendedInfo extendedInfo = default(AzureSqlProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) + { + ProtectedItemDataId = protectedItemDataId; + ProtectionState = protectionState; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets internal ID of a backup item. Used by Azure SQL Backup + /// engine to contact Recovery Services. + /// + [JsonProperty(PropertyName = "protectedItemDataId")] + public string ProtectedItemDataId { get; set; } + + /// + /// Gets or sets backup state of the backed up item. Possible values + /// include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', + /// 'ProtectionStopped', 'ProtectionPaused' + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + /// + /// Gets or sets additional information for this backup item. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureSqlProtectedItemExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItemExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..9587537c4cba --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItemExtendedInfo.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional information on Azure Sql specific protected item. + /// + public partial class AzureSqlProtectedItemExtendedInfo + { + /// + /// Initializes a new instance of the AzureSqlProtectedItemExtendedInfo + /// class. + /// + public AzureSqlProtectedItemExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureSqlProtectedItemExtendedInfo + /// class. + /// + /// The oldest backup copy available + /// for this item in the service. + /// Number of available backup copies + /// associated with this backup item. + /// State of the backup policy associated + /// with this backup item. + public AzureSqlProtectedItemExtendedInfo(System.DateTime? oldestRecoveryPoint = default(System.DateTime?), int? recoveryPointCount = default(int?), string policyState = default(string)) + { + OldestRecoveryPoint = oldestRecoveryPoint; + RecoveryPointCount = recoveryPointCount; + PolicyState = policyState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the oldest backup copy available for this item in the + /// service. + /// + [JsonProperty(PropertyName = "oldestRecoveryPoint")] + public System.DateTime? OldestRecoveryPoint { get; set; } + + /// + /// Gets or sets number of available backup copies associated with this + /// backup item. + /// + [JsonProperty(PropertyName = "recoveryPointCount")] + public int? RecoveryPointCount { get; set; } + + /// + /// Gets or sets state of the backup policy associated with this backup + /// item. + /// + [JsonProperty(PropertyName = "policyState")] + public string PolicyState { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectionPolicy.cs new file mode 100644 index 000000000000..b9dfee77255b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectionPolicy.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure SQL workload-specific backup policy. + /// + [Newtonsoft.Json.JsonObject("AzureSql")] + public partial class AzureSqlProtectionPolicy : ProtectionPolicy + { + /// + /// Initializes a new instance of the AzureSqlProtectionPolicy class. + /// + public AzureSqlProtectionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureSqlProtectionPolicy class. + /// + /// Number of items associated with + /// this policy. + /// ResourceGuard + /// Operation Requests + /// Retention policy details. + public AzureSqlProtectionPolicy(int? protectedItemsCount = default(int?), IList resourceGuardOperationRequests = default(IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + : base(protectedItemsCount, resourceGuardOperationRequests) + { + RetentionPolicy = retentionPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets retention policy details. + /// + [JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageContainer.cs new file mode 100644 index 000000000000..94caacbc496f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageContainer.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Storage Account workload-specific container. + /// + [Newtonsoft.Json.JsonObject("StorageContainer")] + public partial class AzureStorageContainer : ProtectionContainer + { + /// + /// Initializes a new instance of the AzureStorageContainer class. + /// + public AzureStorageContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStorageContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// Fully qualified ARM url. + /// Storage account + /// version. + /// Resource group name of Recovery + /// Services Vault. + /// Number of items backed up in this + /// container. + /// Whether storage account + /// lock is to be acquired for this container or not. Possible values + /// include: 'Acquire', 'NotAcquire' + public AzureStorageContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), string storageAccountVersion = default(string), string resourceGroup = default(string), long? protectedItemCount = default(long?), string acquireStorageAccountLock = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + { + SourceResourceId = sourceResourceId; + StorageAccountVersion = storageAccountVersion; + ResourceGroup = resourceGroup; + ProtectedItemCount = protectedItemCount; + AcquireStorageAccountLock = acquireStorageAccountLock; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets fully qualified ARM url. + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + /// + /// Gets or sets storage account version. + /// + [JsonProperty(PropertyName = "storageAccountVersion")] + public string StorageAccountVersion { get; set; } + + /// + /// Gets or sets resource group name of Recovery Services Vault. + /// + [JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets number of items backed up in this container. + /// + [JsonProperty(PropertyName = "protectedItemCount")] + public long? ProtectedItemCount { get; set; } + + /// + /// Gets or sets whether storage account lock is to be acquired for + /// this container or not. Possible values include: 'Acquire', + /// 'NotAcquire' + /// + [JsonProperty(PropertyName = "acquireStorageAccountLock")] + public string AcquireStorageAccountLock { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageErrorInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageErrorInfo.cs new file mode 100644 index 000000000000..cb66af545314 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageErrorInfo.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure storage specific error information + /// + public partial class AzureStorageErrorInfo + { + /// + /// Initializes a new instance of the AzureStorageErrorInfo class. + /// + public AzureStorageErrorInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStorageErrorInfo class. + /// + /// Error code. + /// Localized error string. + /// List of localized recommendations for + /// above error code. + public AzureStorageErrorInfo(int? errorCode = default(int?), string errorString = default(string), IList recommendations = default(IList)) + { + ErrorCode = errorCode; + ErrorString = errorString; + Recommendations = recommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code. + /// + [JsonProperty(PropertyName = "errorCode")] + public int? ErrorCode { get; set; } + + /// + /// Gets or sets localized error string. + /// + [JsonProperty(PropertyName = "errorString")] + public string ErrorString { get; set; } + + /// + /// Gets or sets list of localized recommendations for above error + /// code. + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJob.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJob.cs new file mode 100644 index 000000000000..f38b871eeb0b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJob.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure storage specific job. + /// + public partial class AzureStorageJob : Job + { + /// + /// Initializes a new instance of the AzureStorageJob class. + /// + public AzureStorageJob() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStorageJob class. + /// + /// Friendly name of the entity on + /// which the current job is executing. + /// Backup management type to + /// execute the current job. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// The operation name. + /// Job status. + /// The start time. + /// The end time. + /// ActivityId of job. + /// Time elapsed during the execution of this + /// job. + /// Gets or sets the state/actions applicable + /// on this job like cancel/retry. + /// Error details on execution of this + /// job. + /// Specifies friendly name of the + /// storage account. + /// Specifies whether the Storage + /// account is a Classic or an Azure Resource Manager Storage + /// account. + /// Additional information about the + /// job. + /// Indicated that whether the job is + /// adhoc(true) or scheduled(false) + public AzureStorageJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList actionsInfo = default(IList), IList errorDetails = default(IList), string storageAccountName = default(string), string storageAccountVersion = default(string), AzureStorageJobExtendedInfo extendedInfo = default(AzureStorageJobExtendedInfo), bool? isUserTriggered = default(bool?)) + : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) + { + Duration = duration; + ActionsInfo = actionsInfo; + ErrorDetails = errorDetails; + StorageAccountName = storageAccountName; + StorageAccountVersion = storageAccountVersion; + ExtendedInfo = extendedInfo; + IsUserTriggered = isUserTriggered; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets time elapsed during the execution of this job. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets the state/actions applicable on this job like + /// cancel/retry. + /// + [JsonProperty(PropertyName = "actionsInfo")] + public IList ActionsInfo { get; set; } + + /// + /// Gets or sets error details on execution of this job. + /// + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; set; } + + /// + /// Gets or sets specifies friendly name of the storage account. + /// + [JsonProperty(PropertyName = "storageAccountName")] + public string StorageAccountName { get; set; } + + /// + /// Gets or sets specifies whether the Storage account is a Classic or + /// an Azure Resource Manager Storage account. + /// + [JsonProperty(PropertyName = "storageAccountVersion")] + public string StorageAccountVersion { get; set; } + + /// + /// Gets or sets additional information about the job. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureStorageJobExtendedInfo ExtendedInfo { get; set; } + + /// + /// Gets or sets indicated that whether the job is adhoc(true) or + /// scheduled(false) + /// + [JsonProperty(PropertyName = "isUserTriggered")] + public bool? IsUserTriggered { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJobExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJobExtendedInfo.cs new file mode 100644 index 000000000000..7208ac165acd --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJobExtendedInfo.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure Storage workload-specific additional information for job. + /// + public partial class AzureStorageJobExtendedInfo + { + /// + /// Initializes a new instance of the AzureStorageJobExtendedInfo + /// class. + /// + public AzureStorageJobExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStorageJobExtendedInfo + /// class. + /// + /// List of tasks for this job + /// Job properties. + /// Non localized error message on + /// job execution. + public AzureStorageJobExtendedInfo(IList tasksList = default(IList), IDictionary propertyBag = default(IDictionary), string dynamicErrorMessage = default(string)) + { + TasksList = tasksList; + PropertyBag = propertyBag; + DynamicErrorMessage = dynamicErrorMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of tasks for this job + /// + [JsonProperty(PropertyName = "tasksList")] + public IList TasksList { get; set; } + + /// + /// Gets or sets job properties. + /// + [JsonProperty(PropertyName = "propertyBag")] + public IDictionary PropertyBag { get; set; } + + /// + /// Gets or sets non localized error message on job execution. + /// + [JsonProperty(PropertyName = "dynamicErrorMessage")] + public string DynamicErrorMessage { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJobTaskDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJobTaskDetails.cs new file mode 100644 index 000000000000..4362fdd5974a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJobTaskDetails.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure storage workload specific job task details. + /// + public partial class AzureStorageJobTaskDetails + { + /// + /// Initializes a new instance of the AzureStorageJobTaskDetails class. + /// + public AzureStorageJobTaskDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStorageJobTaskDetails class. + /// + /// The task display name. + /// The status. + public AzureStorageJobTaskDetails(string taskId = default(string), string status = default(string)) + { + TaskId = taskId; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the task display name. + /// + [JsonProperty(PropertyName = "taskId")] + public string TaskId { get; set; } + + /// + /// Gets or sets the status. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageProtectableContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageProtectableContainer.cs new file mode 100644 index 000000000000..f728c8327b63 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageProtectableContainer.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Storage-specific protectable containers + /// + [Newtonsoft.Json.JsonObject("StorageContainer")] + public partial class AzureStorageProtectableContainer : ProtectableContainer + { + /// + /// Initializes a new instance of the AzureStorageProtectableContainer + /// class. + /// + public AzureStorageProtectableContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStorageProtectableContainer + /// class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of health of the + /// container. + /// Fabric Id of the container such as ARM + /// Id. + public AzureStorageProtectableContainer(string friendlyName = default(string), string backupManagementType = default(string), string healthStatus = default(string), string containerId = default(string)) + : base(friendlyName, backupManagementType, healthStatus, containerId) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectableContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectableContainer.cs new file mode 100644 index 000000000000..b1d83818ece0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectableContainer.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure workload-specific container + /// + [Newtonsoft.Json.JsonObject("VMAppContainer")] + public partial class AzureVMAppContainerProtectableContainer : ProtectableContainer + { + /// + /// Initializes a new instance of the + /// AzureVMAppContainerProtectableContainer class. + /// + public AzureVMAppContainerProtectableContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVMAppContainerProtectableContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of health of the + /// container. + /// Fabric Id of the container such as ARM + /// Id. + public AzureVMAppContainerProtectableContainer(string friendlyName = default(string), string backupManagementType = default(string), string healthStatus = default(string), string containerId = default(string)) + : base(friendlyName, backupManagementType, healthStatus, containerId) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectionContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectionContainer.cs new file mode 100644 index 000000000000..eb5b47f92c7b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectionContainer.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Container for SQL workloads under Azure Virtual Machines. + /// + [Newtonsoft.Json.JsonObject("VMAppContainer")] + public partial class AzureVMAppContainerProtectionContainer : AzureWorkloadContainer + { + /// + /// Initializes a new instance of the + /// AzureVMAppContainerProtectionContainer class. + /// + public AzureVMAppContainerProtectionContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVMAppContainerProtectionContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// ARM ID of the virtual machine + /// represented by this Azure Workload Container + /// Time stamp when this container was + /// updated. + /// Additional details of a workload + /// container. + /// Workload type for which registration was + /// sent. Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Re-Do Operation. Possible values + /// include: 'Invalid', 'Register', 'Reregister' + public AzureVMAppContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMResourceFeatureSupportRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMResourceFeatureSupportRequest.cs new file mode 100644 index 000000000000..368377745350 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMResourceFeatureSupportRequest.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// AzureResource(IaaS VM) Specific feature support request + /// + [Newtonsoft.Json.JsonObject("AzureVMResourceBackup")] + public partial class AzureVMResourceFeatureSupportRequest : FeatureSupportRequest + { + /// + /// Initializes a new instance of the + /// AzureVMResourceFeatureSupportRequest class. + /// + public AzureVMResourceFeatureSupportRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVMResourceFeatureSupportRequest class. + /// + /// Size of the resource: VM size(A/D series etc) + /// in case of IaasVM + /// SKUs (Premium/Managed etc) in case of + /// IaasVM + public AzureVMResourceFeatureSupportRequest(string vmSize = default(string), string vmSku = default(string)) + { + VmSize = vmSize; + VmSku = vmSku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets size of the resource: VM size(A/D series etc) in case + /// of IaasVM + /// + [JsonProperty(PropertyName = "vmSize")] + public string VmSize { get; set; } + + /// + /// Gets or sets sKUs (Premium/Managed etc) in case of IaasVM + /// + [JsonProperty(PropertyName = "vmSku")] + public string VmSku { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMResourceFeatureSupportResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMResourceFeatureSupportResponse.cs new file mode 100644 index 000000000000..a41ec93d4ceb --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMResourceFeatureSupportResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response for feature support requests for Azure IaasVm + /// + public partial class AzureVMResourceFeatureSupportResponse + { + /// + /// Initializes a new instance of the + /// AzureVMResourceFeatureSupportResponse class. + /// + public AzureVMResourceFeatureSupportResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVMResourceFeatureSupportResponse class. + /// + /// Support status of feature. Possible + /// values include: 'Invalid', 'Supported', 'DefaultOFF', 'DefaultON', + /// 'NotSupported' + public AzureVMResourceFeatureSupportResponse(string supportStatus = default(string)) + { + SupportStatus = supportStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets support status of feature. Possible values include: + /// 'Invalid', 'Supported', 'DefaultOFF', 'DefaultON', 'NotSupported' + /// + [JsonProperty(PropertyName = "supportStatus")] + public string SupportStatus { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadItem.cs new file mode 100644 index 000000000000..71897ca3b751 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadItem.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific workload item. + /// + public partial class AzureVmWorkloadItem : WorkloadItem + { + /// + /// Initializes a new instance of the AzureVmWorkloadItem class. + /// + public AzureVmWorkloadItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureVmWorkloadItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Host/Cluster Name for instance or + /// AG + /// Indicates if workload item is + /// auto-protectable + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + public AzureVmWorkloadItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), int? subinquireditemcount = default(int?), int? subWorkloadItemCount = default(int?)) + : base(backupManagementType, workloadType, friendlyName, protectionState) + { + ParentName = parentName; + ServerName = serverName; + IsAutoProtectable = isAutoProtectable; + Subinquireditemcount = subinquireditemcount; + SubWorkloadItemCount = subWorkloadItemCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name for instance or AG + /// + [JsonProperty(PropertyName = "parentName")] + public string ParentName { get; set; } + + /// + /// Gets or sets host/Cluster Name for instance or AG + /// + [JsonProperty(PropertyName = "serverName")] + public string ServerName { get; set; } + + /// + /// Gets or sets indicates if workload item is auto-protectable + /// + [JsonProperty(PropertyName = "isAutoProtectable")] + public bool? IsAutoProtectable { get; set; } + + /// + /// Gets or sets for instance or AG, indicates number of DB's present + /// + [JsonProperty(PropertyName = "subinquireditemcount")] + public int? Subinquireditemcount { get; set; } + + /// + /// Gets or sets for instance or AG, indicates number of DB's to be + /// protected + /// + [JsonProperty(PropertyName = "subWorkloadItemCount")] + public int? SubWorkloadItemCount { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectableItem.cs new file mode 100644 index 000000000000..4f2ebfb1c7c5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectableItem.cs @@ -0,0 +1,132 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific protectable item. + /// + public partial class AzureVmWorkloadProtectableItem : WorkloadProtectableItem + { + /// + /// Initializes a new instance of the AzureVmWorkloadProtectableItem + /// class. + /// + public AzureVmWorkloadProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureVmWorkloadProtectableItem + /// class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Parent Unique Name is added to + /// provide the service formatted URI Name of the Parent + /// Only Applicable for data bases where the parent would be either + /// Instance or a SQL AG. + /// Host/Cluster Name for instance or + /// AG + /// Indicates if protectable item is + /// auto-protectable + /// Indicates if protectable item is + /// auto-protected + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + /// Pre-backup validation for + /// protectable objects + public AzureVmWorkloadProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string parentUniqueName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), bool? isAutoProtected = default(bool?), int? subinquireditemcount = default(int?), int? subprotectableitemcount = default(int?), PreBackupValidation prebackupvalidation = default(PreBackupValidation)) + : base(backupManagementType, workloadType, friendlyName, protectionState) + { + ParentName = parentName; + ParentUniqueName = parentUniqueName; + ServerName = serverName; + IsAutoProtectable = isAutoProtectable; + IsAutoProtected = isAutoProtected; + Subinquireditemcount = subinquireditemcount; + Subprotectableitemcount = subprotectableitemcount; + Prebackupvalidation = prebackupvalidation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name for instance or AG + /// + [JsonProperty(PropertyName = "parentName")] + public string ParentName { get; set; } + + /// + /// Gets or sets parent Unique Name is added to provide the service + /// formatted URI Name of the Parent + /// Only Applicable for data bases where the parent would be either + /// Instance or a SQL AG. + /// + [JsonProperty(PropertyName = "parentUniqueName")] + public string ParentUniqueName { get; set; } + + /// + /// Gets or sets host/Cluster Name for instance or AG + /// + [JsonProperty(PropertyName = "serverName")] + public string ServerName { get; set; } + + /// + /// Gets or sets indicates if protectable item is auto-protectable + /// + [JsonProperty(PropertyName = "isAutoProtectable")] + public bool? IsAutoProtectable { get; set; } + + /// + /// Gets or sets indicates if protectable item is auto-protected + /// + [JsonProperty(PropertyName = "isAutoProtected")] + public bool? IsAutoProtected { get; set; } + + /// + /// Gets or sets for instance or AG, indicates number of DB's present + /// + [JsonProperty(PropertyName = "subinquireditemcount")] + public int? Subinquireditemcount { get; set; } + + /// + /// Gets or sets for instance or AG, indicates number of DB's to be + /// protected + /// + [JsonProperty(PropertyName = "subprotectableitemcount")] + public int? Subprotectableitemcount { get; set; } + + /// + /// Gets or sets pre-backup validation for protectable objects + /// + [JsonProperty(PropertyName = "prebackupvalidation")] + public PreBackupValidation Prebackupvalidation { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs new file mode 100644 index 000000000000..7255fcdf032b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs @@ -0,0 +1,216 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure VM workload-specific protected item. + /// + public partial class AzureVmWorkloadProtectedItem : ProtectedItem + { + /// + /// Initializes a new instance of the AzureVmWorkloadProtectedItem + /// class. + /// + public AzureVmWorkloadProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureVmWorkloadProtectedItem + /// class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the DB represented by + /// this backup item. + /// Host/Cluster Name for instance or + /// AG + /// Parent name of the DB such as Instance or + /// Availability Group. + /// Parent type of protected item, example: + /// for a DB, standalone server or distributed + /// Backup status of this backup + /// item. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Last backup operation status. + /// Possible values: Healthy, Unhealthy. Possible values include: + /// 'Invalid', 'Healthy', 'Unhealthy', 'IRPending' + /// Timestamp of the last backup operation + /// on this backup item. + /// Error details in last + /// backup + /// Data ID of the protected + /// item. + /// Health status of the backup + /// item, evaluated based on last heartbeat received. Possible values + /// include: 'Invalid', 'Healthy', 'Unhealthy', 'NotReachable', + /// 'IRPending' + /// Additional information for this backup + /// item. + /// Health details of different KPIs + public AzureVmWorkloadProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) + { + FriendlyName = friendlyName; + ServerName = serverName; + ParentName = parentName; + ParentType = parentType; + ProtectionStatus = protectionStatus; + ProtectionState = protectionState; + LastBackupStatus = lastBackupStatus; + LastBackupTime = lastBackupTime; + LastBackupErrorDetail = lastBackupErrorDetail; + ProtectedItemDataSourceId = protectedItemDataSourceId; + ProtectedItemHealthStatus = protectedItemHealthStatus; + ExtendedInfo = extendedInfo; + KpisHealths = kpisHealths; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the DB represented by this backup + /// item. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets host/Cluster Name for instance or AG + /// + [JsonProperty(PropertyName = "serverName")] + public string ServerName { get; set; } + + /// + /// Gets or sets parent name of the DB such as Instance or Availability + /// Group. + /// + [JsonProperty(PropertyName = "parentName")] + public string ParentName { get; set; } + + /// + /// Gets or sets parent type of protected item, example: for a DB, + /// standalone server or distributed + /// + [JsonProperty(PropertyName = "parentType")] + public string ParentType { get; set; } + + /// + /// Gets or sets backup status of this backup item. + /// + [JsonProperty(PropertyName = "protectionStatus")] + public string ProtectionStatus { get; set; } + + /// + /// Gets or sets backup state of this backup item. Possible values + /// include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', + /// 'ProtectionStopped', 'ProtectionPaused' + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + /// + /// Gets or sets last backup operation status. Possible values: + /// Healthy, Unhealthy. Possible values include: 'Invalid', 'Healthy', + /// 'Unhealthy', 'IRPending' + /// + [JsonProperty(PropertyName = "lastBackupStatus")] + public string LastBackupStatus { get; set; } + + /// + /// Gets or sets timestamp of the last backup operation on this backup + /// item. + /// + [JsonProperty(PropertyName = "lastBackupTime")] + public System.DateTime? LastBackupTime { get; set; } + + /// + /// Gets or sets error details in last backup + /// + [JsonProperty(PropertyName = "lastBackupErrorDetail")] + public ErrorDetail LastBackupErrorDetail { get; set; } + + /// + /// Gets or sets data ID of the protected item. + /// + [JsonProperty(PropertyName = "protectedItemDataSourceId")] + public string ProtectedItemDataSourceId { get; set; } + + /// + /// Gets or sets health status of the backup item, evaluated based on + /// last heartbeat received. Possible values include: 'Invalid', + /// 'Healthy', 'Unhealthy', 'NotReachable', 'IRPending' + /// + [JsonProperty(PropertyName = "protectedItemHealthStatus")] + public string ProtectedItemHealthStatus { get; set; } + + /// + /// Gets or sets additional information for this backup item. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureVmWorkloadProtectedItemExtendedInfo ExtendedInfo { get; set; } + + /// + /// Gets or sets health details of different KPIs + /// + [JsonProperty(PropertyName = "kpisHealths")] + public IDictionary KpisHealths { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItemExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..65a8d7ee1e5b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItemExtendedInfo.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional information on Azure Workload for SQL specific backup item. + /// + public partial class AzureVmWorkloadProtectedItemExtendedInfo + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadProtectedItemExtendedInfo class. + /// + public AzureVmWorkloadProtectedItemExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadProtectedItemExtendedInfo class. + /// + /// The oldest backup copy available + /// for this backup item. + /// Number of backup copies available + /// for this backup item. + /// Indicates consistency of policy object + /// and policy applied to this backup item. + /// Indicates consistency of policy object + /// and policy applied to this backup item. + public AzureVmWorkloadProtectedItemExtendedInfo(System.DateTime? oldestRecoveryPoint = default(System.DateTime?), int? recoveryPointCount = default(int?), string policyState = default(string), string recoveryModel = default(string)) + { + OldestRecoveryPoint = oldestRecoveryPoint; + RecoveryPointCount = recoveryPointCount; + PolicyState = policyState; + RecoveryModel = recoveryModel; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the oldest backup copy available for this backup item. + /// + [JsonProperty(PropertyName = "oldestRecoveryPoint")] + public System.DateTime? OldestRecoveryPoint { get; set; } + + /// + /// Gets or sets number of backup copies available for this backup + /// item. + /// + [JsonProperty(PropertyName = "recoveryPointCount")] + public int? RecoveryPointCount { get; set; } + + /// + /// Gets or sets indicates consistency of policy object and policy + /// applied to this backup item. + /// + [JsonProperty(PropertyName = "policyState")] + public string PolicyState { get; set; } + + /// + /// Gets or sets indicates consistency of policy object and policy + /// applied to this backup item. + /// + [JsonProperty(PropertyName = "recoveryModel")] + public string RecoveryModel { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectionPolicy.cs new file mode 100644 index 000000000000..dd52d76f2873 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectionPolicy.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure VM (Mercury) workload-specific backup policy. + /// + [Newtonsoft.Json.JsonObject("AzureWorkload")] + public partial class AzureVmWorkloadProtectionPolicy : ProtectionPolicy + { + /// + /// Initializes a new instance of the AzureVmWorkloadProtectionPolicy + /// class. + /// + public AzureVmWorkloadProtectionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureVmWorkloadProtectionPolicy + /// class. + /// + /// Number of items associated with + /// this policy. + /// ResourceGuard + /// Operation Requests + /// Type of workload for the backup + /// management. Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Common settings for the backup + /// management + /// List of sub-protection policies + /// which includes schedule and retention + /// Fix the policy + /// inconsistency + public AzureVmWorkloadProtectionPolicy(int? protectedItemsCount = default(int?), IList resourceGuardOperationRequests = default(IList), string workLoadType = default(string), Settings settings = default(Settings), IList subProtectionPolicy = default(IList), bool? makePolicyConsistent = default(bool?)) + : base(protectedItemsCount, resourceGuardOperationRequests) + { + WorkLoadType = workLoadType; + Settings = settings; + SubProtectionPolicy = subProtectionPolicy; + MakePolicyConsistent = makePolicyConsistent; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of workload for the backup management. Possible + /// values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', + /// 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', + /// 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workLoadType")] + public string WorkLoadType { get; set; } + + /// + /// Gets or sets common settings for the backup management + /// + [JsonProperty(PropertyName = "settings")] + public Settings Settings { get; set; } + + /// + /// Gets or sets list of sub-protection policies which includes + /// schedule and retention + /// + [JsonProperty(PropertyName = "subProtectionPolicy")] + public IList SubProtectionPolicy { get; set; } + + /// + /// Gets or sets fix the policy inconsistency + /// + [JsonProperty(PropertyName = "makePolicyConsistent")] + public bool? MakePolicyConsistent { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs new file mode 100644 index 000000000000..8056ef7ed245 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure VM workload-specific protected item representing SAP ASE + /// Database. + /// + [Newtonsoft.Json.JsonObject("AzureVmWorkloadSAPAseDatabase")] + public partial class AzureVmWorkloadSAPAseDatabaseProtectedItem : AzureVmWorkloadProtectedItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPAseDatabaseProtectedItem class. + /// + public AzureVmWorkloadSAPAseDatabaseProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPAseDatabaseProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the DB represented by + /// this backup item. + /// Host/Cluster Name for instance or + /// AG + /// Parent name of the DB such as Instance or + /// Availability Group. + /// Parent type of protected item, example: + /// for a DB, standalone server or distributed + /// Backup status of this backup + /// item. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Last backup operation status. + /// Possible values: Healthy, Unhealthy. Possible values include: + /// 'Invalid', 'Healthy', 'Unhealthy', 'IRPending' + /// Timestamp of the last backup operation + /// on this backup item. + /// Error details in last + /// backup + /// Data ID of the protected + /// item. + /// Health status of the backup + /// item, evaluated based on last heartbeat received. Possible values + /// include: 'Invalid', 'Healthy', 'Unhealthy', 'NotReachable', + /// 'IRPending' + /// Additional information for this backup + /// item. + /// Health details of different KPIs + public AzureVmWorkloadSAPAseDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseWorkloadItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseWorkloadItem.cs new file mode 100644 index 000000000000..1a35ce0e7214 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseWorkloadItem.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific workload item representing SAP ASE Database. + /// + [Newtonsoft.Json.JsonObject("SAPAseDatabase")] + public partial class AzureVmWorkloadSAPAseDatabaseWorkloadItem : AzureVmWorkloadItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPAseDatabaseWorkloadItem class. + /// + public AzureVmWorkloadSAPAseDatabaseWorkloadItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPAseDatabaseWorkloadItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Host/Cluster Name for instance or + /// AG + /// Indicates if workload item is + /// auto-protectable + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + public AzureVmWorkloadSAPAseDatabaseWorkloadItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), int? subinquireditemcount = default(int?), int? subWorkloadItemCount = default(int?)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, serverName, isAutoProtectable, subinquireditemcount, subWorkloadItemCount) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseSystemProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseSystemProtectableItem.cs new file mode 100644 index 000000000000..1d5dad84d85a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseSystemProtectableItem.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific protectable item representing SAP ASE + /// System. + /// + [Newtonsoft.Json.JsonObject("SAPAseSystem")] + public partial class AzureVmWorkloadSAPAseSystemProtectableItem : AzureVmWorkloadProtectableItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPAseSystemProtectableItem class. + /// + public AzureVmWorkloadSAPAseSystemProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPAseSystemProtectableItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Parent Unique Name is added to + /// provide the service formatted URI Name of the Parent + /// Only Applicable for data bases where the parent would be either + /// Instance or a SQL AG. + /// Host/Cluster Name for instance or + /// AG + /// Indicates if protectable item is + /// auto-protectable + /// Indicates if protectable item is + /// auto-protected + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + /// Pre-backup validation for + /// protectable objects + public AzureVmWorkloadSAPAseSystemProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string parentUniqueName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), bool? isAutoProtected = default(bool?), int? subinquireditemcount = default(int?), int? subprotectableitemcount = default(int?), PreBackupValidation prebackupvalidation = default(PreBackupValidation)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, parentUniqueName, serverName, isAutoProtectable, isAutoProtected, subinquireditemcount, subprotectableitemcount, prebackupvalidation) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseSystemWorkloadItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseSystemWorkloadItem.cs new file mode 100644 index 000000000000..10c729fb6b59 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseSystemWorkloadItem.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific workload item representing SAP ASE System. + /// + [Newtonsoft.Json.JsonObject("SAPAseSystem")] + public partial class AzureVmWorkloadSAPAseSystemWorkloadItem : AzureVmWorkloadItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPAseSystemWorkloadItem class. + /// + public AzureVmWorkloadSAPAseSystemWorkloadItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPAseSystemWorkloadItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Host/Cluster Name for instance or + /// AG + /// Indicates if workload item is + /// auto-protectable + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + public AzureVmWorkloadSAPAseSystemWorkloadItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), int? subinquireditemcount = default(int?), int? subWorkloadItemCount = default(int?)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, serverName, isAutoProtectable, subinquireditemcount, subWorkloadItemCount) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectableItem.cs new file mode 100644 index 000000000000..4db64314b71f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectableItem.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific protectable item representing SAP HANA + /// Database. + /// + [Newtonsoft.Json.JsonObject("SAPHanaDatabase")] + public partial class AzureVmWorkloadSAPHanaDatabaseProtectableItem : AzureVmWorkloadProtectableItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaDatabaseProtectableItem class. + /// + public AzureVmWorkloadSAPHanaDatabaseProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaDatabaseProtectableItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Parent Unique Name is added to + /// provide the service formatted URI Name of the Parent + /// Only Applicable for data bases where the parent would be either + /// Instance or a SQL AG. + /// Host/Cluster Name for instance or + /// AG + /// Indicates if protectable item is + /// auto-protectable + /// Indicates if protectable item is + /// auto-protected + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + /// Pre-backup validation for + /// protectable objects + public AzureVmWorkloadSAPHanaDatabaseProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string parentUniqueName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), bool? isAutoProtected = default(bool?), int? subinquireditemcount = default(int?), int? subprotectableitemcount = default(int?), PreBackupValidation prebackupvalidation = default(PreBackupValidation)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, parentUniqueName, serverName, isAutoProtectable, isAutoProtected, subinquireditemcount, subprotectableitemcount, prebackupvalidation) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs new file mode 100644 index 000000000000..3112f2899d78 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure VM workload-specific protected item representing SAP HANA + /// Database. + /// + [Newtonsoft.Json.JsonObject("AzureVmWorkloadSAPHanaDatabase")] + public partial class AzureVmWorkloadSAPHanaDatabaseProtectedItem : AzureVmWorkloadProtectedItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaDatabaseProtectedItem class. + /// + public AzureVmWorkloadSAPHanaDatabaseProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaDatabaseProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the DB represented by + /// this backup item. + /// Host/Cluster Name for instance or + /// AG + /// Parent name of the DB such as Instance or + /// Availability Group. + /// Parent type of protected item, example: + /// for a DB, standalone server or distributed + /// Backup status of this backup + /// item. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Last backup operation status. + /// Possible values: Healthy, Unhealthy. Possible values include: + /// 'Invalid', 'Healthy', 'Unhealthy', 'IRPending' + /// Timestamp of the last backup operation + /// on this backup item. + /// Error details in last + /// backup + /// Data ID of the protected + /// item. + /// Health status of the backup + /// item, evaluated based on last heartbeat received. Possible values + /// include: 'Invalid', 'Healthy', 'Unhealthy', 'NotReachable', + /// 'IRPending' + /// Additional information for this backup + /// item. + /// Health details of different KPIs + public AzureVmWorkloadSAPHanaDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseWorkloadItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseWorkloadItem.cs new file mode 100644 index 000000000000..3ec5e6ccd24b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseWorkloadItem.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific workload item representing SAP HANA + /// Database. + /// + [Newtonsoft.Json.JsonObject("SAPHanaDatabase")] + public partial class AzureVmWorkloadSAPHanaDatabaseWorkloadItem : AzureVmWorkloadItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaDatabaseWorkloadItem class. + /// + public AzureVmWorkloadSAPHanaDatabaseWorkloadItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaDatabaseWorkloadItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Host/Cluster Name for instance or + /// AG + /// Indicates if workload item is + /// auto-protectable + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + public AzureVmWorkloadSAPHanaDatabaseWorkloadItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), int? subinquireditemcount = default(int?), int? subWorkloadItemCount = default(int?)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, serverName, isAutoProtectable, subinquireditemcount, subWorkloadItemCount) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaSystemProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaSystemProtectableItem.cs new file mode 100644 index 000000000000..6af272475203 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaSystemProtectableItem.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific protectable item representing SAP HANA + /// System. + /// + [Newtonsoft.Json.JsonObject("SAPHanaSystem")] + public partial class AzureVmWorkloadSAPHanaSystemProtectableItem : AzureVmWorkloadProtectableItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaSystemProtectableItem class. + /// + public AzureVmWorkloadSAPHanaSystemProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaSystemProtectableItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Parent Unique Name is added to + /// provide the service formatted URI Name of the Parent + /// Only Applicable for data bases where the parent would be either + /// Instance or a SQL AG. + /// Host/Cluster Name for instance or + /// AG + /// Indicates if protectable item is + /// auto-protectable + /// Indicates if protectable item is + /// auto-protected + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + /// Pre-backup validation for + /// protectable objects + public AzureVmWorkloadSAPHanaSystemProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string parentUniqueName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), bool? isAutoProtected = default(bool?), int? subinquireditemcount = default(int?), int? subprotectableitemcount = default(int?), PreBackupValidation prebackupvalidation = default(PreBackupValidation)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, parentUniqueName, serverName, isAutoProtectable, isAutoProtected, subinquireditemcount, subprotectableitemcount, prebackupvalidation) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaSystemWorkloadItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaSystemWorkloadItem.cs new file mode 100644 index 000000000000..d99ffcbab270 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaSystemWorkloadItem.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific workload item representing SAP HANA System. + /// + [Newtonsoft.Json.JsonObject("SAPHanaSystem")] + public partial class AzureVmWorkloadSAPHanaSystemWorkloadItem : AzureVmWorkloadItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaSystemWorkloadItem class. + /// + public AzureVmWorkloadSAPHanaSystemWorkloadItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSAPHanaSystemWorkloadItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Host/Cluster Name for instance or + /// AG + /// Indicates if workload item is + /// auto-protectable + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + public AzureVmWorkloadSAPHanaSystemWorkloadItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), int? subinquireditemcount = default(int?), int? subWorkloadItemCount = default(int?)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, serverName, isAutoProtectable, subinquireditemcount, subWorkloadItemCount) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.cs new file mode 100644 index 000000000000..eebf70aa6d7f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific protectable item representing SQL + /// Availability Group. + /// + [Newtonsoft.Json.JsonObject("SQLAvailabilityGroupContainer")] + public partial class AzureVmWorkloadSQLAvailabilityGroupProtectableItem : AzureVmWorkloadProtectableItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLAvailabilityGroupProtectableItem class. + /// + public AzureVmWorkloadSQLAvailabilityGroupProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLAvailabilityGroupProtectableItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Parent Unique Name is added to + /// provide the service formatted URI Name of the Parent + /// Only Applicable for data bases where the parent would be either + /// Instance or a SQL AG. + /// Host/Cluster Name for instance or + /// AG + /// Indicates if protectable item is + /// auto-protectable + /// Indicates if protectable item is + /// auto-protected + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + /// Pre-backup validation for + /// protectable objects + public AzureVmWorkloadSQLAvailabilityGroupProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string parentUniqueName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), bool? isAutoProtected = default(bool?), int? subinquireditemcount = default(int?), int? subprotectableitemcount = default(int?), PreBackupValidation prebackupvalidation = default(PreBackupValidation)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, parentUniqueName, serverName, isAutoProtectable, isAutoProtected, subinquireditemcount, subprotectableitemcount, prebackupvalidation) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectableItem.cs new file mode 100644 index 000000000000..5cefd5de7ca6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectableItem.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific protectable item representing SQL Database. + /// + [Newtonsoft.Json.JsonObject("SQLDataBase")] + public partial class AzureVmWorkloadSQLDatabaseProtectableItem : AzureVmWorkloadProtectableItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLDatabaseProtectableItem class. + /// + public AzureVmWorkloadSQLDatabaseProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLDatabaseProtectableItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Parent Unique Name is added to + /// provide the service formatted URI Name of the Parent + /// Only Applicable for data bases where the parent would be either + /// Instance or a SQL AG. + /// Host/Cluster Name for instance or + /// AG + /// Indicates if protectable item is + /// auto-protectable + /// Indicates if protectable item is + /// auto-protected + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + /// Pre-backup validation for + /// protectable objects + public AzureVmWorkloadSQLDatabaseProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string parentUniqueName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), bool? isAutoProtected = default(bool?), int? subinquireditemcount = default(int?), int? subprotectableitemcount = default(int?), PreBackupValidation prebackupvalidation = default(PreBackupValidation)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, parentUniqueName, serverName, isAutoProtectable, isAutoProtected, subinquireditemcount, subprotectableitemcount, prebackupvalidation) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs new file mode 100644 index 000000000000..7bbf79ddb147 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs @@ -0,0 +1,116 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure VM workload-specific protected item representing SQL Database. + /// + [Newtonsoft.Json.JsonObject("AzureVmWorkloadSQLDatabase")] + public partial class AzureVmWorkloadSQLDatabaseProtectedItem : AzureVmWorkloadProtectedItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLDatabaseProtectedItem class. + /// + public AzureVmWorkloadSQLDatabaseProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLDatabaseProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the DB represented by + /// this backup item. + /// Host/Cluster Name for instance or + /// AG + /// Parent name of the DB such as Instance or + /// Availability Group. + /// Parent type of protected item, example: + /// for a DB, standalone server or distributed + /// Backup status of this backup + /// item. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Last backup operation status. + /// Possible values: Healthy, Unhealthy. Possible values include: + /// 'Invalid', 'Healthy', 'Unhealthy', 'IRPending' + /// Timestamp of the last backup operation + /// on this backup item. + /// Error details in last + /// backup + /// Data ID of the protected + /// item. + /// Health status of the backup + /// item, evaluated based on last heartbeat received. Possible values + /// include: 'Invalid', 'Healthy', 'Unhealthy', 'NotReachable', + /// 'IRPending' + /// Additional information for this backup + /// item. + /// Health details of different KPIs + public AzureVmWorkloadSQLDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseWorkloadItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseWorkloadItem.cs new file mode 100644 index 000000000000..9809ceb4e577 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseWorkloadItem.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific workload item representing SQL Database. + /// + [Newtonsoft.Json.JsonObject("SQLDataBase")] + public partial class AzureVmWorkloadSQLDatabaseWorkloadItem : AzureVmWorkloadItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLDatabaseWorkloadItem class. + /// + public AzureVmWorkloadSQLDatabaseWorkloadItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLDatabaseWorkloadItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Host/Cluster Name for instance or + /// AG + /// Indicates if workload item is + /// auto-protectable + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + public AzureVmWorkloadSQLDatabaseWorkloadItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), int? subinquireditemcount = default(int?), int? subWorkloadItemCount = default(int?)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, serverName, isAutoProtectable, subinquireditemcount, subWorkloadItemCount) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLInstanceProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLInstanceProtectableItem.cs new file mode 100644 index 000000000000..e1b79b3dc948 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLInstanceProtectableItem.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload-specific protectable item representing SQL Instance. + /// + [Newtonsoft.Json.JsonObject("SQLInstance")] + public partial class AzureVmWorkloadSQLInstanceProtectableItem : AzureVmWorkloadProtectableItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLInstanceProtectableItem class. + /// + public AzureVmWorkloadSQLInstanceProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLInstanceProtectableItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Parent Unique Name is added to + /// provide the service formatted URI Name of the Parent + /// Only Applicable for data bases where the parent would be either + /// Instance or a SQL AG. + /// Host/Cluster Name for instance or + /// AG + /// Indicates if protectable item is + /// auto-protectable + /// Indicates if protectable item is + /// auto-protected + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + /// Pre-backup validation for + /// protectable objects + public AzureVmWorkloadSQLInstanceProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string parentUniqueName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), bool? isAutoProtected = default(bool?), int? subinquireditemcount = default(int?), int? subprotectableitemcount = default(int?), PreBackupValidation prebackupvalidation = default(PreBackupValidation)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, parentUniqueName, serverName, isAutoProtectable, isAutoProtected, subinquireditemcount, subprotectableitemcount, prebackupvalidation) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLInstanceWorkloadItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLInstanceWorkloadItem.cs new file mode 100644 index 000000000000..79a189602d0f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLInstanceWorkloadItem.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure VM workload-specific workload item representing SQL Instance. + /// + [Newtonsoft.Json.JsonObject("SQLInstance")] + public partial class AzureVmWorkloadSQLInstanceWorkloadItem : AzureVmWorkloadItem + { + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLInstanceWorkloadItem class. + /// + public AzureVmWorkloadSQLInstanceWorkloadItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureVmWorkloadSQLInstanceWorkloadItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Name for instance or AG + /// Host/Cluster Name for instance or + /// AG + /// Indicates if workload item is + /// auto-protectable + /// For instance or AG, indicates + /// number of DB's present + /// For instance or AG, indicates + /// number of DB's to be protected + /// Data Directory Paths for default + /// directories + public AzureVmWorkloadSQLInstanceWorkloadItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string parentName = default(string), string serverName = default(string), bool? isAutoProtectable = default(bool?), int? subinquireditemcount = default(int?), int? subWorkloadItemCount = default(int?), IList dataDirectoryPaths = default(IList)) + : base(backupManagementType, workloadType, friendlyName, protectionState, parentName, serverName, isAutoProtectable, subinquireditemcount, subWorkloadItemCount) + { + DataDirectoryPaths = dataDirectoryPaths; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets data Directory Paths for default directories + /// + [JsonProperty(PropertyName = "dataDirectoryPaths")] + public IList DataDirectoryPaths { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadAutoProtectionIntent.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadAutoProtectionIntent.cs new file mode 100644 index 000000000000..d024b760ab31 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadAutoProtectionIntent.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Azure Recovery Services Vault specific protection intent item. + /// + public partial class AzureWorkloadAutoProtectionIntent : AzureRecoveryServiceVaultProtectionIntent + { + /// + /// Initializes a new instance of the AzureWorkloadAutoProtectionIntent + /// class. + /// + public AzureWorkloadAutoProtectionIntent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadAutoProtectionIntent + /// class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// ARM ID of the resource to be backed + /// up. + /// ID of the item which is getting protected, In + /// case of Azure Vm , it is ProtectedItemId + /// ID of the backup policy with which this item + /// is backed up. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + public AzureWorkloadAutoProtectionIntent(string backupManagementType = default(string), string sourceResourceId = default(string), string itemId = default(string), string policyId = default(string), string protectionState = default(string)) + : base(backupManagementType, sourceResourceId, itemId, policyId, protectionState) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadBackupRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadBackupRequest.cs new file mode 100644 index 000000000000..1f6361bac454 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadBackupRequest.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// AzureWorkload workload-specific backup request. + /// + public partial class AzureWorkloadBackupRequest : BackupRequest + { + /// + /// Initializes a new instance of the AzureWorkloadBackupRequest class. + /// + public AzureWorkloadBackupRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadBackupRequest class. + /// + /// Type of backup, viz. Full, Differential, + /// Log or CopyOnlyFull. Possible values include: 'Invalid', 'Full', + /// 'Differential', 'Log', 'CopyOnlyFull', 'Incremental' + /// Bool for Compression + /// setting + /// Backup copy will expire + /// after the time specified (UTC). + public AzureWorkloadBackupRequest(string backupType = default(string), bool? enableCompression = default(bool?), System.DateTime? recoveryPointExpiryTimeInUTC = default(System.DateTime?)) + { + BackupType = backupType; + EnableCompression = enableCompression; + RecoveryPointExpiryTimeInUTC = recoveryPointExpiryTimeInUTC; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of backup, viz. Full, Differential, Log or + /// CopyOnlyFull. Possible values include: 'Invalid', 'Full', + /// 'Differential', 'Log', 'CopyOnlyFull', 'Incremental' + /// + [JsonProperty(PropertyName = "backupType")] + public string BackupType { get; set; } + + /// + /// Gets or sets bool for Compression setting + /// + [JsonProperty(PropertyName = "enableCompression")] + public bool? EnableCompression { get; set; } + + /// + /// Gets or sets backup copy will expire after the time specified + /// (UTC). + /// + [JsonProperty(PropertyName = "recoveryPointExpiryTimeInUTC")] + public System.DateTime? RecoveryPointExpiryTimeInUTC { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainer.cs new file mode 100644 index 000000000000..cca4ae003405 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainer.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Container for the workloads running inside Azure Compute or Classic + /// Compute. + /// + public partial class AzureWorkloadContainer : ProtectionContainer + { + /// + /// Initializes a new instance of the AzureWorkloadContainer class. + /// + public AzureWorkloadContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// ARM ID of the virtual machine + /// represented by this Azure Workload Container + /// Time stamp when this container was + /// updated. + /// Additional details of a workload + /// container. + /// Workload type for which registration was + /// sent. Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Re-Do Operation. Possible values + /// include: 'Invalid', 'Register', 'Reregister' + public AzureWorkloadContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + { + SourceResourceId = sourceResourceId; + LastUpdatedTime = lastUpdatedTime; + ExtendedInfo = extendedInfo; + WorkloadType = workloadType; + OperationType = operationType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ARM ID of the virtual machine represented by this + /// Azure Workload Container + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + /// + /// Gets or sets time stamp when this container was updated. + /// + [JsonProperty(PropertyName = "lastUpdatedTime")] + public System.DateTime? LastUpdatedTime { get; set; } + + /// + /// Gets or sets additional details of a workload container. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureWorkloadContainerExtendedInfo ExtendedInfo { get; set; } + + /// + /// Gets or sets workload type for which registration was sent. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + /// + /// Gets or sets re-Do Operation. Possible values include: 'Invalid', + /// 'Register', 'Reregister' + /// + [JsonProperty(PropertyName = "operationType")] + public string OperationType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerAutoProtectionIntent.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerAutoProtectionIntent.cs new file mode 100644 index 000000000000..91ac77c6bd1c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerAutoProtectionIntent.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Azure workload specific protection intent item. + /// + public partial class AzureWorkloadContainerAutoProtectionIntent : ProtectionIntent + { + /// + /// Initializes a new instance of the + /// AzureWorkloadContainerAutoProtectionIntent class. + /// + public AzureWorkloadContainerAutoProtectionIntent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadContainerAutoProtectionIntent class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// ARM ID of the resource to be backed + /// up. + /// ID of the item which is getting protected, In + /// case of Azure Vm , it is ProtectedItemId + /// ID of the backup policy with which this item + /// is backed up. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + public AzureWorkloadContainerAutoProtectionIntent(string backupManagementType = default(string), string sourceResourceId = default(string), string itemId = default(string), string policyId = default(string), string protectionState = default(string)) + : base(backupManagementType, sourceResourceId, itemId, policyId, protectionState) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerExtendedInfo.cs new file mode 100644 index 000000000000..257ce42f4771 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerExtendedInfo.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Extended information of the container. + /// + public partial class AzureWorkloadContainerExtendedInfo + { + /// + /// Initializes a new instance of the + /// AzureWorkloadContainerExtendedInfo class. + /// + public AzureWorkloadContainerExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadContainerExtendedInfo class. + /// + /// Host Os Name in case of Stand Alone + /// and Cluster Name in case of distributed container. + /// Inquiry Status for the container. + /// List of the nodes in case of distributed + /// container. + public AzureWorkloadContainerExtendedInfo(string hostServerName = default(string), InquiryInfo inquiryInfo = default(InquiryInfo), IList nodesList = default(IList)) + { + HostServerName = hostServerName; + InquiryInfo = inquiryInfo; + NodesList = nodesList; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets host Os Name in case of Stand Alone and Cluster Name + /// in case of distributed container. + /// + [JsonProperty(PropertyName = "hostServerName")] + public string HostServerName { get; set; } + + /// + /// Gets or sets inquiry Status for the container. + /// + [JsonProperty(PropertyName = "inquiryInfo")] + public InquiryInfo InquiryInfo { get; set; } + + /// + /// Gets or sets list of the nodes in case of distributed container. + /// + [JsonProperty(PropertyName = "nodesList")] + public IList NodesList { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadErrorInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadErrorInfo.cs new file mode 100644 index 000000000000..30e68a51975e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadErrorInfo.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure storage specific error information + /// + public partial class AzureWorkloadErrorInfo + { + /// + /// Initializes a new instance of the AzureWorkloadErrorInfo class. + /// + public AzureWorkloadErrorInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadErrorInfo class. + /// + /// Error code. + /// Localized error string. + /// Title: Typically, the entity that the + /// error pertains to. + /// List of localized recommendations for + /// above error code. + /// Additional details for above error + /// code. + public AzureWorkloadErrorInfo(int? errorCode = default(int?), string errorString = default(string), string errorTitle = default(string), IList recommendations = default(IList), string additionalDetails = default(string)) + { + ErrorCode = errorCode; + ErrorString = errorString; + ErrorTitle = errorTitle; + Recommendations = recommendations; + AdditionalDetails = additionalDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code. + /// + [JsonProperty(PropertyName = "errorCode")] + public int? ErrorCode { get; set; } + + /// + /// Gets or sets localized error string. + /// + [JsonProperty(PropertyName = "errorString")] + public string ErrorString { get; set; } + + /// + /// Gets or sets title: Typically, the entity that the error pertains + /// to. + /// + [JsonProperty(PropertyName = "errorTitle")] + public string ErrorTitle { get; set; } + + /// + /// Gets or sets list of localized recommendations for above error + /// code. + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; set; } + + /// + /// Gets or sets additional details for above error code. + /// + [JsonProperty(PropertyName = "additionalDetails")] + public string AdditionalDetails { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJob.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJob.cs new file mode 100644 index 000000000000..15c57ce43d99 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJob.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure storage specific job. + /// + public partial class AzureWorkloadJob : Job + { + /// + /// Initializes a new instance of the AzureWorkloadJob class. + /// + public AzureWorkloadJob() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadJob class. + /// + /// Friendly name of the entity on + /// which the current job is executing. + /// Backup management type to + /// execute the current job. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// The operation name. + /// Job status. + /// The start time. + /// The end time. + /// ActivityId of job. + /// Workload type of the job + /// Time elapsed during the execution of this + /// job. + /// Gets or sets the state/actions applicable + /// on this job like cancel/retry. + /// Error details on execution of this + /// job. + /// Additional information about the + /// job. + public AzureWorkloadJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), string workloadType = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList actionsInfo = default(IList), IList errorDetails = default(IList), AzureWorkloadJobExtendedInfo extendedInfo = default(AzureWorkloadJobExtendedInfo)) + : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) + { + WorkloadType = workloadType; + Duration = duration; + ActionsInfo = actionsInfo; + ErrorDetails = errorDetails; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets workload type of the job + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + /// + /// Gets or sets time elapsed during the execution of this job. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets the state/actions applicable on this job like + /// cancel/retry. + /// + [JsonProperty(PropertyName = "actionsInfo")] + public IList ActionsInfo { get; set; } + + /// + /// Gets or sets error details on execution of this job. + /// + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; set; } + + /// + /// Gets or sets additional information about the job. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureWorkloadJobExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJobExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJobExtendedInfo.cs new file mode 100644 index 000000000000..593d0f099ae0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJobExtendedInfo.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure VM workload-specific additional information for job. + /// + public partial class AzureWorkloadJobExtendedInfo + { + /// + /// Initializes a new instance of the AzureWorkloadJobExtendedInfo + /// class. + /// + public AzureWorkloadJobExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadJobExtendedInfo + /// class. + /// + /// List of tasks for this job + /// Job properties. + /// Non localized error message on + /// job execution. + public AzureWorkloadJobExtendedInfo(IList tasksList = default(IList), IDictionary propertyBag = default(IDictionary), string dynamicErrorMessage = default(string)) + { + TasksList = tasksList; + PropertyBag = propertyBag; + DynamicErrorMessage = dynamicErrorMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of tasks for this job + /// + [JsonProperty(PropertyName = "tasksList")] + public IList TasksList { get; set; } + + /// + /// Gets or sets job properties. + /// + [JsonProperty(PropertyName = "propertyBag")] + public IDictionary PropertyBag { get; set; } + + /// + /// Gets or sets non localized error message on job execution. + /// + [JsonProperty(PropertyName = "dynamicErrorMessage")] + public string DynamicErrorMessage { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJobTaskDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJobTaskDetails.cs new file mode 100644 index 000000000000..e636734d4cc8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadJobTaskDetails.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure VM workload specific job task details. + /// + public partial class AzureWorkloadJobTaskDetails + { + /// + /// Initializes a new instance of the AzureWorkloadJobTaskDetails + /// class. + /// + public AzureWorkloadJobTaskDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadJobTaskDetails + /// class. + /// + /// The task display name. + /// The status. + public AzureWorkloadJobTaskDetails(string taskId = default(string), string status = default(string)) + { + TaskId = taskId; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the task display name. + /// + [JsonProperty(PropertyName = "taskId")] + public string TaskId { get; set; } + + /// + /// Gets or sets the status. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs new file mode 100644 index 000000000000..e1b2405cf12d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Recovery point specific to PointInTime + /// + public partial class AzureWorkloadPointInTimeRecoveryPoint : AzureWorkloadRecoveryPoint + { + /// + /// Initializes a new instance of the + /// AzureWorkloadPointInTimeRecoveryPoint class. + /// + public AzureWorkloadPointInTimeRecoveryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadPointInTimeRecoveryPoint class. + /// + /// UTC time at which recovery + /// point was created + /// Type of restore point. Possible values include: + /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier + /// List of log ranges + public AzureWorkloadPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), IList timeRanges = default(IList)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo) + { + TimeRanges = timeRanges; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of log ranges + /// + [JsonProperty(PropertyName = "timeRanges")] + public IList TimeRanges { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRestoreRequest.cs new file mode 100644 index 000000000000..18fb153b3c84 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRestoreRequest.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload SAP Hana -specific restore. Specifically for + /// PointInTime/Log restore + /// + public partial class AzureWorkloadPointInTimeRestoreRequest : AzureWorkloadRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadPointInTimeRestoreRequest class. + /// + public AzureWorkloadPointInTimeRestoreRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadPointInTimeRestoreRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// PointInTime value + public AzureWorkloadPointInTimeRestoreRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string), System.DateTime? pointInTime = default(System.DateTime?)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, targetVirtualMachineId) + { + PointInTime = pointInTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets pointInTime value + /// + [JsonProperty(PropertyName = "pointInTime")] + public System.DateTime? PointInTime { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRecoveryPoint.cs new file mode 100644 index 000000000000..35558c50b9a8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRecoveryPoint.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Workload specific recovery point, specifically encapsulates full/diff + /// recovery point + /// + public partial class AzureWorkloadRecoveryPoint : RecoveryPoint + { + /// + /// Initializes a new instance of the AzureWorkloadRecoveryPoint class. + /// + public AzureWorkloadRecoveryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadRecoveryPoint class. + /// + /// UTC time at which recovery + /// point was created + /// Type of restore point. Possible values include: + /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier + public AzureWorkloadRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) + { + RecoveryPointTimeInUTC = recoveryPointTimeInUTC; + Type = type; + RecoveryPointTierDetails = recoveryPointTierDetails; + RecoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets UTC time at which recovery point was created + /// + [JsonProperty(PropertyName = "recoveryPointTimeInUTC")] + public System.DateTime? RecoveryPointTimeInUTC { get; set; } + + /// + /// Gets or sets type of restore point. Possible values include: + /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets recovery point tier information. + /// + [JsonProperty(PropertyName = "recoveryPointTierDetails")] + public IList RecoveryPointTierDetails { get; set; } + + /// + /// Gets or sets eligibility of RP to be moved to another tier + /// + [JsonProperty(PropertyName = "recoveryPointMoveReadinessInfo")] + public IDictionary RecoveryPointMoveReadinessInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRestoreRequest.cs new file mode 100644 index 000000000000..ee14ca1580ee --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRestoreRequest.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload-specific restore. + /// + public partial class AzureWorkloadRestoreRequest : RestoreRequest + { + /// + /// Initializes a new instance of the AzureWorkloadRestoreRequest + /// class. + /// + public AzureWorkloadRestoreRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadRestoreRequest + /// class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + public AzureWorkloadRestoreRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string)) + { + RecoveryType = recoveryType; + SourceResourceId = sourceResourceId; + PropertyBag = propertyBag; + TargetInfo = targetInfo; + RecoveryMode = recoveryMode; + TargetVirtualMachineId = targetVirtualMachineId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of this recovery. Possible values include: + /// 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', + /// 'Offline' + /// + [JsonProperty(PropertyName = "recoveryType")] + public string RecoveryType { get; set; } + + /// + /// Gets or sets fully qualified ARM ID of the VM on which workload + /// that was running is being recovered. + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + /// + /// Gets or sets workload specific property bag. + /// + [JsonProperty(PropertyName = "propertyBag")] + public IDictionary PropertyBag { get; set; } + + /// + /// Gets or sets details of target database + /// + [JsonProperty(PropertyName = "targetInfo")] + public TargetRestoreInfo TargetInfo { get; set; } + + /// + /// Gets or sets defines whether the current recovery mode is file + /// restore or database restore. Possible values include: 'Invalid', + /// 'FileRecovery', 'WorkloadRecovery' + /// + [JsonProperty(PropertyName = "recoveryMode")] + public string RecoveryMode { get; set; } + + /// + /// Gets or sets this is the complete ARM Id of the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [JsonProperty(PropertyName = "targetVirtualMachineId")] + public string TargetVirtualMachineId { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs new file mode 100644 index 000000000000..f46462eedc30 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Recovery point specific to PointInTime in SAPHana + /// + public partial class AzureWorkloadSAPHanaPointInTimeRecoveryPoint : AzureWorkloadPointInTimeRecoveryPoint + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaPointInTimeRecoveryPoint class. + /// + public AzureWorkloadSAPHanaPointInTimeRecoveryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaPointInTimeRecoveryPoint class. + /// + /// UTC time at which recovery + /// point was created + /// Type of restore point. Possible values include: + /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier + /// List of log ranges + public AzureWorkloadSAPHanaPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), IList timeRanges = default(IList)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, timeRanges) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.cs new file mode 100644 index 000000000000..965ff511c0bd --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload SAP Hana -specific restore. Specifically for + /// PointInTime/Log restore + /// + public partial class AzureWorkloadSAPHanaPointInTimeRestoreRequest : AzureWorkloadSAPHanaRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaPointInTimeRestoreRequest class. + /// + public AzureWorkloadSAPHanaPointInTimeRestoreRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaPointInTimeRestoreRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// PointInTime value + public AzureWorkloadSAPHanaPointInTimeRestoreRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string), System.DateTime? pointInTime = default(System.DateTime?)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, targetVirtualMachineId) + { + PointInTime = pointInTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets pointInTime value + /// + [JsonProperty(PropertyName = "pointInTime")] + public System.DateTime? PointInTime { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..bbdc0ab7536b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of + /// recovery point. + /// + public partial class AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest : AzureWorkloadSAPHanaPointInTimeRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest class. + /// + public AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// PointInTime value + /// RP Rehydration + /// Info + public AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string), System.DateTime? pointInTime = default(System.DateTime?), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, targetVirtualMachineId, pointInTime) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs new file mode 100644 index 000000000000..28ec04fcb4b7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// SAPHana specific recoverypoint, specifically encapsulates full/diff + /// recoverypoints + /// + public partial class AzureWorkloadSAPHanaRecoveryPoint : AzureWorkloadRecoveryPoint + { + /// + /// Initializes a new instance of the AzureWorkloadSAPHanaRecoveryPoint + /// class. + /// + public AzureWorkloadSAPHanaRecoveryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadSAPHanaRecoveryPoint + /// class. + /// + /// UTC time at which recovery + /// point was created + /// Type of restore point. Possible values include: + /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier + public AzureWorkloadSAPHanaRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreRequest.cs new file mode 100644 index 000000000000..9c9eb53ba5a0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreRequest.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload SAP Hana-specific restore. + /// + public partial class AzureWorkloadSAPHanaRestoreRequest : AzureWorkloadRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaRestoreRequest class. + /// + public AzureWorkloadSAPHanaRestoreRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaRestoreRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + public AzureWorkloadSAPHanaRestoreRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, targetVirtualMachineId) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..a6550871ea0c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of + /// recovery point. + /// + public partial class AzureWorkloadSAPHanaRestoreWithRehydrateRequest : AzureWorkloadSAPHanaRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaRestoreWithRehydrateRequest class. + /// + public AzureWorkloadSAPHanaRestoreWithRehydrateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaRestoreWithRehydrateRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// RP Rehydration + /// Info + public AzureWorkloadSAPHanaRestoreWithRehydrateRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, targetVirtualMachineId) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLAutoProtectionIntent.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLAutoProtectionIntent.cs new file mode 100644 index 000000000000..532ecd989de4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLAutoProtectionIntent.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Workload SQL Auto Protection intent item. + /// + public partial class AzureWorkloadSQLAutoProtectionIntent : AzureWorkloadAutoProtectionIntent + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLAutoProtectionIntent class. + /// + public AzureWorkloadSQLAutoProtectionIntent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLAutoProtectionIntent class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// ARM ID of the resource to be backed + /// up. + /// ID of the item which is getting protected, In + /// case of Azure Vm , it is ProtectedItemId + /// ID of the backup policy with which this item + /// is backed up. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Workload item type of the item for + /// which intent is to be set. Possible values include: 'Invalid', + /// 'SQLInstance', 'SQLDataBase', 'SAPHanaSystem', 'SAPHanaDatabase', + /// 'SAPAseSystem', 'SAPAseDatabase' + public AzureWorkloadSQLAutoProtectionIntent(string backupManagementType = default(string), string sourceResourceId = default(string), string itemId = default(string), string policyId = default(string), string protectionState = default(string), string workloadItemType = default(string)) + : base(backupManagementType, sourceResourceId, itemId, policyId, protectionState) + { + WorkloadItemType = workloadItemType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets workload item type of the item for which intent is to + /// be set. Possible values include: 'Invalid', 'SQLInstance', + /// 'SQLDataBase', 'SAPHanaSystem', 'SAPHanaDatabase', 'SAPAseSystem', + /// 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workloadItemType")] + public string WorkloadItemType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs new file mode 100644 index 000000000000..1f8071787b13 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Recovery point specific to PointInTime + /// + public partial class AzureWorkloadSQLPointInTimeRecoveryPoint : AzureWorkloadSQLRecoveryPoint + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLPointInTimeRecoveryPoint class. + /// + public AzureWorkloadSQLPointInTimeRecoveryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLPointInTimeRecoveryPoint class. + /// + /// UTC time at which recovery + /// point was created + /// Type of restore point. Possible values include: + /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier + /// Extended Info that provides data + /// directory details. Will be populated in two cases: + /// When a specific recovery point is accessed using GetRecoveryPoint + /// Or when ListRecoveryPoints is called for Log RP only with + /// ExtendedInfo query filter + /// List of log ranges + public AzureWorkloadSQLPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo), IList timeRanges = default(IList)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, extendedInfo) + { + TimeRanges = timeRanges; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of log ranges + /// + [JsonProperty(PropertyName = "timeRanges")] + public IList TimeRanges { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreRequest.cs new file mode 100644 index 000000000000..6820893f24a0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreRequest.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload SQL -specific restore. Specifically for PointInTime/Log + /// restore + /// + public partial class AzureWorkloadSQLPointInTimeRestoreRequest : AzureWorkloadSQLRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLPointInTimeRestoreRequest class. + /// + public AzureWorkloadSQLPointInTimeRestoreRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLPointInTimeRestoreRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// Default option set + /// to true. If this is set to false, alternate data directory must be + /// provided + /// SQL specific property where user can + /// chose to set no-recovery when restore operation is tried + /// Data directory + /// details + /// PointInTime value + public AzureWorkloadSQLPointInTimeRestoreRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string), bool? shouldUseAlternateTargetLocation = default(bool?), bool? isNonRecoverable = default(bool?), IList alternateDirectoryPaths = default(IList), System.DateTime? pointInTime = default(System.DateTime?)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, targetVirtualMachineId, shouldUseAlternateTargetLocation, isNonRecoverable, alternateDirectoryPaths) + { + PointInTime = pointInTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets pointInTime value + /// + [JsonProperty(PropertyName = "pointInTime")] + public System.DateTime? PointInTime { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..99090a935043 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload SQL-specific restore with integrated rehydration of + /// recovery point. + /// + public partial class AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest : AzureWorkloadSQLPointInTimeRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest class. + /// + public AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// Default option set + /// to true. If this is set to false, alternate data directory must be + /// provided + /// SQL specific property where user can + /// chose to set no-recovery when restore operation is tried + /// Data directory + /// details + /// PointInTime value + /// RP Rehydration + /// Info + public AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string), bool? shouldUseAlternateTargetLocation = default(bool?), bool? isNonRecoverable = default(bool?), IList alternateDirectoryPaths = default(IList), System.DateTime? pointInTime = default(System.DateTime?), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, targetVirtualMachineId, shouldUseAlternateTargetLocation, isNonRecoverable, alternateDirectoryPaths, pointInTime) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs new file mode 100644 index 000000000000..a51438a58e93 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// SQL specific recoverypoint, specifically encapsulates full/diff + /// recoverypoint along with extended info + /// + public partial class AzureWorkloadSQLRecoveryPoint : AzureWorkloadRecoveryPoint + { + /// + /// Initializes a new instance of the AzureWorkloadSQLRecoveryPoint + /// class. + /// + public AzureWorkloadSQLRecoveryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadSQLRecoveryPoint + /// class. + /// + /// UTC time at which recovery + /// point was created + /// Type of restore point. Possible values include: + /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier + /// Extended Info that provides data + /// directory details. Will be populated in two cases: + /// When a specific recovery point is accessed using GetRecoveryPoint + /// Or when ListRecoveryPoints is called for Log RP only with + /// ExtendedInfo query filter + public AzureWorkloadSQLRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo) + { + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets extended Info that provides data directory details. + /// Will be populated in two cases: + /// When a specific recovery point is accessed using GetRecoveryPoint + /// Or when ListRecoveryPoints is called for Log RP only with + /// ExtendedInfo query filter + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureWorkloadSQLRecoveryPointExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPointExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPointExtendedInfo.cs new file mode 100644 index 000000000000..8dd6ac0c0f2c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPointExtendedInfo.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Extended info class details + /// + public partial class AzureWorkloadSQLRecoveryPointExtendedInfo + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLRecoveryPointExtendedInfo class. + /// + public AzureWorkloadSQLRecoveryPointExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLRecoveryPointExtendedInfo class. + /// + /// UTC time at which data + /// directory info was captured + /// List of data directory paths + /// during restore operation. + public AzureWorkloadSQLRecoveryPointExtendedInfo(System.DateTime? dataDirectoryTimeInUTC = default(System.DateTime?), IList dataDirectoryPaths = default(IList)) + { + DataDirectoryTimeInUTC = dataDirectoryTimeInUTC; + DataDirectoryPaths = dataDirectoryPaths; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets UTC time at which data directory info was captured + /// + [JsonProperty(PropertyName = "dataDirectoryTimeInUTC")] + public System.DateTime? DataDirectoryTimeInUTC { get; set; } + + /// + /// Gets or sets list of data directory paths during restore operation. + /// + [JsonProperty(PropertyName = "dataDirectoryPaths")] + public IList DataDirectoryPaths { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreRequest.cs new file mode 100644 index 000000000000..fb153fbcda13 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreRequest.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload SQL -specific restore. Specifically for full/diff restore + /// + public partial class AzureWorkloadSQLRestoreRequest : AzureWorkloadRestoreRequest + { + /// + /// Initializes a new instance of the AzureWorkloadSQLRestoreRequest + /// class. + /// + public AzureWorkloadSQLRestoreRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureWorkloadSQLRestoreRequest + /// class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// Default option set + /// to true. If this is set to false, alternate data directory must be + /// provided + /// SQL specific property where user can + /// chose to set no-recovery when restore operation is tried + /// Data directory + /// details + public AzureWorkloadSQLRestoreRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string), bool? shouldUseAlternateTargetLocation = default(bool?), bool? isNonRecoverable = default(bool?), IList alternateDirectoryPaths = default(IList)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, targetVirtualMachineId) + { + ShouldUseAlternateTargetLocation = shouldUseAlternateTargetLocation; + IsNonRecoverable = isNonRecoverable; + AlternateDirectoryPaths = alternateDirectoryPaths; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets default option set to true. If this is set to false, + /// alternate data directory must be provided + /// + [JsonProperty(PropertyName = "shouldUseAlternateTargetLocation")] + public bool? ShouldUseAlternateTargetLocation { get; set; } + + /// + /// Gets or sets SQL specific property where user can chose to set + /// no-recovery when restore operation is tried + /// + [JsonProperty(PropertyName = "isNonRecoverable")] + public bool? IsNonRecoverable { get; set; } + + /// + /// Gets or sets data directory details + /// + [JsonProperty(PropertyName = "alternateDirectoryPaths")] + public IList AlternateDirectoryPaths { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..89d0b14d0aab --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureWorkload SQL-specific restore with integrated rehydration of + /// recovery point + /// + public partial class AzureWorkloadSQLRestoreWithRehydrateRequest : AzureWorkloadSQLRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLRestoreWithRehydrateRequest class. + /// + public AzureWorkloadSQLRestoreWithRehydrateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLRestoreWithRehydrateRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// This is the complete ARM Id of + /// the target VM + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// Default option set + /// to true. If this is set to false, alternate data directory must be + /// provided + /// SQL specific property where user can + /// chose to set no-recovery when restore operation is tried + /// Data directory + /// details + /// RP Rehydration + /// Info + public AzureWorkloadSQLRestoreWithRehydrateRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetVirtualMachineId = default(string), bool? shouldUseAlternateTargetLocation = default(bool?), bool? isNonRecoverable = default(bool?), IList alternateDirectoryPaths = default(IList), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, targetVirtualMachineId, shouldUseAlternateTargetLocation, isNonRecoverable, alternateDirectoryPaths) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BEKDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BEKDetails.cs new file mode 100644 index 000000000000..36de291c0131 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BEKDetails.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// BEK is bitlocker encryption key. + /// + public partial class BEKDetails + { + /// + /// Initializes a new instance of the BEKDetails class. + /// + public BEKDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BEKDetails class. + /// + /// Secret is BEK. + /// ID of the Key Vault where this Secret + /// is stored. + /// BEK data. + public BEKDetails(string secretUrl = default(string), string secretVaultId = default(string), string secretData = default(string)) + { + SecretUrl = secretUrl; + SecretVaultId = secretVaultId; + SecretData = secretData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets secret is BEK. + /// + [JsonProperty(PropertyName = "secretUrl")] + public string SecretUrl { get; set; } + + /// + /// Gets or sets ID of the Key Vault where this Secret is stored. + /// + [JsonProperty(PropertyName = "secretVaultId")] + public string SecretVaultId { get; set; } + + /// + /// Gets or sets BEK data. + /// + [JsonProperty(PropertyName = "secretData")] + public string SecretData { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupEngineQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupEngineQueryObject.cs new file mode 100644 index 000000000000..cd87e6e2b35c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupEngineQueryObject.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Query parameters to fetch list of backup engines. + /// + public partial class BMSBackupEngineQueryObject + { + /// + /// Initializes a new instance of the BMSBackupEngineQueryObject class. + /// + public BMSBackupEngineQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BMSBackupEngineQueryObject class. + /// + /// attribute to add extended info + public BMSBackupEngineQueryObject(string expand = default(string)) + { + Expand = expand; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets attribute to add extended info + /// + [JsonProperty(PropertyName = "expand")] + public string Expand { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupEnginesQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupEnginesQueryObject.cs new file mode 100644 index 000000000000..8264489459f3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupEnginesQueryObject.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Query parameters to fetch list of backup engines. + /// + public partial class BMSBackupEnginesQueryObject + { + /// + /// Initializes a new instance of the BMSBackupEnginesQueryObject + /// class. + /// + public BMSBackupEnginesQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BMSBackupEnginesQueryObject + /// class. + /// + /// Backup management type for the + /// backup engine. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Friendly name of the backup + /// engine. + /// Attribute to add extended info. + public BMSBackupEnginesQueryObject(string backupManagementType = default(string), string friendlyName = default(string), string expand = default(string)) + { + BackupManagementType = backupManagementType; + FriendlyName = friendlyName; + Expand = expand; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup management type for the backup engine. Possible + /// values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets friendly name of the backup engine. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets attribute to add extended info. + /// + [JsonProperty(PropertyName = "expand")] + public string Expand { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupSummariesQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupSummariesQueryObject.cs new file mode 100644 index 000000000000..e50edf55310d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSBackupSummariesQueryObject.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Query parameters to fetch backup summaries. + /// + public partial class BMSBackupSummariesQueryObject + { + /// + /// Initializes a new instance of the BMSBackupSummariesQueryObject + /// class. + /// + public BMSBackupSummariesQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BMSBackupSummariesQueryObject + /// class. + /// + /// Backup management type for this container. + /// Possible values include: 'Invalid', + /// 'BackupProtectedItemCountSummary', + /// 'BackupProtectionContainerCountSummary' + public BMSBackupSummariesQueryObject(string type = default(string)) + { + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup management type for this container. Possible + /// values include: 'Invalid', 'BackupProtectedItemCountSummary', + /// 'BackupProtectionContainerCountSummary' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSContainerQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSContainerQueryObject.cs new file mode 100644 index 000000000000..f1dbf46a143c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSContainerQueryObject.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The query filters that can be used with the list containers API. + /// + public partial class BMSContainerQueryObject + { + /// + /// Initializes a new instance of the BMSContainerQueryObject class. + /// + public BMSContainerQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BMSContainerQueryObject class. + /// + /// Backup management type for this + /// container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Type of container for filter. Possible + /// values include: 'Invalid', 'Unknown', 'IaasVMContainer', + /// 'IaasVMServiceContainer', 'DPMContainer', + /// 'AzureBackupServerContainer', 'MABContainer', 'Cluster', + /// 'AzureSqlContainer', 'Windows', 'VCenter', 'VMAppContainer', + /// 'SQLAGWorkLoadContainer', 'StorageContainer', + /// 'GenericContainer' + /// Backup engine name + /// Fabric name for filter + /// Status of registration of this container with + /// the Recovery Services Vault. + /// Friendly name of this container. + public BMSContainerQueryObject(string backupManagementType, string containerType = default(string), string backupEngineName = default(string), string fabricName = default(string), string status = default(string), string friendlyName = default(string)) + { + BackupManagementType = backupManagementType; + ContainerType = containerType; + BackupEngineName = backupEngineName; + FabricName = fabricName; + Status = status; + FriendlyName = friendlyName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup management type for this container. Possible + /// values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets type of container for filter. Possible values include: + /// 'Invalid', 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', + /// 'DPMContainer', 'AzureBackupServerContainer', 'MABContainer', + /// 'Cluster', 'AzureSqlContainer', 'Windows', 'VCenter', + /// 'VMAppContainer', 'SQLAGWorkLoadContainer', 'StorageContainer', + /// 'GenericContainer' + /// + [JsonProperty(PropertyName = "containerType")] + public string ContainerType { get; set; } + + /// + /// Gets or sets backup engine name + /// + [JsonProperty(PropertyName = "backupEngineName")] + public string BackupEngineName { get; set; } + + /// + /// Gets or sets fabric name for filter + /// + [JsonProperty(PropertyName = "fabricName")] + public string FabricName { get; set; } + + /// + /// Gets or sets status of registration of this container with the + /// Recovery Services Vault. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets friendly name of this container. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (BackupManagementType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "BackupManagementType"); + } + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSContainersInquiryQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSContainersInquiryQueryObject.cs new file mode 100644 index 000000000000..8759af3f090b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSContainersInquiryQueryObject.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The query filters that can be used with the inquire container API. + /// + public partial class BMSContainersInquiryQueryObject + { + /// + /// Initializes a new instance of the BMSContainersInquiryQueryObject + /// class. + /// + public BMSContainersInquiryQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BMSContainersInquiryQueryObject + /// class. + /// + /// Backup management type for this + /// container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Workload type for this container. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + public BMSContainersInquiryQueryObject(string backupManagementType = default(string), string workloadType = default(string)) + { + BackupManagementType = backupManagementType; + WorkloadType = workloadType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup management type for this container. Possible + /// values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets workload type for this container. Possible values + /// include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', + /// 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + /// 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSPOQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSPOQueryObject.cs new file mode 100644 index 000000000000..839eb471e800 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSPOQueryObject.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Filters to list items that can be backed up. + /// + public partial class BMSPOQueryObject + { + /// + /// Initializes a new instance of the BMSPOQueryObject class. + /// + public BMSPOQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BMSPOQueryObject class. + /// + /// Backup management type. Possible + /// values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// Workload type. Possible values include: + /// 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + /// 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + /// 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// Full name of the container whose + /// Protectable Objects should be returned. + /// Backup status query parameter. + /// Friendly name. + public BMSPOQueryObject(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string status = default(string), string friendlyName = default(string)) + { + BackupManagementType = backupManagementType; + WorkloadType = workloadType; + ContainerName = containerName; + Status = status; + FriendlyName = friendlyName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup management type. Possible values include: + /// 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', + /// 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets workload type. Possible values include: 'Invalid', + /// 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + /// 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + /// 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + /// + /// Gets or sets full name of the container whose Protectable Objects + /// should be returned. + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets backup status query parameter. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets friendly name. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRPQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRPQueryObject.cs new file mode 100644 index 000000000000..49bd970a4025 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRPQueryObject.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Filters to list backup copies. + /// + public partial class BMSRPQueryObject + { + /// + /// Initializes a new instance of the BMSRPQueryObject class. + /// + public BMSRPQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BMSRPQueryObject class. + /// + /// Backup copies created after this + /// time. + /// Backup copies created before this + /// time. + /// RestorePoint type. Possible + /// values include: 'Invalid', 'Full', 'Log', 'Differential', + /// 'FullAndDifferential', 'All', 'Incremental' + /// In Get Recovery Point, it tells whether + /// extended information about recovery point is asked. + /// Whether the RP can be moved to + /// another tier + public BMSRPQueryObject(System.DateTime? startDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), string restorePointQueryType = default(string), bool? extendedInfo = default(bool?), bool? moveReadyRPOnly = default(bool?)) + { + StartDate = startDate; + EndDate = endDate; + RestorePointQueryType = restorePointQueryType; + ExtendedInfo = extendedInfo; + MoveReadyRPOnly = moveReadyRPOnly; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup copies created after this time. + /// + [JsonProperty(PropertyName = "startDate")] + public System.DateTime? StartDate { get; set; } + + /// + /// Gets or sets backup copies created before this time. + /// + [JsonProperty(PropertyName = "endDate")] + public System.DateTime? EndDate { get; set; } + + /// + /// Gets or sets restorePoint type. Possible values include: 'Invalid', + /// 'Full', 'Log', 'Differential', 'FullAndDifferential', 'All', + /// 'Incremental' + /// + [JsonProperty(PropertyName = "restorePointQueryType")] + public string RestorePointQueryType { get; set; } + + /// + /// Gets or sets in Get Recovery Point, it tells whether extended + /// information about recovery point is asked. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public bool? ExtendedInfo { get; set; } + + /// + /// Gets or sets whether the RP can be moved to another tier + /// + [JsonProperty(PropertyName = "moveReadyRPOnly")] + public bool? MoveReadyRPOnly { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRefreshContainersQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRefreshContainersQueryObject.cs new file mode 100644 index 000000000000..bf6b588f264e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRefreshContainersQueryObject.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The query filters that can be used with the refresh container API. + /// + public partial class BMSRefreshContainersQueryObject + { + /// + /// Initializes a new instance of the BMSRefreshContainersQueryObject + /// class. + /// + public BMSRefreshContainersQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BMSRefreshContainersQueryObject + /// class. + /// + /// Backup management type for this + /// container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + public BMSRefreshContainersQueryObject(string backupManagementType = default(string)) + { + BackupManagementType = backupManagementType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup management type for this container. Possible + /// values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSWorkloadItemQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSWorkloadItemQueryObject.cs new file mode 100644 index 000000000000..833036bb3fbc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSWorkloadItemQueryObject.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Filters to list items that can be backed up. + /// + public partial class BMSWorkloadItemQueryObject + { + /// + /// Initializes a new instance of the BMSWorkloadItemQueryObject class. + /// + public BMSWorkloadItemQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BMSWorkloadItemQueryObject class. + /// + /// Backup management type. Possible + /// values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// Workload Item type. Possible values + /// include: 'Invalid', 'SQLInstance', 'SQLDataBase', 'SAPHanaSystem', + /// 'SAPHanaDatabase', 'SAPAseSystem', 'SAPAseDatabase' + /// Workload type. Possible values include: + /// 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + /// 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + /// 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// Backup status query parameter. + /// Possible values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + public BMSWorkloadItemQueryObject(string backupManagementType = default(string), string workloadItemType = default(string), string workloadType = default(string), string protectionStatus = default(string)) + { + BackupManagementType = backupManagementType; + WorkloadItemType = workloadItemType; + WorkloadType = workloadType; + ProtectionStatus = protectionStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup management type. Possible values include: + /// 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', + /// 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets workload Item type. Possible values include: + /// 'Invalid', 'SQLInstance', 'SQLDataBase', 'SAPHanaSystem', + /// 'SAPHanaDatabase', 'SAPAseSystem', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workloadItemType")] + public string WorkloadItemType { get; set; } + + /// + /// Gets or sets workload type. Possible values include: 'Invalid', + /// 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + /// 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + /// 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + /// + /// Gets or sets backup status query parameter. Possible values + /// include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', + /// 'ProtectionFailed' + /// + [JsonProperty(PropertyName = "protectionStatus")] + public string ProtectionStatus { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineBase.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineBase.cs new file mode 100644 index 000000000000..e789faf7580b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineBase.cs @@ -0,0 +1,158 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The base backup engine class. All workload specific backup engines + /// derive from this class. + /// + public partial class BackupEngineBase + { + /// + /// Initializes a new instance of the BackupEngineBase class. + /// + public BackupEngineBase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupEngineBase class. + /// + /// Friendly name of the backup + /// engine. + /// Type of backup management for + /// the backup engine. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Registration status of the backup + /// engine with the Recovery Services Vault. + /// Status of the backup engine with + /// the Recovery Services Vault. = + /// {Active/Deleting/DeleteFailed} + /// Backup status of the backup + /// engine. + /// Flag indicating if the backup engine be + /// registered, once already registered. + /// ID of the backup engine. + /// Backup engine version + /// Backup agent version + /// To check if backup + /// agent upgrade available + /// To check if backup engine + /// upgrade available + /// Extended info of the + /// backupengine + public BackupEngineBase(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string backupEngineState = default(string), string healthStatus = default(string), bool? canReRegister = default(bool?), string backupEngineId = default(string), string dpmVersion = default(string), string azureBackupAgentVersion = default(string), bool? isAzureBackupAgentUpgradeAvailable = default(bool?), bool? isDpmUpgradeAvailable = default(bool?), BackupEngineExtendedInfo extendedInfo = default(BackupEngineExtendedInfo)) + { + FriendlyName = friendlyName; + BackupManagementType = backupManagementType; + RegistrationStatus = registrationStatus; + BackupEngineState = backupEngineState; + HealthStatus = healthStatus; + CanReRegister = canReRegister; + BackupEngineId = backupEngineId; + DpmVersion = dpmVersion; + AzureBackupAgentVersion = azureBackupAgentVersion; + IsAzureBackupAgentUpgradeAvailable = isAzureBackupAgentUpgradeAvailable; + IsDpmUpgradeAvailable = isDpmUpgradeAvailable; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the backup engine. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets type of backup management for the backup engine. + /// Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets registration status of the backup engine with the + /// Recovery Services Vault. + /// + [JsonProperty(PropertyName = "registrationStatus")] + public string RegistrationStatus { get; set; } + + /// + /// Gets or sets status of the backup engine with the Recovery Services + /// Vault. = {Active/Deleting/DeleteFailed} + /// + [JsonProperty(PropertyName = "backupEngineState")] + public string BackupEngineState { get; set; } + + /// + /// Gets or sets backup status of the backup engine. + /// + [JsonProperty(PropertyName = "healthStatus")] + public string HealthStatus { get; set; } + + /// + /// Gets or sets flag indicating if the backup engine be registered, + /// once already registered. + /// + [JsonProperty(PropertyName = "canReRegister")] + public bool? CanReRegister { get; set; } + + /// + /// Gets or sets ID of the backup engine. + /// + [JsonProperty(PropertyName = "backupEngineId")] + public string BackupEngineId { get; set; } + + /// + /// Gets or sets backup engine version + /// + [JsonProperty(PropertyName = "dpmVersion")] + public string DpmVersion { get; set; } + + /// + /// Gets or sets backup agent version + /// + [JsonProperty(PropertyName = "azureBackupAgentVersion")] + public string AzureBackupAgentVersion { get; set; } + + /// + /// Gets or sets to check if backup agent upgrade available + /// + [JsonProperty(PropertyName = "isAzureBackupAgentUpgradeAvailable")] + public bool? IsAzureBackupAgentUpgradeAvailable { get; set; } + + /// + /// Gets or sets to check if backup engine upgrade available + /// + [JsonProperty(PropertyName = "isDpmUpgradeAvailable")] + public bool? IsDpmUpgradeAvailable { get; set; } + + /// + /// Gets or sets extended info of the backupengine + /// + [JsonProperty(PropertyName = "extendedInfo")] + public BackupEngineExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineBaseResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineBaseResource.cs new file mode 100644 index 000000000000..48745ffd84bb --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineBaseResource.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The base backup engine class. All workload specific backup engines + /// derive from this class. + /// + public partial class BackupEngineBaseResource : Resource + { + /// + /// Initializes a new instance of the BackupEngineBaseResource class. + /// + public BackupEngineBaseResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupEngineBaseResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// BackupEngineBaseResource + /// properties + public BackupEngineBaseResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), BackupEngineBase properties = default(BackupEngineBase)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backupEngineBaseResource properties + /// + [JsonProperty(PropertyName = "properties")] + public BackupEngineBase Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineExtendedInfo.cs new file mode 100644 index 000000000000..122b0a8e816d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupEngineExtendedInfo.cs @@ -0,0 +1,114 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional information on backup engine. + /// + public partial class BackupEngineExtendedInfo + { + /// + /// Initializes a new instance of the BackupEngineExtendedInfo class. + /// + public BackupEngineExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupEngineExtendedInfo class. + /// + /// Database name of backup engine. + /// Number of protected items in the + /// backup engine. + /// Number of protected servers in + /// the backup engine. + /// Number of disks in the backup + /// engine. + /// Disk space used in the backup + /// engine. + /// Disk space currently available in + /// the backup engine. + /// Last refresh time in the backup + /// engine. + /// Protected instances in the + /// backup engine. + public BackupEngineExtendedInfo(string databaseName = default(string), int? protectedItemsCount = default(int?), int? protectedServersCount = default(int?), int? diskCount = default(int?), double? usedDiskSpace = default(double?), double? availableDiskSpace = default(double?), System.DateTime? refreshedAt = default(System.DateTime?), int? azureProtectedInstances = default(int?)) + { + DatabaseName = databaseName; + ProtectedItemsCount = protectedItemsCount; + ProtectedServersCount = protectedServersCount; + DiskCount = diskCount; + UsedDiskSpace = usedDiskSpace; + AvailableDiskSpace = availableDiskSpace; + RefreshedAt = refreshedAt; + AzureProtectedInstances = azureProtectedInstances; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets database name of backup engine. + /// + [JsonProperty(PropertyName = "databaseName")] + public string DatabaseName { get; set; } + + /// + /// Gets or sets number of protected items in the backup engine. + /// + [JsonProperty(PropertyName = "protectedItemsCount")] + public int? ProtectedItemsCount { get; set; } + + /// + /// Gets or sets number of protected servers in the backup engine. + /// + [JsonProperty(PropertyName = "protectedServersCount")] + public int? ProtectedServersCount { get; set; } + + /// + /// Gets or sets number of disks in the backup engine. + /// + [JsonProperty(PropertyName = "diskCount")] + public int? DiskCount { get; set; } + + /// + /// Gets or sets disk space used in the backup engine. + /// + [JsonProperty(PropertyName = "usedDiskSpace")] + public double? UsedDiskSpace { get; set; } + + /// + /// Gets or sets disk space currently available in the backup engine. + /// + [JsonProperty(PropertyName = "availableDiskSpace")] + public double? AvailableDiskSpace { get; set; } + + /// + /// Gets or sets last refresh time in the backup engine. + /// + [JsonProperty(PropertyName = "refreshedAt")] + public System.DateTime? RefreshedAt { get; set; } + + /// + /// Gets or sets protected instances in the backup engine. + /// + [JsonProperty(PropertyName = "azureProtectedInstances")] + public int? AzureProtectedInstances { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupItemType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupItemType.cs new file mode 100644 index 000000000000..3b150acd6d47 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupItemType.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for BackupItemType. + /// + public static class BackupItemType + { + public const string Invalid = "Invalid"; + public const string VM = "VM"; + public const string FileFolder = "FileFolder"; + public const string AzureSqlDb = "AzureSqlDb"; + public const string SQLDB = "SQLDB"; + public const string Exchange = "Exchange"; + public const string Sharepoint = "Sharepoint"; + public const string VMwareVM = "VMwareVM"; + public const string SystemState = "SystemState"; + public const string Client = "Client"; + public const string GenericDataSource = "GenericDataSource"; + public const string SQLDataBase = "SQLDataBase"; + public const string AzureFileShare = "AzureFileShare"; + public const string SAPHanaDatabase = "SAPHanaDatabase"; + public const string SAPAseDatabase = "SAPAseDatabase"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupManagementType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupManagementType.cs new file mode 100644 index 000000000000..f430a5d6cc0f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupManagementType.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for BackupManagementType. + /// + public static class BackupManagementType + { + public const string Invalid = "Invalid"; + public const string AzureIaasVM = "AzureIaasVM"; + public const string MAB = "MAB"; + public const string DPM = "DPM"; + public const string AzureBackupServer = "AzureBackupServer"; + public const string AzureSql = "AzureSql"; + public const string AzureStorage = "AzureStorage"; + public const string AzureWorkload = "AzureWorkload"; + public const string DefaultBackup = "DefaultBackup"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupManagementUsage.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupManagementUsage.cs new file mode 100644 index 000000000000..fc699d5234fa --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupManagementUsage.cs @@ -0,0 +1,94 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Backup management usages of a vault. + /// + public partial class BackupManagementUsage + { + /// + /// Initializes a new instance of the BackupManagementUsage class. + /// + public BackupManagementUsage() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupManagementUsage class. + /// + /// Unit of the usage. Possible values include: + /// 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + /// 'BytesPerSecond' + /// Quota period of usage. + /// Next reset time of usage. + /// Current value of usage. + /// Limit of usage. + /// Name of usage. + public BackupManagementUsage(string unit = default(string), string quotaPeriod = default(string), System.DateTime? nextResetTime = default(System.DateTime?), long? currentValue = default(long?), long? limit = default(long?), NameInfo name = default(NameInfo)) + { + Unit = unit; + QuotaPeriod = quotaPeriod; + NextResetTime = nextResetTime; + CurrentValue = currentValue; + Limit = limit; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unit of the usage. Possible values include: 'Count', + /// 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets quota period of usage. + /// + [JsonProperty(PropertyName = "quotaPeriod")] + public string QuotaPeriod { get; set; } + + /// + /// Gets or sets next reset time of usage. + /// + [JsonProperty(PropertyName = "nextResetTime")] + public System.DateTime? NextResetTime { get; set; } + + /// + /// Gets or sets current value of usage. + /// + [JsonProperty(PropertyName = "currentValue")] + public long? CurrentValue { get; set; } + + /// + /// Gets or sets limit of usage. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; set; } + + /// + /// Gets or sets name of usage. + /// + [JsonProperty(PropertyName = "name")] + public NameInfo Name { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupRequest.cs new file mode 100644 index 000000000000..1abba62b59aa --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupRequest.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Base class for backup request. Workload-specific backup requests are + /// derived from this class. + /// + public partial class BackupRequest + { + /// + /// Initializes a new instance of the BackupRequest class. + /// + public BackupRequest() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupRequestResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupRequestResource.cs new file mode 100644 index 000000000000..659bd67cefeb --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupRequestResource.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup request. Workload-specific backup requests are + /// derived from this class. + /// + public partial class BackupRequestResource : Resource + { + /// + /// Initializes a new instance of the BackupRequestResource class. + /// + public BackupRequestResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupRequestResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// BackupRequestResource properties + public BackupRequestResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), BackupRequest properties = default(BackupRequest)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backupRequestResource properties + /// + [JsonProperty(PropertyName = "properties")] + public BackupRequest Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfig.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfig.cs new file mode 100644 index 000000000000..4c815a334c3e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfig.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource storage details. + /// + public partial class BackupResourceConfig + { + /// + /// Initializes a new instance of the BackupResourceConfig class. + /// + public BackupResourceConfig() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupResourceConfig class. + /// + /// Storage type. Possible values + /// include: 'Invalid', 'GeoRedundant', 'LocallyRedundant', + /// 'ZoneRedundant', 'ReadAccessGeoZoneRedundant' + /// Storage type. Possible values include: + /// 'Invalid', 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', + /// 'ReadAccessGeoZoneRedundant' + /// Locked or Unlocked. Once a machine + /// is registered against a resource, the storageTypeState is always + /// Locked. Possible values include: 'Invalid', 'Locked', + /// 'Unlocked' + /// Opt in details of Cross Region + /// Restore feature. + /// Vault Dedup state. Possible values + /// include: 'Invalid', 'Enabled', 'Disabled' + /// Vault x-cool state. Possible values + /// include: 'Invalid', 'Enabled', 'Disabled' + public BackupResourceConfig(string storageModelType = default(string), string storageType = default(string), string storageTypeState = default(string), bool? crossRegionRestoreFlag = default(bool?), string dedupState = default(string), string xcoolState = default(string)) + { + StorageModelType = storageModelType; + StorageType = storageType; + StorageTypeState = storageTypeState; + CrossRegionRestoreFlag = crossRegionRestoreFlag; + DedupState = dedupState; + XcoolState = xcoolState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets storage type. Possible values include: 'Invalid', + /// 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', + /// 'ReadAccessGeoZoneRedundant' + /// + [JsonProperty(PropertyName = "storageModelType")] + public string StorageModelType { get; set; } + + /// + /// Gets or sets storage type. Possible values include: 'Invalid', + /// 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', + /// 'ReadAccessGeoZoneRedundant' + /// + [JsonProperty(PropertyName = "storageType")] + public string StorageType { get; set; } + + /// + /// Gets or sets locked or Unlocked. Once a machine is registered + /// against a resource, the storageTypeState is always Locked. Possible + /// values include: 'Invalid', 'Locked', 'Unlocked' + /// + [JsonProperty(PropertyName = "storageTypeState")] + public string StorageTypeState { get; set; } + + /// + /// Gets or sets opt in details of Cross Region Restore feature. + /// + [JsonProperty(PropertyName = "crossRegionRestoreFlag")] + public bool? CrossRegionRestoreFlag { get; set; } + + /// + /// Gets or sets vault Dedup state. Possible values include: 'Invalid', + /// 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "dedupState")] + public string DedupState { get; set; } + + /// + /// Gets or sets vault x-cool state. Possible values include: + /// 'Invalid', 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "xcoolState")] + public string XcoolState { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfigResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfigResource.cs new file mode 100644 index 000000000000..09e3786c53bc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfigResource.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The resource storage details. + /// + public partial class BackupResourceConfigResource : Resource + { + /// + /// Initializes a new instance of the BackupResourceConfigResource + /// class. + /// + public BackupResourceConfigResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupResourceConfigResource + /// class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// BackupResourceConfigResource + /// properties + public BackupResourceConfigResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), BackupResourceConfig properties = default(BackupResourceConfig)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backupResourceConfigResource properties + /// + [JsonProperty(PropertyName = "properties")] + public BackupResourceConfig Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfig.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfig.cs new file mode 100644 index 000000000000..5a5b6ef90031 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfig.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class BackupResourceEncryptionConfig + { + /// + /// Initializes a new instance of the BackupResourceEncryptionConfig + /// class. + /// + public BackupResourceEncryptionConfig() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupResourceEncryptionConfig + /// class. + /// + /// Encryption At Rest Type. + /// Possible values include: 'Invalid', 'MicrosoftManaged', + /// 'CustomerManaged' + /// Key Vault Key URI + /// Key Vault Subscription Id + /// Possible values include: 'Invalid', + /// 'NotEnabled', 'PartiallySucceeded', 'PartiallyFailed', 'Failed', + /// 'Succeeded', 'Initialized', 'FirstInitialization' + /// Possible values + /// include: 'Invalid', 'Disabled', 'Enabled' + public BackupResourceEncryptionConfig(string encryptionAtRestType = default(string), string keyUri = default(string), string subscriptionId = default(string), string lastUpdateStatus = default(string), string infrastructureEncryptionState = default(string)) + { + EncryptionAtRestType = encryptionAtRestType; + KeyUri = keyUri; + SubscriptionId = subscriptionId; + LastUpdateStatus = lastUpdateStatus; + InfrastructureEncryptionState = infrastructureEncryptionState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets encryption At Rest Type. Possible values include: + /// 'Invalid', 'MicrosoftManaged', 'CustomerManaged' + /// + [JsonProperty(PropertyName = "encryptionAtRestType")] + public string EncryptionAtRestType { get; set; } + + /// + /// Gets or sets key Vault Key URI + /// + [JsonProperty(PropertyName = "keyUri")] + public string KeyUri { get; set; } + + /// + /// Gets or sets key Vault Subscription Id + /// + [JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId { get; set; } + + /// + /// Gets or sets possible values include: 'Invalid', 'NotEnabled', + /// 'PartiallySucceeded', 'PartiallyFailed', 'Failed', 'Succeeded', + /// 'Initialized', 'FirstInitialization' + /// + [JsonProperty(PropertyName = "lastUpdateStatus")] + public string LastUpdateStatus { get; set; } + + /// + /// Gets or sets possible values include: 'Invalid', 'Disabled', + /// 'Enabled' + /// + [JsonProperty(PropertyName = "infrastructureEncryptionState")] + public string InfrastructureEncryptionState { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigExtended.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigExtended.cs new file mode 100644 index 000000000000..6ab7b66214e8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigExtended.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class BackupResourceEncryptionConfigExtended : BackupResourceEncryptionConfig + { + /// + /// Initializes a new instance of the + /// BackupResourceEncryptionConfigExtended class. + /// + public BackupResourceEncryptionConfigExtended() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// BackupResourceEncryptionConfigExtended class. + /// + /// Encryption At Rest Type. + /// Possible values include: 'Invalid', 'MicrosoftManaged', + /// 'CustomerManaged' + /// Key Vault Key URI + /// Key Vault Subscription Id + /// Possible values include: 'Invalid', + /// 'NotEnabled', 'PartiallySucceeded', 'PartiallyFailed', 'Failed', + /// 'Succeeded', 'Initialized', 'FirstInitialization' + /// Possible values + /// include: 'Invalid', 'Disabled', 'Enabled' + /// User Assigned Identity + /// Id + /// bool to indicate whether to + /// use system Assigned Identity or not + public BackupResourceEncryptionConfigExtended(string encryptionAtRestType = default(string), string keyUri = default(string), string subscriptionId = default(string), string lastUpdateStatus = default(string), string infrastructureEncryptionState = default(string), string userAssignedIdentity = default(string), bool? useSystemAssignedIdentity = default(bool?)) + : base(encryptionAtRestType, keyUri, subscriptionId, lastUpdateStatus, infrastructureEncryptionState) + { + UserAssignedIdentity = userAssignedIdentity; + UseSystemAssignedIdentity = useSystemAssignedIdentity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets user Assigned Identity Id + /// + [JsonProperty(PropertyName = "userAssignedIdentity")] + public string UserAssignedIdentity { get; set; } + + /// + /// Gets or sets bool to indicate whether to use system Assigned + /// Identity or not + /// + [JsonProperty(PropertyName = "useSystemAssignedIdentity")] + public bool? UseSystemAssignedIdentity { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigExtendedResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigExtendedResource.cs new file mode 100644 index 000000000000..734e94f8a2b0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigExtendedResource.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class BackupResourceEncryptionConfigExtendedResource : Resource + { + /// + /// Initializes a new instance of the + /// BackupResourceEncryptionConfigExtendedResource class. + /// + public BackupResourceEncryptionConfigExtendedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// BackupResourceEncryptionConfigExtendedResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// BackupResourceEncryptionConfigExtendedResource + /// properties + public BackupResourceEncryptionConfigExtendedResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), BackupResourceEncryptionConfigExtended properties = default(BackupResourceEncryptionConfigExtended)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backupResourceEncryptionConfigExtendedResource + /// properties + /// + [JsonProperty(PropertyName = "properties")] + public BackupResourceEncryptionConfigExtended Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigResource.cs new file mode 100644 index 000000000000..01891ae7d091 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceEncryptionConfigResource.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class BackupResourceEncryptionConfigResource : Resource + { + /// + /// Initializes a new instance of the + /// BackupResourceEncryptionConfigResource class. + /// + public BackupResourceEncryptionConfigResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// BackupResourceEncryptionConfigResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// BackupResourceEncryptionConfigResource + /// properties + public BackupResourceEncryptionConfigResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), BackupResourceEncryptionConfig properties = default(BackupResourceEncryptionConfig)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backupResourceEncryptionConfigResource properties + /// + [JsonProperty(PropertyName = "properties")] + public BackupResourceEncryptionConfig Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfig.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfig.cs new file mode 100644 index 000000000000..5e45d075836f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfig.cs @@ -0,0 +1,120 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Backup resource vault config details. + /// + public partial class BackupResourceVaultConfig + { + /// + /// Initializes a new instance of the BackupResourceVaultConfig class. + /// + public BackupResourceVaultConfig() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupResourceVaultConfig class. + /// + /// Storage type. Possible values + /// include: 'Invalid', 'GeoRedundant', 'LocallyRedundant', + /// 'ZoneRedundant', 'ReadAccessGeoZoneRedundant' + /// Storage type. Possible values include: + /// 'Invalid', 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', + /// 'ReadAccessGeoZoneRedundant' + /// Locked or Unlocked. Once a machine + /// is registered against a resource, the storageTypeState is always + /// Locked. Possible values include: 'Invalid', 'Locked', + /// 'Unlocked' + /// Enabled or Disabled. Possible + /// values include: 'Invalid', 'Enabled', 'Disabled' + /// Soft Delete feature state. + /// Possible values include: 'Invalid', 'Enabled', 'Disabled' + /// ResourceGuard + /// Operation Requests + /// Is soft delete + /// feature state editable + public BackupResourceVaultConfig(string storageModelType = default(string), string storageType = default(string), string storageTypeState = default(string), string enhancedSecurityState = default(string), string softDeleteFeatureState = default(string), IList resourceGuardOperationRequests = default(IList), bool? isSoftDeleteFeatureStateEditable = default(bool?)) + { + StorageModelType = storageModelType; + StorageType = storageType; + StorageTypeState = storageTypeState; + EnhancedSecurityState = enhancedSecurityState; + SoftDeleteFeatureState = softDeleteFeatureState; + ResourceGuardOperationRequests = resourceGuardOperationRequests; + IsSoftDeleteFeatureStateEditable = isSoftDeleteFeatureStateEditable; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets storage type. Possible values include: 'Invalid', + /// 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', + /// 'ReadAccessGeoZoneRedundant' + /// + [JsonProperty(PropertyName = "storageModelType")] + public string StorageModelType { get; set; } + + /// + /// Gets or sets storage type. Possible values include: 'Invalid', + /// 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', + /// 'ReadAccessGeoZoneRedundant' + /// + [JsonProperty(PropertyName = "storageType")] + public string StorageType { get; set; } + + /// + /// Gets or sets locked or Unlocked. Once a machine is registered + /// against a resource, the storageTypeState is always Locked. Possible + /// values include: 'Invalid', 'Locked', 'Unlocked' + /// + [JsonProperty(PropertyName = "storageTypeState")] + public string StorageTypeState { get; set; } + + /// + /// Gets or sets enabled or Disabled. Possible values include: + /// 'Invalid', 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "enhancedSecurityState")] + public string EnhancedSecurityState { get; set; } + + /// + /// Gets or sets soft Delete feature state. Possible values include: + /// 'Invalid', 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "softDeleteFeatureState")] + public string SoftDeleteFeatureState { get; set; } + + /// + /// Gets or sets resourceGuard Operation Requests + /// + [JsonProperty(PropertyName = "resourceGuardOperationRequests")] + public IList ResourceGuardOperationRequests { get; set; } + + /// + /// Gets or sets is soft delete feature state editable + /// + [JsonProperty(PropertyName = "isSoftDeleteFeatureStateEditable")] + public bool? IsSoftDeleteFeatureStateEditable { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfigResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfigResource.cs new file mode 100644 index 000000000000..7c93a45855de --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfigResource.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Backup resource vault config details. + /// + public partial class BackupResourceVaultConfigResource : Resource + { + /// + /// Initializes a new instance of the BackupResourceVaultConfigResource + /// class. + /// + public BackupResourceVaultConfigResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupResourceVaultConfigResource + /// class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// BackupResourceVaultConfigResource + /// properties + public BackupResourceVaultConfigResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), BackupResourceVaultConfig properties = default(BackupResourceVaultConfig)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backupResourceVaultConfigResource properties + /// + [JsonProperty(PropertyName = "properties")] + public BackupResourceVaultConfig Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupStatusRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupStatusRequest.cs new file mode 100644 index 000000000000..984715254126 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupStatusRequest.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// BackupStatus request. + /// + public partial class BackupStatusRequest + { + /// + /// Initializes a new instance of the BackupStatusRequest class. + /// + public BackupStatusRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupStatusRequest class. + /// + /// Container Type - VM, SQLPaaS, DPM, + /// AzureFileShare. Possible values include: 'Invalid', 'VM', + /// 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', + /// 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', + /// 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', + /// 'SAPAseDatabase' + /// Entire ARM resource id of the + /// resource + /// Protectable Item Logical Name + public BackupStatusRequest(string resourceType = default(string), string resourceId = default(string), string poLogicalName = default(string)) + { + ResourceType = resourceType; + ResourceId = resourceId; + PoLogicalName = poLogicalName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets container Type - VM, SQLPaaS, DPM, AzureFileShare. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; set; } + + /// + /// Gets or sets entire ARM resource id of the resource + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets protectable Item Logical Name + /// + [JsonProperty(PropertyName = "poLogicalName")] + public string PoLogicalName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupStatusResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupStatusResponse.cs new file mode 100644 index 000000000000..b1a9bff7a4a3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupStatusResponse.cs @@ -0,0 +1,131 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// BackupStatus response. + /// + public partial class BackupStatusResponse + { + /// + /// Initializes a new instance of the BackupStatusResponse class. + /// + public BackupStatusResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupStatusResponse class. + /// + /// Specifies whether the container is + /// registered or not. Possible values include: 'Invalid', + /// 'NotProtected', 'Protecting', 'Protected', + /// 'ProtectionFailed' + /// Specifies the arm resource id of the + /// vault + /// Specifies the fabric name - Azure or AD. + /// Possible values include: 'Invalid', 'Azure' + /// Specifies the product specific + /// container name. E.g. + /// iaasvmcontainer;iaasvmcontainer;csname;vmname. + /// Specifies the product specific ds + /// name. E.g. vm;iaasvmcontainer;csname;vmname. + /// ErrorCode in case of intent failed + /// ErrorMessage in case of intent + /// failed. + /// Specifies the policy name which is used + /// for protection + /// Container registration + /// status + public BackupStatusResponse(string protectionStatus = default(string), string vaultId = default(string), string fabricName = default(string), string containerName = default(string), string protectedItemName = default(string), string errorCode = default(string), string errorMessage = default(string), string policyName = default(string), string registrationStatus = default(string)) + { + ProtectionStatus = protectionStatus; + VaultId = vaultId; + FabricName = fabricName; + ContainerName = containerName; + ProtectedItemName = protectedItemName; + ErrorCode = errorCode; + ErrorMessage = errorMessage; + PolicyName = policyName; + RegistrationStatus = registrationStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies whether the container is registered or not. + /// Possible values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// + [JsonProperty(PropertyName = "protectionStatus")] + public string ProtectionStatus { get; set; } + + /// + /// Gets or sets specifies the arm resource id of the vault + /// + [JsonProperty(PropertyName = "vaultId")] + public string VaultId { get; set; } + + /// + /// Gets or sets specifies the fabric name - Azure or AD. Possible + /// values include: 'Invalid', 'Azure' + /// + [JsonProperty(PropertyName = "fabricName")] + public string FabricName { get; set; } + + /// + /// Gets or sets specifies the product specific container name. E.g. + /// iaasvmcontainer;iaasvmcontainer;csname;vmname. + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets specifies the product specific ds name. E.g. + /// vm;iaasvmcontainer;csname;vmname. + /// + [JsonProperty(PropertyName = "protectedItemName")] + public string ProtectedItemName { get; set; } + + /// + /// Gets or sets errorCode in case of intent failed + /// + [JsonProperty(PropertyName = "errorCode")] + public string ErrorCode { get; set; } + + /// + /// Gets or sets errorMessage in case of intent failed. + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + + /// + /// Gets or sets specifies the policy name which is used for protection + /// + [JsonProperty(PropertyName = "policyName")] + public string PolicyName { get; set; } + + /// + /// Gets or sets container registration status + /// + [JsonProperty(PropertyName = "registrationStatus")] + public string RegistrationStatus { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupType.cs new file mode 100644 index 000000000000..f7cfbbbbe983 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupType.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for BackupType. + /// + public static class BackupType + { + public const string Invalid = "Invalid"; + public const string Full = "Full"; + public const string Differential = "Differential"; + public const string Log = "Log"; + public const string CopyOnlyFull = "CopyOnlyFull"; + public const string Incremental = "Incremental"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryDisplay.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryDisplay.cs new file mode 100644 index 000000000000..a5f52988aa71 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryDisplay.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Localized display information of an operation. + /// + public partial class ClientDiscoveryDisplay + { + /// + /// Initializes a new instance of the ClientDiscoveryDisplay class. + /// + public ClientDiscoveryDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClientDiscoveryDisplay class. + /// + /// Name of the provider for display + /// purposes + /// ResourceType for which this Operation can be + /// performed. + /// Operations Name itself. + /// Description of the operation having + /// details of what operation is about. + public ClientDiscoveryDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the provider for display purposes + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets resourceType for which this Operation can be + /// performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets operations Name itself. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets description of the operation having details of what + /// operation is about. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForLogSpecification.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForLogSpecification.cs new file mode 100644 index 000000000000..30c5d2872d70 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForLogSpecification.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Class to represent shoebox log specification in json client discovery. + /// + public partial class ClientDiscoveryForLogSpecification + { + /// + /// Initializes a new instance of the + /// ClientDiscoveryForLogSpecification class. + /// + public ClientDiscoveryForLogSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ClientDiscoveryForLogSpecification class. + /// + /// Name for shoebox log specification. + /// Localized display name + /// blob duration of shoebox log + /// specification + public ClientDiscoveryForLogSpecification(string name = default(string), string displayName = default(string), string blobDuration = default(string)) + { + Name = name; + DisplayName = displayName; + BlobDuration = blobDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name for shoebox log specification. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets localized display name + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets blob duration of shoebox log specification + /// + [JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForProperties.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForProperties.cs new file mode 100644 index 000000000000..36dcd9e2bd0a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForProperties.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Class to represent shoebox properties in json client discovery. + /// + public partial class ClientDiscoveryForProperties + { + /// + /// Initializes a new instance of the ClientDiscoveryForProperties + /// class. + /// + public ClientDiscoveryForProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClientDiscoveryForProperties + /// class. + /// + /// Operation properties. + public ClientDiscoveryForProperties(ClientDiscoveryForServiceSpecification serviceSpecification = default(ClientDiscoveryForServiceSpecification)) + { + ServiceSpecification = serviceSpecification; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation properties. + /// + [JsonProperty(PropertyName = "serviceSpecification")] + public ClientDiscoveryForServiceSpecification ServiceSpecification { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForServiceSpecification.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForServiceSpecification.cs new file mode 100644 index 000000000000..4773f56c2eb2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryForServiceSpecification.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class to represent shoebox service specification in json client + /// discovery. + /// + public partial class ClientDiscoveryForServiceSpecification + { + /// + /// Initializes a new instance of the + /// ClientDiscoveryForServiceSpecification class. + /// + public ClientDiscoveryForServiceSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ClientDiscoveryForServiceSpecification class. + /// + /// List of log specifications of this + /// operation. + public ClientDiscoveryForServiceSpecification(IList logSpecifications = default(IList)) + { + LogSpecifications = logSpecifications; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of log specifications of this operation. + /// + [JsonProperty(PropertyName = "logSpecifications")] + public IList LogSpecifications { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryValueForSingleApi.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryValueForSingleApi.cs new file mode 100644 index 000000000000..9d3c96031c74 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientDiscoveryValueForSingleApi.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Available operation details. + /// + public partial class ClientDiscoveryValueForSingleApi + { + /// + /// Initializes a new instance of the ClientDiscoveryValueForSingleApi + /// class. + /// + public ClientDiscoveryValueForSingleApi() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClientDiscoveryValueForSingleApi + /// class. + /// + /// Name of the Operation. + /// Contains the localized display information + /// for this particular operation + /// The intended executor of the operation;governs + /// the display of the operation in the RBAC UX and the audit logs + /// UX + /// ShoeBox properties for the given + /// operation. + public ClientDiscoveryValueForSingleApi(string name = default(string), ClientDiscoveryDisplay display = default(ClientDiscoveryDisplay), string origin = default(string), ClientDiscoveryForProperties properties = default(ClientDiscoveryForProperties)) + { + Name = name; + Display = display; + Origin = origin; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the Operation. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets contains the localized display information for this + /// particular operation + /// + [JsonProperty(PropertyName = "display")] + public ClientDiscoveryDisplay Display { get; set; } + + /// + /// Gets or sets the intended executor of the operation;governs the + /// display of the operation in the RBAC UX and the audit logs UX + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; set; } + + /// + /// Gets or sets shoeBox properties for the given operation. + /// + [JsonProperty(PropertyName = "properties")] + public ClientDiscoveryForProperties Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientScriptForConnect.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientScriptForConnect.cs new file mode 100644 index 000000000000..036bd855e91b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ClientScriptForConnect.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Client script details for file / folder restore. + /// + public partial class ClientScriptForConnect + { + /// + /// Initializes a new instance of the ClientScriptForConnect class. + /// + public ClientScriptForConnect() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClientScriptForConnect class. + /// + /// File content of the client script for + /// file / folder restore. + /// File extension of the client script + /// for file / folder restore - .ps1 , .sh , etc. + /// OS type - Windows, Linux etc. for which this + /// file / folder restore client script works. + /// URL of Executable from where to source the + /// content. If this is not null then ScriptContent should not be + /// used + /// Mandatory suffix that should be + /// added to the name of script that is given for download to user. + /// If its null or empty then , ignore it. + public ClientScriptForConnect(string scriptContent = default(string), string scriptExtension = default(string), string osType = default(string), string url = default(string), string scriptNameSuffix = default(string)) + { + ScriptContent = scriptContent; + ScriptExtension = scriptExtension; + OsType = osType; + Url = url; + ScriptNameSuffix = scriptNameSuffix; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets file content of the client script for file / folder + /// restore. + /// + [JsonProperty(PropertyName = "scriptContent")] + public string ScriptContent { get; set; } + + /// + /// Gets or sets file extension of the client script for file / folder + /// restore - .ps1 , .sh , etc. + /// + [JsonProperty(PropertyName = "scriptExtension")] + public string ScriptExtension { get; set; } + + /// + /// Gets or sets OS type - Windows, Linux etc. for which this file / + /// folder restore client script works. + /// + [JsonProperty(PropertyName = "osType")] + public string OsType { get; set; } + + /// + /// Gets or sets URL of Executable from where to source the content. If + /// this is not null then ScriptContent should not be used + /// + [JsonProperty(PropertyName = "url")] + public string Url { get; set; } + + /// + /// Gets or sets mandatory suffix that should be added to the name of + /// script that is given for download to user. + /// If its null or empty then , ignore it. + /// + [JsonProperty(PropertyName = "scriptNameSuffix")] + public string ScriptNameSuffix { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ContainerIdentityInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ContainerIdentityInfo.cs new file mode 100644 index 000000000000..1f6f40ac72ff --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ContainerIdentityInfo.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Container identity information + /// + public partial class ContainerIdentityInfo + { + /// + /// Initializes a new instance of the ContainerIdentityInfo class. + /// + public ContainerIdentityInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerIdentityInfo class. + /// + /// Unique name of the container + /// Protection container identity - AAD + /// Tenant + /// Protection container + /// identity - AAD Service Principal + /// Protection container identity - + /// Audience + public ContainerIdentityInfo(string uniqueName = default(string), string aadTenantId = default(string), string servicePrincipalClientId = default(string), string audience = default(string)) + { + UniqueName = uniqueName; + AadTenantId = aadTenantId; + ServicePrincipalClientId = servicePrincipalClientId; + Audience = audience; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unique name of the container + /// + [JsonProperty(PropertyName = "uniqueName")] + public string UniqueName { get; set; } + + /// + /// Gets or sets protection container identity - AAD Tenant + /// + [JsonProperty(PropertyName = "aadTenantId")] + public string AadTenantId { get; set; } + + /// + /// Gets or sets protection container identity - AAD Service Principal + /// + [JsonProperty(PropertyName = "servicePrincipalClientId")] + public string ServicePrincipalClientId { get; set; } + + /// + /// Gets or sets protection container identity - Audience + /// + [JsonProperty(PropertyName = "audience")] + public string Audience { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ContainerType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ContainerType.cs new file mode 100644 index 000000000000..42c9c54f6210 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ContainerType.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for ContainerType. + /// + public static class ContainerType + { + public const string Invalid = "Invalid"; + public const string Unknown = "Unknown"; + public const string IaasVMContainer = "IaasVMContainer"; + public const string IaasVMServiceContainer = "IaasVMServiceContainer"; + public const string DPMContainer = "DPMContainer"; + public const string AzureBackupServerContainer = "AzureBackupServerContainer"; + public const string MABContainer = "MABContainer"; + public const string Cluster = "Cluster"; + public const string AzureSqlContainer = "AzureSqlContainer"; + public const string Windows = "Windows"; + public const string VCenter = "VCenter"; + public const string VMAppContainer = "VMAppContainer"; + public const string SQLAGWorkLoadContainer = "SQLAGWorkLoadContainer"; + public const string StorageContainer = "StorageContainer"; + public const string GenericContainer = "GenericContainer"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CopyOptions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CopyOptions.cs new file mode 100644 index 000000000000..d65d19461dc0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CopyOptions.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for CopyOptions. + /// + public static class CopyOptions + { + public const string Invalid = "Invalid"; + public const string CreateCopy = "CreateCopy"; + public const string Skip = "Skip"; + public const string Overwrite = "Overwrite"; + public const string FailOnConflict = "FailOnConflict"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CreateMode.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CreateMode.cs new file mode 100644 index 000000000000..1ab8506518f3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CreateMode.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for CreateMode. + /// + public static class CreateMode + { + public const string Invalid = "Invalid"; + public const string Default = "Default"; + public const string Recover = "Recover"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMContainerExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMContainerExtendedInfo.cs new file mode 100644 index 000000000000..c3476702ce09 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMContainerExtendedInfo.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional information of the DPMContainer. + /// + public partial class DPMContainerExtendedInfo + { + /// + /// Initializes a new instance of the DPMContainerExtendedInfo class. + /// + public DPMContainerExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DPMContainerExtendedInfo class. + /// + /// Last refresh time of the + /// DPMContainer. + public DPMContainerExtendedInfo(System.DateTime? lastRefreshedAt = default(System.DateTime?)) + { + LastRefreshedAt = lastRefreshedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets last refresh time of the DPMContainer. + /// + [JsonProperty(PropertyName = "lastRefreshedAt")] + public System.DateTime? LastRefreshedAt { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs new file mode 100644 index 000000000000..d2ede5aba6b7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Additional information on Backup engine specific backup item. + /// + public partial class DPMProtectedItem : ProtectedItem + { + /// + /// Initializes a new instance of the DPMProtectedItem class. + /// + public DPMProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DPMProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the managed + /// item + /// Backup Management server protecting + /// this backup item + /// Protection state of the backup + /// engine. Possible values include: 'Invalid', 'IRPending', + /// 'Protected', 'ProtectionError', 'ProtectionStopped', + /// 'ProtectionPaused' + /// Extended info of the backup + /// item. + public DPMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string backupEngineName = default(string), string protectionState = default(string), DPMProtectedItemExtendedInfo extendedInfo = default(DPMProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) + { + FriendlyName = friendlyName; + BackupEngineName = backupEngineName; + ProtectionState = protectionState; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the managed item + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets backup Management server protecting this backup item + /// + [JsonProperty(PropertyName = "backupEngineName")] + public string BackupEngineName { get; set; } + + /// + /// Gets or sets protection state of the backup engine. Possible values + /// include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', + /// 'ProtectionStopped', 'ProtectionPaused' + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + /// + /// Gets or sets extended info of the backup item. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public DPMProtectedItemExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItemExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..98865c4fbbd8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItemExtendedInfo.cs @@ -0,0 +1,173 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Additional information of DPM Protected item. + /// + public partial class DPMProtectedItemExtendedInfo + { + /// + /// Initializes a new instance of the DPMProtectedItemExtendedInfo + /// class. + /// + public DPMProtectedItemExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DPMProtectedItemExtendedInfo + /// class. + /// + /// Attribute to provide + /// information on various DBs. + /// To check if backup item is disk + /// protected. + /// To check if backup item is cloud + /// protected. + /// Last backup status information on + /// backup item. + /// Last refresh time on backup + /// item. + /// Oldest cloud recovery point + /// time. + /// cloud recovery point + /// count. + /// Oldest disk recovery + /// point time. + /// latest disk recovery + /// point time. + /// disk recovery point + /// count. + /// To check if backup item is + /// collocated. + /// Protection group name of the + /// backup item. + /// Used Disk storage in + /// bytes. + /// total Disk storage in + /// bytes. + public DPMProtectedItemExtendedInfo(IDictionary protectableObjectLoadPath = default(IDictionary), bool? protectedProperty = default(bool?), bool? isPresentOnCloud = default(bool?), string lastBackupStatus = default(string), System.DateTime? lastRefreshedAt = default(System.DateTime?), System.DateTime? oldestRecoveryPoint = default(System.DateTime?), int? recoveryPointCount = default(int?), System.DateTime? onPremiseOldestRecoveryPoint = default(System.DateTime?), System.DateTime? onPremiseLatestRecoveryPoint = default(System.DateTime?), int? onPremiseRecoveryPointCount = default(int?), bool? isCollocated = default(bool?), string protectionGroupName = default(string), string diskStorageUsedInBytes = default(string), string totalDiskStorageSizeInBytes = default(string)) + { + ProtectableObjectLoadPath = protectableObjectLoadPath; + ProtectedProperty = protectedProperty; + IsPresentOnCloud = isPresentOnCloud; + LastBackupStatus = lastBackupStatus; + LastRefreshedAt = lastRefreshedAt; + OldestRecoveryPoint = oldestRecoveryPoint; + RecoveryPointCount = recoveryPointCount; + OnPremiseOldestRecoveryPoint = onPremiseOldestRecoveryPoint; + OnPremiseLatestRecoveryPoint = onPremiseLatestRecoveryPoint; + OnPremiseRecoveryPointCount = onPremiseRecoveryPointCount; + IsCollocated = isCollocated; + ProtectionGroupName = protectionGroupName; + DiskStorageUsedInBytes = diskStorageUsedInBytes; + TotalDiskStorageSizeInBytes = totalDiskStorageSizeInBytes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets attribute to provide information on various DBs. + /// + [JsonProperty(PropertyName = "protectableObjectLoadPath")] + public IDictionary ProtectableObjectLoadPath { get; set; } + + /// + /// Gets or sets to check if backup item is disk protected. + /// + [JsonProperty(PropertyName = "protected")] + public bool? ProtectedProperty { get; set; } + + /// + /// Gets or sets to check if backup item is cloud protected. + /// + [JsonProperty(PropertyName = "isPresentOnCloud")] + public bool? IsPresentOnCloud { get; set; } + + /// + /// Gets or sets last backup status information on backup item. + /// + [JsonProperty(PropertyName = "lastBackupStatus")] + public string LastBackupStatus { get; set; } + + /// + /// Gets or sets last refresh time on backup item. + /// + [JsonProperty(PropertyName = "lastRefreshedAt")] + public System.DateTime? LastRefreshedAt { get; set; } + + /// + /// Gets or sets oldest cloud recovery point time. + /// + [JsonProperty(PropertyName = "oldestRecoveryPoint")] + public System.DateTime? OldestRecoveryPoint { get; set; } + + /// + /// Gets or sets cloud recovery point count. + /// + [JsonProperty(PropertyName = "recoveryPointCount")] + public int? RecoveryPointCount { get; set; } + + /// + /// Gets or sets oldest disk recovery point time. + /// + [JsonProperty(PropertyName = "onPremiseOldestRecoveryPoint")] + public System.DateTime? OnPremiseOldestRecoveryPoint { get; set; } + + /// + /// Gets or sets latest disk recovery point time. + /// + [JsonProperty(PropertyName = "onPremiseLatestRecoveryPoint")] + public System.DateTime? OnPremiseLatestRecoveryPoint { get; set; } + + /// + /// Gets or sets disk recovery point count. + /// + [JsonProperty(PropertyName = "onPremiseRecoveryPointCount")] + public int? OnPremiseRecoveryPointCount { get; set; } + + /// + /// Gets or sets to check if backup item is collocated. + /// + [JsonProperty(PropertyName = "isCollocated")] + public bool? IsCollocated { get; set; } + + /// + /// Gets or sets protection group name of the backup item. + /// + [JsonProperty(PropertyName = "protectionGroupName")] + public string ProtectionGroupName { get; set; } + + /// + /// Gets or sets used Disk storage in bytes. + /// + [JsonProperty(PropertyName = "diskStorageUsedInBytes")] + public string DiskStorageUsedInBytes { get; set; } + + /// + /// Gets or sets total Disk storage in bytes. + /// + [JsonProperty(PropertyName = "totalDiskStorageSizeInBytes")] + public string TotalDiskStorageSizeInBytes { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailyRetentionFormat.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailyRetentionFormat.cs new file mode 100644 index 000000000000..241bcc186790 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailyRetentionFormat.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Daily retention format. + /// + public partial class DailyRetentionFormat + { + /// + /// Initializes a new instance of the DailyRetentionFormat class. + /// + public DailyRetentionFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyRetentionFormat class. + /// + /// List of days of the month. + public DailyRetentionFormat(IList daysOfTheMonth = default(IList)) + { + DaysOfTheMonth = daysOfTheMonth; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of days of the month. + /// + [JsonProperty(PropertyName = "daysOfTheMonth")] + public IList DaysOfTheMonth { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailyRetentionSchedule.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailyRetentionSchedule.cs new file mode 100644 index 000000000000..0a1758efbabc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailyRetentionSchedule.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Daily retention schedule. + /// + public partial class DailyRetentionSchedule + { + /// + /// Initializes a new instance of the DailyRetentionSchedule class. + /// + public DailyRetentionSchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyRetentionSchedule class. + /// + /// Retention times of retention + /// policy. + /// Retention duration of retention + /// Policy. + public DailyRetentionSchedule(IList retentionTimes = default(IList), RetentionDuration retentionDuration = default(RetentionDuration)) + { + RetentionTimes = retentionTimes; + RetentionDuration = retentionDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets retention times of retention policy. + /// + [JsonProperty(PropertyName = "retentionTimes")] + public IList RetentionTimes { get; set; } + + /// + /// Gets or sets retention duration of retention Policy. + /// + [JsonProperty(PropertyName = "retentionDuration")] + public RetentionDuration RetentionDuration { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailySchedule.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailySchedule.cs new file mode 100644 index 000000000000..4accc820dde8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DailySchedule.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class DailySchedule + { + /// + /// Initializes a new instance of the DailySchedule class. + /// + public DailySchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailySchedule class. + /// + /// List of times of day this schedule + /// has to be run. + public DailySchedule(IList scheduleRunTimes = default(IList)) + { + ScheduleRunTimes = scheduleRunTimes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of times of day this schedule has to be run. + /// + [JsonProperty(PropertyName = "scheduleRunTimes")] + public IList ScheduleRunTimes { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DataMoveLevel.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DataMoveLevel.cs new file mode 100644 index 000000000000..175676db0b86 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DataMoveLevel.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for DataMoveLevel. + /// + public static class DataMoveLevel + { + public const string Invalid = "Invalid"; + public const string Vault = "Vault"; + public const string Container = "Container"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DataSourceType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DataSourceType.cs new file mode 100644 index 000000000000..7617c2109941 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DataSourceType.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for DataSourceType. + /// + public static class DataSourceType + { + public const string Invalid = "Invalid"; + public const string VM = "VM"; + public const string FileFolder = "FileFolder"; + public const string AzureSqlDb = "AzureSqlDb"; + public const string SQLDB = "SQLDB"; + public const string Exchange = "Exchange"; + public const string Sharepoint = "Sharepoint"; + public const string VMwareVM = "VMwareVM"; + public const string SystemState = "SystemState"; + public const string Client = "Client"; + public const string GenericDataSource = "GenericDataSource"; + public const string SQLDataBase = "SQLDataBase"; + public const string AzureFileShare = "AzureFileShare"; + public const string SAPHanaDatabase = "SAPHanaDatabase"; + public const string SAPAseDatabase = "SAPAseDatabase"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Day.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Day.cs new file mode 100644 index 000000000000..148b3265e321 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Day.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Day of the week. + /// + public partial class Day + { + /// + /// Initializes a new instance of the Day class. + /// + public Day() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Day class. + /// + /// Date of the month + /// Whether Date is last date of month + public Day(int? date = default(int?), bool? isLast = default(bool?)) + { + Date = date; + IsLast = isLast; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date of the month + /// + [JsonProperty(PropertyName = "date")] + public int? Date { get; set; } + + /// + /// Gets or sets whether Date is last date of month + /// + [JsonProperty(PropertyName = "isLast")] + public bool? IsLast { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DayOfWeek.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DayOfWeek.cs new file mode 100644 index 000000000000..3fd086be7881 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DayOfWeek.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DayOfWeek. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DayOfWeek + { + [EnumMember(Value = "Sunday")] + Sunday, + [EnumMember(Value = "Monday")] + Monday, + [EnumMember(Value = "Tuesday")] + Tuesday, + [EnumMember(Value = "Wednesday")] + Wednesday, + [EnumMember(Value = "Thursday")] + Thursday, + [EnumMember(Value = "Friday")] + Friday, + [EnumMember(Value = "Saturday")] + Saturday + } + internal static class DayOfWeekEnumExtension + { + internal static string ToSerializedValue(this DayOfWeek? value) + { + return value == null ? null : ((DayOfWeek)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DayOfWeek value) + { + switch( value ) + { + case DayOfWeek.Sunday: + return "Sunday"; + case DayOfWeek.Monday: + return "Monday"; + case DayOfWeek.Tuesday: + return "Tuesday"; + case DayOfWeek.Wednesday: + return "Wednesday"; + case DayOfWeek.Thursday: + return "Thursday"; + case DayOfWeek.Friday: + return "Friday"; + case DayOfWeek.Saturday: + return "Saturday"; + } + return null; + } + + internal static DayOfWeek? ParseDayOfWeek(this string value) + { + switch( value ) + { + case "Sunday": + return DayOfWeek.Sunday; + case "Monday": + return DayOfWeek.Monday; + case "Tuesday": + return DayOfWeek.Tuesday; + case "Wednesday": + return DayOfWeek.Wednesday; + case "Thursday": + return DayOfWeek.Thursday; + case "Friday": + return DayOfWeek.Friday; + case "Saturday": + return DayOfWeek.Saturday; + } + return null; + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DedupState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DedupState.cs new file mode 100644 index 000000000000..83497ee6a19d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DedupState.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for DedupState. + /// + public static class DedupState + { + public const string Invalid = "Invalid"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DiskExclusionProperties.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DiskExclusionProperties.cs new file mode 100644 index 000000000000..2e04d40b006b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DiskExclusionProperties.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class DiskExclusionProperties + { + /// + /// Initializes a new instance of the DiskExclusionProperties class. + /// + public DiskExclusionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskExclusionProperties class. + /// + /// List of Disks' Logical Unit Numbers (LUN) + /// to be used for VM Protection. + /// Flag to indicate whether DiskLunList + /// is to be included/ excluded from backup. + public DiskExclusionProperties(IList diskLunList = default(IList), bool? isInclusionList = default(bool?)) + { + DiskLunList = diskLunList; + IsInclusionList = isInclusionList; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of Disks' Logical Unit Numbers (LUN) to be used + /// for VM Protection. + /// + [JsonProperty(PropertyName = "diskLunList")] + public IList DiskLunList { get; set; } + + /// + /// Gets or sets flag to indicate whether DiskLunList is to be + /// included/ excluded from backup. + /// + [JsonProperty(PropertyName = "isInclusionList")] + public bool? IsInclusionList { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DiskInformation.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DiskInformation.cs new file mode 100644 index 000000000000..a2c1009393c4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DiskInformation.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Disk information + /// + public partial class DiskInformation + { + /// + /// Initializes a new instance of the DiskInformation class. + /// + public DiskInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskInformation class. + /// + public DiskInformation(int? lun = default(int?), string name = default(string)) + { + Lun = lun; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "lun")] + public int? Lun { get; set; } + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DistributedNodesInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DistributedNodesInfo.cs new file mode 100644 index 000000000000..a4a585e32caf --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DistributedNodesInfo.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This is used to represent the various nodes of the distributed + /// container. + /// + public partial class DistributedNodesInfo + { + /// + /// Initializes a new instance of the DistributedNodesInfo class. + /// + public DistributedNodesInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DistributedNodesInfo class. + /// + /// Name of the node under a distributed + /// container. + /// Status of this Node. + /// Failed | Succeeded + /// Error Details if the Status is + /// non-success. + public DistributedNodesInfo(string nodeName = default(string), string status = default(string), ErrorDetail errorDetail = default(ErrorDetail)) + { + NodeName = nodeName; + Status = status; + ErrorDetail = errorDetail; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the node under a distributed container. + /// + [JsonProperty(PropertyName = "nodeName")] + public string NodeName { get; set; } + + /// + /// Gets or sets status of this Node. + /// Failed | Succeeded + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets error Details if the Status is non-success. + /// + [JsonProperty(PropertyName = "errorDetail")] + public ErrorDetail ErrorDetail { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmBackupEngine.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmBackupEngine.cs new file mode 100644 index 000000000000..adb14363b5c9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmBackupEngine.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Data Protection Manager (DPM) specific backup engine. + /// + public partial class DpmBackupEngine : BackupEngineBase + { + /// + /// Initializes a new instance of the DpmBackupEngine class. + /// + public DpmBackupEngine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DpmBackupEngine class. + /// + /// Friendly name of the backup + /// engine. + /// Type of backup management for + /// the backup engine. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Registration status of the backup + /// engine with the Recovery Services Vault. + /// Status of the backup engine with + /// the Recovery Services Vault. = + /// {Active/Deleting/DeleteFailed} + /// Backup status of the backup + /// engine. + /// Flag indicating if the backup engine be + /// registered, once already registered. + /// ID of the backup engine. + /// Backup engine version + /// Backup agent version + /// To check if backup + /// agent upgrade available + /// To check if backup engine + /// upgrade available + /// Extended info of the + /// backupengine + public DpmBackupEngine(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string backupEngineState = default(string), string healthStatus = default(string), bool? canReRegister = default(bool?), string backupEngineId = default(string), string dpmVersion = default(string), string azureBackupAgentVersion = default(string), bool? isAzureBackupAgentUpgradeAvailable = default(bool?), bool? isDpmUpgradeAvailable = default(bool?), BackupEngineExtendedInfo extendedInfo = default(BackupEngineExtendedInfo)) + : base(friendlyName, backupManagementType, registrationStatus, backupEngineState, healthStatus, canReRegister, backupEngineId, dpmVersion, azureBackupAgentVersion, isAzureBackupAgentUpgradeAvailable, isDpmUpgradeAvailable, extendedInfo) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmContainer.cs new file mode 100644 index 000000000000..b2ab6dc3dd51 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmContainer.cs @@ -0,0 +1,127 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// DPM workload-specific protection container. + /// + [Newtonsoft.Json.JsonObject("DPMContainer")] + public partial class DpmContainer : ProtectionContainer + { + /// + /// Initializes a new instance of the DpmContainer class. + /// + public DpmContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DpmContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// Specifies whether the container is + /// re-registrable. + /// ID of container. + /// Number of protected items in the + /// BackupEngine + /// Backup engine Agent version + /// List of BackupEngines protecting the + /// container + /// To check if upgrade + /// available + /// Protection status of the + /// container. + /// Extended Info of the container. + public DpmContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), IList dpmServers = default(IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + { + CanReRegister = canReRegister; + ContainerId = containerId; + ProtectedItemCount = protectedItemCount; + DpmAgentVersion = dpmAgentVersion; + DpmServers = dpmServers; + UpgradeAvailable = upgradeAvailable; + ProtectionStatus = protectionStatus; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies whether the container is re-registrable. + /// + [JsonProperty(PropertyName = "canReRegister")] + public bool? CanReRegister { get; set; } + + /// + /// Gets or sets ID of container. + /// + [JsonProperty(PropertyName = "containerId")] + public string ContainerId { get; set; } + + /// + /// Gets or sets number of protected items in the BackupEngine + /// + [JsonProperty(PropertyName = "protectedItemCount")] + public long? ProtectedItemCount { get; set; } + + /// + /// Gets or sets backup engine Agent version + /// + [JsonProperty(PropertyName = "dpmAgentVersion")] + public string DpmAgentVersion { get; set; } + + /// + /// Gets or sets list of BackupEngines protecting the container + /// + [JsonProperty(PropertyName = "dpmServers")] + public IList DpmServers { get; set; } + + /// + /// Gets or sets to check if upgrade available + /// + [JsonProperty(PropertyName = "upgradeAvailable")] + public bool? UpgradeAvailable { get; set; } + + /// + /// Gets or sets protection status of the container. + /// + [JsonProperty(PropertyName = "protectionStatus")] + public string ProtectionStatus { get; set; } + + /// + /// Gets or sets extended Info of the container. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public DPMContainerExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmErrorInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmErrorInfo.cs new file mode 100644 index 000000000000..eb0f9cad199b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmErrorInfo.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// DPM workload-specific error information. + /// + public partial class DpmErrorInfo + { + /// + /// Initializes a new instance of the DpmErrorInfo class. + /// + public DpmErrorInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DpmErrorInfo class. + /// + /// Localized error string. + /// List of localized recommendations for + /// above error code. + public DpmErrorInfo(string errorString = default(string), IList recommendations = default(IList)) + { + ErrorString = errorString; + Recommendations = recommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets localized error string. + /// + [JsonProperty(PropertyName = "errorString")] + public string ErrorString { get; set; } + + /// + /// Gets or sets list of localized recommendations for above error + /// code. + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJob.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJob.cs new file mode 100644 index 000000000000..9b6e0d723630 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJob.cs @@ -0,0 +1,128 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// DPM workload-specific job object. + /// + public partial class DpmJob : Job + { + /// + /// Initializes a new instance of the DpmJob class. + /// + public DpmJob() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DpmJob class. + /// + /// Friendly name of the entity on + /// which the current job is executing. + /// Backup management type to + /// execute the current job. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// The operation name. + /// Job status. + /// The start time. + /// The end time. + /// ActivityId of job. + /// Time elapsed for job. + /// DPM server name managing the backup + /// item or backup job. + /// Name of cluster/server protecting + /// current backup item, if any. + /// Type of container. + /// Type of backup item. + /// The state/actions applicable on this job + /// like cancel/retry. + /// The errors. + /// Additional information for this + /// job. + public DpmJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), string dpmServerName = default(string), string containerName = default(string), string containerType = default(string), string workloadType = default(string), IList actionsInfo = default(IList), IList errorDetails = default(IList), DpmJobExtendedInfo extendedInfo = default(DpmJobExtendedInfo)) + : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) + { + Duration = duration; + DpmServerName = dpmServerName; + ContainerName = containerName; + ContainerType = containerType; + WorkloadType = workloadType; + ActionsInfo = actionsInfo; + ErrorDetails = errorDetails; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets time elapsed for job. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets DPM server name managing the backup item or backup + /// job. + /// + [JsonProperty(PropertyName = "dpmServerName")] + public string DpmServerName { get; set; } + + /// + /// Gets or sets name of cluster/server protecting current backup item, + /// if any. + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets type of container. + /// + [JsonProperty(PropertyName = "containerType")] + public string ContainerType { get; set; } + + /// + /// Gets or sets type of backup item. + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + /// + /// Gets or sets the state/actions applicable on this job like + /// cancel/retry. + /// + [JsonProperty(PropertyName = "actionsInfo")] + public IList ActionsInfo { get; set; } + + /// + /// Gets or sets the errors. + /// + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; set; } + + /// + /// Gets or sets additional information for this job. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public DpmJobExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJobExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJobExtendedInfo.cs new file mode 100644 index 000000000000..f1f3bf044560 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJobExtendedInfo.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Additional information on the DPM workload-specific job. + /// + public partial class DpmJobExtendedInfo + { + /// + /// Initializes a new instance of the DpmJobExtendedInfo class. + /// + public DpmJobExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DpmJobExtendedInfo class. + /// + /// List of tasks associated with this + /// job. + /// The job properties. + /// Non localized error message on + /// job execution. + public DpmJobExtendedInfo(IList tasksList = default(IList), IDictionary propertyBag = default(IDictionary), string dynamicErrorMessage = default(string)) + { + TasksList = tasksList; + PropertyBag = propertyBag; + DynamicErrorMessage = dynamicErrorMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of tasks associated with this job. + /// + [JsonProperty(PropertyName = "tasksList")] + public IList TasksList { get; set; } + + /// + /// Gets or sets the job properties. + /// + [JsonProperty(PropertyName = "propertyBag")] + public IDictionary PropertyBag { get; set; } + + /// + /// Gets or sets non localized error message on job execution. + /// + [JsonProperty(PropertyName = "dynamicErrorMessage")] + public string DynamicErrorMessage { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJobTaskDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJobTaskDetails.cs new file mode 100644 index 000000000000..53658dc559e9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmJobTaskDetails.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// DPM workload-specific job task details. + /// + public partial class DpmJobTaskDetails + { + /// + /// Initializes a new instance of the DpmJobTaskDetails class. + /// + public DpmJobTaskDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DpmJobTaskDetails class. + /// + /// The task display name. + /// The start time. + /// The end time. + /// Time elapsed for task. + /// The status. + public DpmJobTaskDetails(string taskId = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), System.TimeSpan? duration = default(System.TimeSpan?), string status = default(string)) + { + TaskId = taskId; + StartTime = startTime; + EndTime = endTime; + Duration = duration; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the task display name. + /// + [JsonProperty(PropertyName = "taskId")] + public string TaskId { get; set; } + + /// + /// Gets or sets the start time. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the end time. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets time elapsed for task. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets the status. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EncryptionAtRestType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EncryptionAtRestType.cs new file mode 100644 index 000000000000..cf638c2e2f8c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EncryptionAtRestType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for EncryptionAtRestType. + /// + public static class EncryptionAtRestType + { + public const string Invalid = "Invalid"; + public const string MicrosoftManaged = "MicrosoftManaged"; + public const string CustomerManaged = "CustomerManaged"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EncryptionDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EncryptionDetails.cs new file mode 100644 index 000000000000..8e9d8ed26b9b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EncryptionDetails.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details needed if the VM was encrypted at the time of backup. + /// + public partial class EncryptionDetails + { + /// + /// Initializes a new instance of the EncryptionDetails class. + /// + public EncryptionDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EncryptionDetails class. + /// + /// Identifies whether this backup copy + /// represents an encrypted VM at the time of backup. + /// Key Url. + /// Secret Url. + /// ID of Key Vault where KEK is + /// stored. + /// ID of Key Vault where Secret is + /// stored. + public EncryptionDetails(bool? encryptionEnabled = default(bool?), string kekUrl = default(string), string secretKeyUrl = default(string), string kekVaultId = default(string), string secretKeyVaultId = default(string)) + { + EncryptionEnabled = encryptionEnabled; + KekUrl = kekUrl; + SecretKeyUrl = secretKeyUrl; + KekVaultId = kekVaultId; + SecretKeyVaultId = secretKeyVaultId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets identifies whether this backup copy represents an + /// encrypted VM at the time of backup. + /// + [JsonProperty(PropertyName = "encryptionEnabled")] + public bool? EncryptionEnabled { get; set; } + + /// + /// Gets or sets key Url. + /// + [JsonProperty(PropertyName = "kekUrl")] + public string KekUrl { get; set; } + + /// + /// Gets or sets secret Url. + /// + [JsonProperty(PropertyName = "secretKeyUrl")] + public string SecretKeyUrl { get; set; } + + /// + /// Gets or sets ID of Key Vault where KEK is stored. + /// + [JsonProperty(PropertyName = "kekVaultId")] + public string KekVaultId { get; set; } + + /// + /// Gets or sets ID of Key Vault where Secret is stored. + /// + [JsonProperty(PropertyName = "secretKeyVaultId")] + public string SecretKeyVaultId { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EnhancedSecurityState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EnhancedSecurityState.cs new file mode 100644 index 000000000000..f50f7e014ca4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/EnhancedSecurityState.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for EnhancedSecurityState. + /// + public static class EnhancedSecurityState + { + public const string Invalid = "Invalid"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..0a3deaaeb053 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorDetail.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..c2e58ec5e09c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Error Detail class which encapsulates Code, Message and + /// Recommendations. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// Error code. + /// Error Message related to the Code. + /// List of recommendation + /// strings. + public ErrorDetail(string code = default(string), string message = default(string), IList recommendations = default(IList)) + { + Code = code; + Message = message; + Recommendations = recommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets error Message related to the Code. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets list of recommendation strings. + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; private set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExportJobsOperationResultInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExportJobsOperationResultInfo.cs new file mode 100644 index 000000000000..e821eff26615 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExportJobsOperationResultInfo.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This class is used to send blob details after exporting jobs. + /// + public partial class ExportJobsOperationResultInfo : OperationResultInfoBase + { + /// + /// Initializes a new instance of the ExportJobsOperationResultInfo + /// class. + /// + public ExportJobsOperationResultInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExportJobsOperationResultInfo + /// class. + /// + /// URL of the blob into which the serialized + /// string of list of jobs is exported. + /// SAS key to access the blob. It expires in + /// 15 mins. + /// URL of the blob into which the + /// ExcelFile is uploaded. + /// SAS key to access the blob. It + /// expires in 15 mins. + public ExportJobsOperationResultInfo(string blobUrl = default(string), string blobSasKey = default(string), string excelFileBlobUrl = default(string), string excelFileBlobSasKey = default(string)) + { + BlobUrl = blobUrl; + BlobSasKey = blobSasKey; + ExcelFileBlobUrl = excelFileBlobUrl; + ExcelFileBlobSasKey = excelFileBlobSasKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL of the blob into which the serialized string of + /// list of jobs is exported. + /// + [JsonProperty(PropertyName = "blobUrl")] + public string BlobUrl { get; set; } + + /// + /// Gets or sets SAS key to access the blob. It expires in 15 mins. + /// + [JsonProperty(PropertyName = "blobSasKey")] + public string BlobSasKey { get; set; } + + /// + /// Gets or sets URL of the blob into which the ExcelFile is uploaded. + /// + [JsonProperty(PropertyName = "excelFileBlobUrl")] + public string ExcelFileBlobUrl { get; set; } + + /// + /// Gets or sets SAS key to access the blob. It expires in 15 mins. + /// + [JsonProperty(PropertyName = "excelFileBlobSasKey")] + public string ExcelFileBlobSasKey { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExtendedProperties.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExtendedProperties.cs new file mode 100644 index 000000000000..ac30869d3551 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExtendedProperties.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Extended Properties for Azure IaasVM Backup. + /// + public partial class ExtendedProperties + { + /// + /// Initializes a new instance of the ExtendedProperties class. + /// + public ExtendedProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExtendedProperties class. + /// + /// Extended Properties for Disk + /// Exclusion. + /// Linux VM name + public ExtendedProperties(DiskExclusionProperties diskExclusionProperties = default(DiskExclusionProperties), string linuxVmApplicationName = default(string)) + { + DiskExclusionProperties = diskExclusionProperties; + LinuxVmApplicationName = linuxVmApplicationName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets extended Properties for Disk Exclusion. + /// + [JsonProperty(PropertyName = "diskExclusionProperties")] + public DiskExclusionProperties DiskExclusionProperties { get; set; } + + /// + /// Gets or sets linux VM name + /// + [JsonProperty(PropertyName = "linuxVmApplicationName")] + public string LinuxVmApplicationName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/FabricName.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/FabricName.cs new file mode 100644 index 000000000000..b46109646dca --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/FabricName.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for FabricName. + /// + public static class FabricName + { + public const string Invalid = "Invalid"; + public const string Azure = "Azure"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/FeatureSupportRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/FeatureSupportRequest.cs new file mode 100644 index 000000000000..86c8c1ed80d4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/FeatureSupportRequest.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Base class for feature request + /// + public partial class FeatureSupportRequest + { + /// + /// Initializes a new instance of the FeatureSupportRequest class. + /// + public FeatureSupportRequest() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainer.cs new file mode 100644 index 000000000000..0eed0b71f321 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainer.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Base class for generic container of backup items + /// + public partial class GenericContainer : ProtectionContainer + { + /// + /// Initializes a new instance of the GenericContainer class. + /// + public GenericContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GenericContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// Name of the container's fabric + /// Extended information (not + /// returned in List container API calls) + public GenericContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string fabricName = default(string), GenericContainerExtendedInfo extendedInformation = default(GenericContainerExtendedInfo)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + { + FabricName = fabricName; + ExtendedInformation = extendedInformation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the container's fabric + /// + [JsonProperty(PropertyName = "fabricName")] + public string FabricName { get; set; } + + /// + /// Gets or sets extended information (not returned in List container + /// API calls) + /// + [JsonProperty(PropertyName = "extendedInformation")] + public GenericContainerExtendedInfo ExtendedInformation { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainerExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainerExtendedInfo.cs new file mode 100644 index 000000000000..071605b53210 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainerExtendedInfo.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Container extended information + /// + public partial class GenericContainerExtendedInfo + { + /// + /// Initializes a new instance of the GenericContainerExtendedInfo + /// class. + /// + public GenericContainerExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GenericContainerExtendedInfo + /// class. + /// + /// Public key of container cert + /// Container identity + /// information + /// Azure Backup Service Endpoints for + /// the container + public GenericContainerExtendedInfo(string rawCertData = default(string), ContainerIdentityInfo containerIdentityInfo = default(ContainerIdentityInfo), IDictionary serviceEndpoints = default(IDictionary)) + { + RawCertData = rawCertData; + ContainerIdentityInfo = containerIdentityInfo; + ServiceEndpoints = serviceEndpoints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets public key of container cert + /// + [JsonProperty(PropertyName = "rawCertData")] + public string RawCertData { get; set; } + + /// + /// Gets or sets container identity information + /// + [JsonProperty(PropertyName = "containerIdentityInfo")] + public ContainerIdentityInfo ContainerIdentityInfo { get; set; } + + /// + /// Gets or sets azure Backup Service Endpoints for the container + /// + [JsonProperty(PropertyName = "serviceEndpoints")] + public IDictionary ServiceEndpoints { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs new file mode 100644 index 000000000000..46c8a5c18c7d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs @@ -0,0 +1,141 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup items. + /// + public partial class GenericProtectedItem : ProtectedItem + { + /// + /// Initializes a new instance of the GenericProtectedItem class. + /// + public GenericProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GenericProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of the container. + /// Indicates consistency of policy object + /// and policy applied to this backup item. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'IRPending', 'Protected', + /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' + /// Data Plane Service ID of the + /// protected item. + /// Loosely coupled (type, value) + /// associations (example - parent of a protected item) + /// Name of this backup item's fabric. + public GenericProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string policyState = default(string), string protectionState = default(string), long? protectedItemId = default(long?), IDictionary sourceAssociations = default(IDictionary), string fabricName = default(string)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) + { + FriendlyName = friendlyName; + PolicyState = policyState; + ProtectionState = protectionState; + ProtectedItemId = protectedItemId; + SourceAssociations = sourceAssociations; + FabricName = fabricName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the container. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets indicates consistency of policy object and policy + /// applied to this backup item. + /// + [JsonProperty(PropertyName = "policyState")] + public string PolicyState { get; set; } + + /// + /// Gets or sets backup state of this backup item. Possible values + /// include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', + /// 'ProtectionStopped', 'ProtectionPaused' + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + /// + /// Gets or sets data Plane Service ID of the protected item. + /// + [JsonProperty(PropertyName = "protectedItemId")] + public long? ProtectedItemId { get; set; } + + /// + /// Gets or sets loosely coupled (type, value) associations (example - + /// parent of a protected item) + /// + [JsonProperty(PropertyName = "sourceAssociations")] + public IDictionary SourceAssociations { get; set; } + + /// + /// Gets or sets name of this backup item's fabric. + /// + [JsonProperty(PropertyName = "fabricName")] + public string FabricName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectionPolicy.cs new file mode 100644 index 000000000000..05c25c272373 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectionPolicy.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure VM (Mercury) workload-specific backup policy. + /// + public partial class GenericProtectionPolicy : ProtectionPolicy + { + /// + /// Initializes a new instance of the GenericProtectionPolicy class. + /// + public GenericProtectionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GenericProtectionPolicy class. + /// + /// Number of items associated with + /// this policy. + /// ResourceGuard + /// Operation Requests + /// List of sub-protection policies + /// which includes schedule and retention + /// TimeZone optional input as string. For + /// example: TimeZone = "Pacific Standard Time". + /// Name of this policy's fabric. + public GenericProtectionPolicy(int? protectedItemsCount = default(int?), IList resourceGuardOperationRequests = default(IList), IList subProtectionPolicy = default(IList), string timeZone = default(string), string fabricName = default(string)) + : base(protectedItemsCount, resourceGuardOperationRequests) + { + SubProtectionPolicy = subProtectionPolicy; + TimeZone = timeZone; + FabricName = fabricName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of sub-protection policies which includes + /// schedule and retention + /// + [JsonProperty(PropertyName = "subProtectionPolicy")] + public IList SubProtectionPolicy { get; set; } + + /// + /// Gets or sets timeZone optional input as string. For example: + /// TimeZone = "Pacific Standard Time". + /// + [JsonProperty(PropertyName = "timeZone")] + public string TimeZone { get; set; } + + /// + /// Gets or sets name of this policy's fabric. + /// + [JsonProperty(PropertyName = "fabricName")] + public string FabricName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericRecoveryPoint.cs new file mode 100644 index 000000000000..89dc1bcc9138 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericRecoveryPoint.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Generic backup copy. + /// + public partial class GenericRecoveryPoint : RecoveryPoint + { + /// + /// Initializes a new instance of the GenericRecoveryPoint class. + /// + public GenericRecoveryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GenericRecoveryPoint class. + /// + /// Friendly name of the backup + /// copy. + /// Type of the backup copy. + /// Time at which this backup copy was + /// created. + /// Additional information + /// associated with this backup copy. + public GenericRecoveryPoint(string friendlyName = default(string), string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string recoveryPointAdditionalInfo = default(string)) + { + FriendlyName = friendlyName; + RecoveryPointType = recoveryPointType; + RecoveryPointTime = recoveryPointTime; + RecoveryPointAdditionalInfo = recoveryPointAdditionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the backup copy. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets type of the backup copy. + /// + [JsonProperty(PropertyName = "recoveryPointType")] + public string RecoveryPointType { get; set; } + + /// + /// Gets or sets time at which this backup copy was created. + /// + [JsonProperty(PropertyName = "recoveryPointTime")] + public System.DateTime? RecoveryPointTime { get; set; } + + /// + /// Gets or sets additional information associated with this backup + /// copy. + /// + [JsonProperty(PropertyName = "recoveryPointAdditionalInfo")] + public string RecoveryPointAdditionalInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GetProtectedItemQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GetProtectedItemQueryObject.cs new file mode 100644 index 000000000000..e84810c7d2be --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GetProtectedItemQueryObject.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Filters to list backup items. + /// + public partial class GetProtectedItemQueryObject + { + /// + /// Initializes a new instance of the GetProtectedItemQueryObject + /// class. + /// + public GetProtectedItemQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GetProtectedItemQueryObject + /// class. + /// + /// Specifies if the additional information should + /// be provided for this item. + public GetProtectedItemQueryObject(string expand = default(string)) + { + Expand = expand; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies if the additional information should be + /// provided for this item. + /// + [JsonProperty(PropertyName = "expand")] + public string Expand { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HealthState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HealthState.cs new file mode 100644 index 000000000000..161d62917450 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HealthState.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for HealthState. + /// + public static class HealthState + { + public const string Passed = "Passed"; + public const string ActionRequired = "ActionRequired"; + public const string ActionSuggested = "ActionSuggested"; + public const string Invalid = "Invalid"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HealthStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HealthStatus.cs new file mode 100644 index 000000000000..975069b5ea17 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HealthStatus.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for HealthStatus. + /// + public static class HealthStatus + { + public const string Passed = "Passed"; + public const string ActionRequired = "ActionRequired"; + public const string ActionSuggested = "ActionSuggested"; + public const string Invalid = "Invalid"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HourlySchedule.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HourlySchedule.cs new file mode 100644 index 000000000000..992c429e5121 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HourlySchedule.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class HourlySchedule + { + /// + /// Initializes a new instance of the HourlySchedule class. + /// + public HourlySchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HourlySchedule class. + /// + /// Interval at which backup needs to be + /// triggered. For hourly the value + /// can be 4/6/8/12 + /// To specify start time of the + /// backup window + /// To specify duration of the + /// backup window + public HourlySchedule(int? interval = default(int?), System.DateTime? scheduleWindowStartTime = default(System.DateTime?), int? scheduleWindowDuration = default(int?)) + { + Interval = interval; + ScheduleWindowStartTime = scheduleWindowStartTime; + ScheduleWindowDuration = scheduleWindowDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets interval at which backup needs to be triggered. For + /// hourly the value + /// can be 4/6/8/12 + /// + [JsonProperty(PropertyName = "interval")] + public int? Interval { get; set; } + + /// + /// Gets or sets to specify start time of the backup window + /// + [JsonProperty(PropertyName = "scheduleWindowStartTime")] + public System.DateTime? ScheduleWindowStartTime { get; set; } + + /// + /// Gets or sets to specify duration of the backup window + /// + [JsonProperty(PropertyName = "scheduleWindowDuration")] + public int? ScheduleWindowDuration { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HttpStatusCode.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HttpStatusCode.cs new file mode 100644 index 000000000000..ce56d6551ee1 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HttpStatusCode.cs @@ -0,0 +1,330 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for HttpStatusCode. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum HttpStatusCode + { + [EnumMember(Value = "Continue")] + Continue, + [EnumMember(Value = "SwitchingProtocols")] + SwitchingProtocols, + [EnumMember(Value = "OK")] + OK, + [EnumMember(Value = "Created")] + Created, + [EnumMember(Value = "Accepted")] + Accepted, + [EnumMember(Value = "NonAuthoritativeInformation")] + NonAuthoritativeInformation, + [EnumMember(Value = "NoContent")] + NoContent, + [EnumMember(Value = "ResetContent")] + ResetContent, + [EnumMember(Value = "PartialContent")] + PartialContent, + [EnumMember(Value = "MultipleChoices")] + MultipleChoices, + [EnumMember(Value = "Ambiguous")] + Ambiguous, + [EnumMember(Value = "MovedPermanently")] + MovedPermanently, + [EnumMember(Value = "Moved")] + Moved, + [EnumMember(Value = "Found")] + Found, + [EnumMember(Value = "Redirect")] + Redirect, + [EnumMember(Value = "SeeOther")] + SeeOther, + [EnumMember(Value = "RedirectMethod")] + RedirectMethod, + [EnumMember(Value = "NotModified")] + NotModified, + [EnumMember(Value = "UseProxy")] + UseProxy, + [EnumMember(Value = "Unused")] + Unused, + [EnumMember(Value = "TemporaryRedirect")] + TemporaryRedirect, + [EnumMember(Value = "RedirectKeepVerb")] + RedirectKeepVerb, + [EnumMember(Value = "BadRequest")] + BadRequest, + [EnumMember(Value = "Unauthorized")] + Unauthorized, + [EnumMember(Value = "PaymentRequired")] + PaymentRequired, + [EnumMember(Value = "Forbidden")] + Forbidden, + [EnumMember(Value = "NotFound")] + NotFound, + [EnumMember(Value = "MethodNotAllowed")] + MethodNotAllowed, + [EnumMember(Value = "NotAcceptable")] + NotAcceptable, + [EnumMember(Value = "ProxyAuthenticationRequired")] + ProxyAuthenticationRequired, + [EnumMember(Value = "RequestTimeout")] + RequestTimeout, + [EnumMember(Value = "Conflict")] + Conflict, + [EnumMember(Value = "Gone")] + Gone, + [EnumMember(Value = "LengthRequired")] + LengthRequired, + [EnumMember(Value = "PreconditionFailed")] + PreconditionFailed, + [EnumMember(Value = "RequestEntityTooLarge")] + RequestEntityTooLarge, + [EnumMember(Value = "RequestUriTooLong")] + RequestUriTooLong, + [EnumMember(Value = "UnsupportedMediaType")] + UnsupportedMediaType, + [EnumMember(Value = "RequestedRangeNotSatisfiable")] + RequestedRangeNotSatisfiable, + [EnumMember(Value = "ExpectationFailed")] + ExpectationFailed, + [EnumMember(Value = "UpgradeRequired")] + UpgradeRequired, + [EnumMember(Value = "InternalServerError")] + InternalServerError, + [EnumMember(Value = "NotImplemented")] + NotImplemented, + [EnumMember(Value = "BadGateway")] + BadGateway, + [EnumMember(Value = "ServiceUnavailable")] + ServiceUnavailable, + [EnumMember(Value = "GatewayTimeout")] + GatewayTimeout, + [EnumMember(Value = "HttpVersionNotSupported")] + HttpVersionNotSupported + } + internal static class HttpStatusCodeEnumExtension + { + internal static string ToSerializedValue(this HttpStatusCode? value) + { + return value == null ? null : ((HttpStatusCode)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this HttpStatusCode value) + { + switch( value ) + { + case HttpStatusCode.Continue: + return "Continue"; + case HttpStatusCode.SwitchingProtocols: + return "SwitchingProtocols"; + case HttpStatusCode.OK: + return "OK"; + case HttpStatusCode.Created: + return "Created"; + case HttpStatusCode.Accepted: + return "Accepted"; + case HttpStatusCode.NonAuthoritativeInformation: + return "NonAuthoritativeInformation"; + case HttpStatusCode.NoContent: + return "NoContent"; + case HttpStatusCode.ResetContent: + return "ResetContent"; + case HttpStatusCode.PartialContent: + return "PartialContent"; + case HttpStatusCode.MultipleChoices: + return "MultipleChoices"; + case HttpStatusCode.Ambiguous: + return "Ambiguous"; + case HttpStatusCode.MovedPermanently: + return "MovedPermanently"; + case HttpStatusCode.Moved: + return "Moved"; + case HttpStatusCode.Found: + return "Found"; + case HttpStatusCode.Redirect: + return "Redirect"; + case HttpStatusCode.SeeOther: + return "SeeOther"; + case HttpStatusCode.RedirectMethod: + return "RedirectMethod"; + case HttpStatusCode.NotModified: + return "NotModified"; + case HttpStatusCode.UseProxy: + return "UseProxy"; + case HttpStatusCode.Unused: + return "Unused"; + case HttpStatusCode.TemporaryRedirect: + return "TemporaryRedirect"; + case HttpStatusCode.RedirectKeepVerb: + return "RedirectKeepVerb"; + case HttpStatusCode.BadRequest: + return "BadRequest"; + case HttpStatusCode.Unauthorized: + return "Unauthorized"; + case HttpStatusCode.PaymentRequired: + return "PaymentRequired"; + case HttpStatusCode.Forbidden: + return "Forbidden"; + case HttpStatusCode.NotFound: + return "NotFound"; + case HttpStatusCode.MethodNotAllowed: + return "MethodNotAllowed"; + case HttpStatusCode.NotAcceptable: + return "NotAcceptable"; + case HttpStatusCode.ProxyAuthenticationRequired: + return "ProxyAuthenticationRequired"; + case HttpStatusCode.RequestTimeout: + return "RequestTimeout"; + case HttpStatusCode.Conflict: + return "Conflict"; + case HttpStatusCode.Gone: + return "Gone"; + case HttpStatusCode.LengthRequired: + return "LengthRequired"; + case HttpStatusCode.PreconditionFailed: + return "PreconditionFailed"; + case HttpStatusCode.RequestEntityTooLarge: + return "RequestEntityTooLarge"; + case HttpStatusCode.RequestUriTooLong: + return "RequestUriTooLong"; + case HttpStatusCode.UnsupportedMediaType: + return "UnsupportedMediaType"; + case HttpStatusCode.RequestedRangeNotSatisfiable: + return "RequestedRangeNotSatisfiable"; + case HttpStatusCode.ExpectationFailed: + return "ExpectationFailed"; + case HttpStatusCode.UpgradeRequired: + return "UpgradeRequired"; + case HttpStatusCode.InternalServerError: + return "InternalServerError"; + case HttpStatusCode.NotImplemented: + return "NotImplemented"; + case HttpStatusCode.BadGateway: + return "BadGateway"; + case HttpStatusCode.ServiceUnavailable: + return "ServiceUnavailable"; + case HttpStatusCode.GatewayTimeout: + return "GatewayTimeout"; + case HttpStatusCode.HttpVersionNotSupported: + return "HttpVersionNotSupported"; + } + return null; + } + + internal static HttpStatusCode? ParseHttpStatusCode(this string value) + { + switch( value ) + { + case "Continue": + return HttpStatusCode.Continue; + case "SwitchingProtocols": + return HttpStatusCode.SwitchingProtocols; + case "OK": + return HttpStatusCode.OK; + case "Created": + return HttpStatusCode.Created; + case "Accepted": + return HttpStatusCode.Accepted; + case "NonAuthoritativeInformation": + return HttpStatusCode.NonAuthoritativeInformation; + case "NoContent": + return HttpStatusCode.NoContent; + case "ResetContent": + return HttpStatusCode.ResetContent; + case "PartialContent": + return HttpStatusCode.PartialContent; + case "MultipleChoices": + return HttpStatusCode.MultipleChoices; + case "Ambiguous": + return HttpStatusCode.Ambiguous; + case "MovedPermanently": + return HttpStatusCode.MovedPermanently; + case "Moved": + return HttpStatusCode.Moved; + case "Found": + return HttpStatusCode.Found; + case "Redirect": + return HttpStatusCode.Redirect; + case "SeeOther": + return HttpStatusCode.SeeOther; + case "RedirectMethod": + return HttpStatusCode.RedirectMethod; + case "NotModified": + return HttpStatusCode.NotModified; + case "UseProxy": + return HttpStatusCode.UseProxy; + case "Unused": + return HttpStatusCode.Unused; + case "TemporaryRedirect": + return HttpStatusCode.TemporaryRedirect; + case "RedirectKeepVerb": + return HttpStatusCode.RedirectKeepVerb; + case "BadRequest": + return HttpStatusCode.BadRequest; + case "Unauthorized": + return HttpStatusCode.Unauthorized; + case "PaymentRequired": + return HttpStatusCode.PaymentRequired; + case "Forbidden": + return HttpStatusCode.Forbidden; + case "NotFound": + return HttpStatusCode.NotFound; + case "MethodNotAllowed": + return HttpStatusCode.MethodNotAllowed; + case "NotAcceptable": + return HttpStatusCode.NotAcceptable; + case "ProxyAuthenticationRequired": + return HttpStatusCode.ProxyAuthenticationRequired; + case "RequestTimeout": + return HttpStatusCode.RequestTimeout; + case "Conflict": + return HttpStatusCode.Conflict; + case "Gone": + return HttpStatusCode.Gone; + case "LengthRequired": + return HttpStatusCode.LengthRequired; + case "PreconditionFailed": + return HttpStatusCode.PreconditionFailed; + case "RequestEntityTooLarge": + return HttpStatusCode.RequestEntityTooLarge; + case "RequestUriTooLong": + return HttpStatusCode.RequestUriTooLong; + case "UnsupportedMediaType": + return HttpStatusCode.UnsupportedMediaType; + case "RequestedRangeNotSatisfiable": + return HttpStatusCode.RequestedRangeNotSatisfiable; + case "ExpectationFailed": + return HttpStatusCode.ExpectationFailed; + case "UpgradeRequired": + return HttpStatusCode.UpgradeRequired; + case "InternalServerError": + return HttpStatusCode.InternalServerError; + case "NotImplemented": + return HttpStatusCode.NotImplemented; + case "BadGateway": + return HttpStatusCode.BadGateway; + case "ServiceUnavailable": + return HttpStatusCode.ServiceUnavailable; + case "GatewayTimeout": + return HttpStatusCode.GatewayTimeout; + case "HttpVersionNotSupported": + return HttpStatusCode.HttpVersionNotSupported; + } + return null; + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IAASVMPolicyType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IAASVMPolicyType.cs new file mode 100644 index 000000000000..b499b389b3fd --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IAASVMPolicyType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for IAASVMPolicyType. + /// + public static class IAASVMPolicyType + { + public const string Invalid = "Invalid"; + public const string V1 = "V1"; + public const string V2 = "V2"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ILRRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ILRRequest.cs new file mode 100644 index 000000000000..55b1ffbe3fd2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ILRRequest.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Parameters to Provision ILR API. + /// + public partial class ILRRequest + { + /// + /// Initializes a new instance of the ILRRequest class. + /// + public ILRRequest() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ILRRequestResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ILRRequestResource.cs new file mode 100644 index 000000000000..5456a366d768 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ILRRequestResource.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Parameters to Provision ILR API. + /// + public partial class ILRRequestResource : Resource + { + /// + /// Initializes a new instance of the ILRRequestResource class. + /// + public ILRRequestResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ILRRequestResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// ILRRequestResource properties + public ILRRequestResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), ILRRequest properties = default(ILRRequest)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets iLRRequestResource properties + /// + [JsonProperty(PropertyName = "properties")] + public ILRRequest Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMContainer.cs new file mode 100644 index 000000000000..e705c87f1ce5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMContainer.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// IaaS VM workload-specific container. + /// + public partial class IaaSVMContainer : ProtectionContainer + { + /// + /// Initializes a new instance of the IaaSVMContainer class. + /// + public IaaSVMContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IaaSVMContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// Fully qualified ARM url of the + /// virtual machine represented by this Azure IaaS VM + /// container. + /// Specifies whether the container + /// represents a Classic or an Azure Resource Manager VM. + /// Resource group name of Recovery + /// Services Vault. + public IaaSVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + { + VirtualMachineId = virtualMachineId; + VirtualMachineVersion = virtualMachineVersion; + ResourceGroup = resourceGroup; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets fully qualified ARM url of the virtual machine + /// represented by this Azure IaaS VM container. + /// + [JsonProperty(PropertyName = "virtualMachineId")] + public string VirtualMachineId { get; set; } + + /// + /// Gets or sets specifies whether the container represents a Classic + /// or an Azure Resource Manager VM. + /// + [JsonProperty(PropertyName = "virtualMachineVersion")] + public string VirtualMachineVersion { get; set; } + + /// + /// Gets or sets resource group name of Recovery Services Vault. + /// + [JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMProtectableItem.cs new file mode 100644 index 000000000000..ab9f796b4628 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMProtectableItem.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// IaaS VM workload-specific backup item. + /// + public partial class IaaSVMProtectableItem : WorkloadProtectableItem + { + /// + /// Initializes a new instance of the IaaSVMProtectableItem class. + /// + public IaaSVMProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IaaSVMProtectableItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + /// Fully qualified ARM ID of the + /// virtual machine. + /// Specifies whether the container + /// represents a Classic or an Azure Resource Manager VM. + /// Resource group name of Recovery + /// Services Vault. + public IaaSVMProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(backupManagementType, workloadType, friendlyName, protectionState) + { + VirtualMachineId = virtualMachineId; + VirtualMachineVersion = virtualMachineVersion; + ResourceGroup = resourceGroup; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets fully qualified ARM ID of the virtual machine. + /// + [JsonProperty(PropertyName = "virtualMachineId")] + public string VirtualMachineId { get; set; } + + /// + /// Gets or sets specifies whether the container represents a Classic + /// or an Azure Resource Manager VM. + /// + [JsonProperty(PropertyName = "virtualMachineVersion")] + public string VirtualMachineVersion { get; set; } + + /// + /// Gets or sets resource group name of Recovery Services Vault. + /// + [JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMBackupRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMBackupRequest.cs new file mode 100644 index 000000000000..db91cb3a4598 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMBackupRequest.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// IaaS VM workload-specific backup request. + /// + public partial class IaasVMBackupRequest : BackupRequest + { + /// + /// Initializes a new instance of the IaasVMBackupRequest class. + /// + public IaasVMBackupRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IaasVMBackupRequest class. + /// + /// Backup copy will expire + /// after the time specified (UTC). + public IaasVMBackupRequest(System.DateTime? recoveryPointExpiryTimeInUTC = default(System.DateTime?)) + { + RecoveryPointExpiryTimeInUTC = recoveryPointExpiryTimeInUTC; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup copy will expire after the time specified + /// (UTC). + /// + [JsonProperty(PropertyName = "recoveryPointExpiryTimeInUTC")] + public System.DateTime? RecoveryPointExpiryTimeInUTC { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMILRRegistrationRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMILRRegistrationRequest.cs new file mode 100644 index 000000000000..64eddd1d6ec7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMILRRegistrationRequest.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Restore files/folders from a backup copy of IaaS VM. + /// + public partial class IaasVMILRRegistrationRequest : ILRRequest + { + /// + /// Initializes a new instance of the IaasVMILRRegistrationRequest + /// class. + /// + public IaasVMILRRegistrationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IaasVMILRRegistrationRequest + /// class. + /// + /// ID of the IaaS VM backup copy from + /// where the files/folders have to be restored. + /// Fully qualified ARM ID of the + /// virtual machine whose the files / folders have to be + /// restored. + /// iSCSI initiator name. + /// Whether to renew existing + /// registration with the iSCSI server. + public IaasVMILRRegistrationRequest(string recoveryPointId = default(string), string virtualMachineId = default(string), string initiatorName = default(string), bool? renewExistingRegistration = default(bool?)) + { + RecoveryPointId = recoveryPointId; + VirtualMachineId = virtualMachineId; + InitiatorName = initiatorName; + RenewExistingRegistration = renewExistingRegistration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ID of the IaaS VM backup copy from where the + /// files/folders have to be restored. + /// + [JsonProperty(PropertyName = "recoveryPointId")] + public string RecoveryPointId { get; set; } + + /// + /// Gets or sets fully qualified ARM ID of the virtual machine whose + /// the files / folders have to be restored. + /// + [JsonProperty(PropertyName = "virtualMachineId")] + public string VirtualMachineId { get; set; } + + /// + /// Gets or sets iSCSI initiator name. + /// + [JsonProperty(PropertyName = "initiatorName")] + public string InitiatorName { get; set; } + + /// + /// Gets or sets whether to renew existing registration with the iSCSI + /// server. + /// + [JsonProperty(PropertyName = "renewExistingRegistration")] + public bool? RenewExistingRegistration { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRecoveryPoint.cs new file mode 100644 index 000000000000..6b962001e62d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRecoveryPoint.cs @@ -0,0 +1,183 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IaaS VM workload specific backup copy. + /// + public partial class IaasVMRecoveryPoint : RecoveryPoint + { + /// + /// Initializes a new instance of the IaasVMRecoveryPoint class. + /// + public IaasVMRecoveryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IaasVMRecoveryPoint class. + /// + /// Type of the backup copy. + /// Time at which this backup copy was + /// created. + /// Additional information + /// associated with this backup copy. + /// Storage type of the VM whose + /// backup copy is created. + /// Identifies whether the VM was + /// encrypted when the backup copy is created. + /// Required details for recovering an + /// encrypted VM. Applicable only when IsSourceVMEncrypted is + /// true. + /// Is the session to recover + /// items from this backup copy still active. + /// Recovery point tier + /// information. + /// Whether VM is with Managed + /// Disks + /// Virtual Machine Size + /// Original Storage Account + /// Option + /// OS type + /// Disk + /// configuration + /// Identifies the zone of the VM at the time of + /// backup. Applicable only for zone-pinned Vms + /// Eligibility of RP to + /// be moved to another tier + public IaasVMRecoveryPoint(string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string recoveryPointAdditionalInfo = default(string), string sourceVMStorageType = default(string), bool? isSourceVMEncrypted = default(bool?), KeyAndSecretDetails keyAndSecret = default(KeyAndSecretDetails), bool? isInstantIlrSessionActive = default(bool?), IList recoveryPointTierDetails = default(IList), bool? isManagedVirtualMachine = default(bool?), string virtualMachineSize = default(string), bool? originalStorageAccountOption = default(bool?), string osType = default(string), RecoveryPointDiskConfiguration recoveryPointDiskConfiguration = default(RecoveryPointDiskConfiguration), IList zones = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) + { + RecoveryPointType = recoveryPointType; + RecoveryPointTime = recoveryPointTime; + RecoveryPointAdditionalInfo = recoveryPointAdditionalInfo; + SourceVMStorageType = sourceVMStorageType; + IsSourceVMEncrypted = isSourceVMEncrypted; + KeyAndSecret = keyAndSecret; + IsInstantIlrSessionActive = isInstantIlrSessionActive; + RecoveryPointTierDetails = recoveryPointTierDetails; + IsManagedVirtualMachine = isManagedVirtualMachine; + VirtualMachineSize = virtualMachineSize; + OriginalStorageAccountOption = originalStorageAccountOption; + OsType = osType; + RecoveryPointDiskConfiguration = recoveryPointDiskConfiguration; + Zones = zones; + RecoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of the backup copy. + /// + [JsonProperty(PropertyName = "recoveryPointType")] + public string RecoveryPointType { get; set; } + + /// + /// Gets or sets time at which this backup copy was created. + /// + [JsonProperty(PropertyName = "recoveryPointTime")] + public System.DateTime? RecoveryPointTime { get; set; } + + /// + /// Gets or sets additional information associated with this backup + /// copy. + /// + [JsonProperty(PropertyName = "recoveryPointAdditionalInfo")] + public string RecoveryPointAdditionalInfo { get; set; } + + /// + /// Gets or sets storage type of the VM whose backup copy is created. + /// + [JsonProperty(PropertyName = "sourceVMStorageType")] + public string SourceVMStorageType { get; set; } + + /// + /// Gets or sets identifies whether the VM was encrypted when the + /// backup copy is created. + /// + [JsonProperty(PropertyName = "isSourceVMEncrypted")] + public bool? IsSourceVMEncrypted { get; set; } + + /// + /// Gets or sets required details for recovering an encrypted VM. + /// Applicable only when IsSourceVMEncrypted is true. + /// + [JsonProperty(PropertyName = "keyAndSecret")] + public KeyAndSecretDetails KeyAndSecret { get; set; } + + /// + /// Gets or sets is the session to recover items from this backup copy + /// still active. + /// + [JsonProperty(PropertyName = "isInstantIlrSessionActive")] + public bool? IsInstantIlrSessionActive { get; set; } + + /// + /// Gets or sets recovery point tier information. + /// + [JsonProperty(PropertyName = "recoveryPointTierDetails")] + public IList RecoveryPointTierDetails { get; set; } + + /// + /// Gets or sets whether VM is with Managed Disks + /// + [JsonProperty(PropertyName = "isManagedVirtualMachine")] + public bool? IsManagedVirtualMachine { get; set; } + + /// + /// Gets or sets virtual Machine Size + /// + [JsonProperty(PropertyName = "virtualMachineSize")] + public string VirtualMachineSize { get; set; } + + /// + /// Gets or sets original Storage Account Option + /// + [JsonProperty(PropertyName = "originalStorageAccountOption")] + public bool? OriginalStorageAccountOption { get; set; } + + /// + /// Gets or sets OS type + /// + [JsonProperty(PropertyName = "osType")] + public string OsType { get; set; } + + /// + /// Gets or sets disk configuration + /// + [JsonProperty(PropertyName = "recoveryPointDiskConfiguration")] + public RecoveryPointDiskConfiguration RecoveryPointDiskConfiguration { get; set; } + + /// + /// Gets or sets identifies the zone of the VM at the time of backup. + /// Applicable only for zone-pinned Vms + /// + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; set; } + + /// + /// Gets or sets eligibility of RP to be moved to another tier + /// + [JsonProperty(PropertyName = "recoveryPointMoveReadinessInfo")] + public IDictionary RecoveryPointMoveReadinessInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreRequest.cs new file mode 100644 index 000000000000..7d48a38380b5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreRequest.cs @@ -0,0 +1,267 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IaaS VM workload-specific restore. + /// + public partial class IaasVMRestoreRequest : RestoreRequest + { + /// + /// Initializes a new instance of the IaasVMRestoreRequest class. + /// + public IaasVMRestoreRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IaasVMRestoreRequest class. + /// + /// ID of the backup copy to be + /// recovered. + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM + /// which is being recovered. + /// This is the complete ARM Id of + /// the VM that will be created. + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// This is the ARM Id of the + /// resource group that you want to create for this Virtual machine and + /// other artifacts. + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg} + /// Fully qualified ARM ID of the + /// storage account to which the VM has to be restored. + /// This is the virtual network Id of + /// the vnet that will be attached to the virtual machine. + /// User will be validated for join action permissions in the linked + /// access. + /// Subnet ID, is the subnet ID associated with + /// the to be restored VM. For Classic VMs it would be + /// {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager + /// VMs it would be ARM resource ID used to represent + /// the subnet. + /// Fully qualified ARM ID of the + /// domain name to be associated to the VM being restored. This applies + /// only to Classic + /// Virtual Machines. + /// Region in which the virtual machine is + /// restored. + /// Affinity group associated to VM to be + /// restored. Used only for Classic Compute Virtual Machines. + /// Should a new cloud service be + /// created while restoring the VM. If this is false, VM will be + /// restored to the same + /// cloud service as it was at the time of backup. + /// Original Storage Account + /// Option + /// Details needed if the VM was + /// encrypted at the time of backup. + /// List of Disk LUNs for partial + /// restore + /// Flag to denote of an + /// Unmanaged disk VM should be restored with Managed disks. + /// DiskEncryptionSet's ID - needed + /// if the VM needs to be encrypted at rest during restore with + /// customer managed key. + /// Target zone where the VM and its disks should + /// be restored. + /// Managed Identity information required to + /// access customer storage account. + /// IaaS VM workload specific + /// restore details for restores using managed identity. + public IaasVMRestoreRequest(string recoveryPointId = default(string), string recoveryType = default(string), string sourceResourceId = default(string), string targetVirtualMachineId = default(string), string targetResourceGroupId = default(string), string storageAccountId = default(string), string virtualNetworkId = default(string), string subnetId = default(string), string targetDomainNameId = default(string), string region = default(string), string affinityGroup = default(string), bool? createNewCloudService = default(bool?), bool? originalStorageAccountOption = default(bool?), EncryptionDetails encryptionDetails = default(EncryptionDetails), IList restoreDiskLunList = default(IList), bool? restoreWithManagedDisks = default(bool?), string diskEncryptionSetId = default(string), IList zones = default(IList), IdentityInfo identityInfo = default(IdentityInfo), IdentityBasedRestoreDetails identityBasedRestoreDetails = default(IdentityBasedRestoreDetails)) + { + RecoveryPointId = recoveryPointId; + RecoveryType = recoveryType; + SourceResourceId = sourceResourceId; + TargetVirtualMachineId = targetVirtualMachineId; + TargetResourceGroupId = targetResourceGroupId; + StorageAccountId = storageAccountId; + VirtualNetworkId = virtualNetworkId; + SubnetId = subnetId; + TargetDomainNameId = targetDomainNameId; + Region = region; + AffinityGroup = affinityGroup; + CreateNewCloudService = createNewCloudService; + OriginalStorageAccountOption = originalStorageAccountOption; + EncryptionDetails = encryptionDetails; + RestoreDiskLunList = restoreDiskLunList; + RestoreWithManagedDisks = restoreWithManagedDisks; + DiskEncryptionSetId = diskEncryptionSetId; + Zones = zones; + IdentityInfo = identityInfo; + IdentityBasedRestoreDetails = identityBasedRestoreDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ID of the backup copy to be recovered. + /// + [JsonProperty(PropertyName = "recoveryPointId")] + public string RecoveryPointId { get; set; } + + /// + /// Gets or sets type of this recovery. Possible values include: + /// 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', + /// 'Offline' + /// + [JsonProperty(PropertyName = "recoveryType")] + public string RecoveryType { get; set; } + + /// + /// Gets or sets fully qualified ARM ID of the VM which is being + /// recovered. + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + /// + /// Gets or sets this is the complete ARM Id of the VM that will be + /// created. + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// + [JsonProperty(PropertyName = "targetVirtualMachineId")] + public string TargetVirtualMachineId { get; set; } + + /// + /// Gets or sets this is the ARM Id of the resource group that you want + /// to create for this Virtual machine and other artifacts. + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg} + /// + [JsonProperty(PropertyName = "targetResourceGroupId")] + public string TargetResourceGroupId { get; set; } + + /// + /// Gets or sets fully qualified ARM ID of the storage account to which + /// the VM has to be restored. + /// + [JsonProperty(PropertyName = "storageAccountId")] + public string StorageAccountId { get; set; } + + /// + /// Gets or sets this is the virtual network Id of the vnet that will + /// be attached to the virtual machine. + /// User will be validated for join action permissions in the linked + /// access. + /// + [JsonProperty(PropertyName = "virtualNetworkId")] + public string VirtualNetworkId { get; set; } + + /// + /// Gets or sets subnet ID, is the subnet ID associated with the to be + /// restored VM. For Classic VMs it would be + /// {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager + /// VMs it would be ARM resource ID used to represent + /// the subnet. + /// + [JsonProperty(PropertyName = "subnetId")] + public string SubnetId { get; set; } + + /// + /// Gets or sets fully qualified ARM ID of the domain name to be + /// associated to the VM being restored. This applies only to Classic + /// Virtual Machines. + /// + [JsonProperty(PropertyName = "targetDomainNameId")] + public string TargetDomainNameId { get; set; } + + /// + /// Gets or sets region in which the virtual machine is restored. + /// + [JsonProperty(PropertyName = "region")] + public string Region { get; set; } + + /// + /// Gets or sets affinity group associated to VM to be restored. Used + /// only for Classic Compute Virtual Machines. + /// + [JsonProperty(PropertyName = "affinityGroup")] + public string AffinityGroup { get; set; } + + /// + /// Gets or sets should a new cloud service be created while restoring + /// the VM. If this is false, VM will be restored to the same + /// cloud service as it was at the time of backup. + /// + [JsonProperty(PropertyName = "createNewCloudService")] + public bool? CreateNewCloudService { get; set; } + + /// + /// Gets or sets original Storage Account Option + /// + [JsonProperty(PropertyName = "originalStorageAccountOption")] + public bool? OriginalStorageAccountOption { get; set; } + + /// + /// Gets or sets details needed if the VM was encrypted at the time of + /// backup. + /// + [JsonProperty(PropertyName = "encryptionDetails")] + public EncryptionDetails EncryptionDetails { get; set; } + + /// + /// Gets or sets list of Disk LUNs for partial restore + /// + [JsonProperty(PropertyName = "restoreDiskLunList")] + public IList RestoreDiskLunList { get; set; } + + /// + /// Gets or sets flag to denote of an Unmanaged disk VM should be + /// restored with Managed disks. + /// + [JsonProperty(PropertyName = "restoreWithManagedDisks")] + public bool? RestoreWithManagedDisks { get; set; } + + /// + /// Gets or sets diskEncryptionSet's ID - needed if the VM needs to be + /// encrypted at rest during restore with customer managed key. + /// + [JsonProperty(PropertyName = "diskEncryptionSetId")] + public string DiskEncryptionSetId { get; set; } + + /// + /// Gets or sets target zone where the VM and its disks should be + /// restored. + /// + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; set; } + + /// + /// Gets or sets managed Identity information required to access + /// customer storage account. + /// + [JsonProperty(PropertyName = "identityInfo")] + public IdentityInfo IdentityInfo { get; set; } + + /// + /// Gets or sets iaaS VM workload specific restore details for restores + /// using managed identity. + /// + [JsonProperty(PropertyName = "identityBasedRestoreDetails")] + public IdentityBasedRestoreDetails IdentityBasedRestoreDetails { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs new file mode 100644 index 000000000000..4e800af6e7ba --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IaaS VM workload-specific restore with integrated rehydration of + /// recovery point. + /// + public partial class IaasVMRestoreWithRehydrationRequest : IaasVMRestoreRequest + { + /// + /// Initializes a new instance of the + /// IaasVMRestoreWithRehydrationRequest class. + /// + public IaasVMRestoreWithRehydrationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IaasVMRestoreWithRehydrationRequest class. + /// + /// ID of the backup copy to be + /// recovered. + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM + /// which is being recovered. + /// This is the complete ARM Id of + /// the VM that will be created. + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// This is the ARM Id of the + /// resource group that you want to create for this Virtual machine and + /// other artifacts. + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg} + /// Fully qualified ARM ID of the + /// storage account to which the VM has to be restored. + /// This is the virtual network Id of + /// the vnet that will be attached to the virtual machine. + /// User will be validated for join action permissions in the linked + /// access. + /// Subnet ID, is the subnet ID associated with + /// the to be restored VM. For Classic VMs it would be + /// {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager + /// VMs it would be ARM resource ID used to represent + /// the subnet. + /// Fully qualified ARM ID of the + /// domain name to be associated to the VM being restored. This applies + /// only to Classic + /// Virtual Machines. + /// Region in which the virtual machine is + /// restored. + /// Affinity group associated to VM to be + /// restored. Used only for Classic Compute Virtual Machines. + /// Should a new cloud service be + /// created while restoring the VM. If this is false, VM will be + /// restored to the same + /// cloud service as it was at the time of backup. + /// Original Storage Account + /// Option + /// Details needed if the VM was + /// encrypted at the time of backup. + /// List of Disk LUNs for partial + /// restore + /// Flag to denote of an + /// Unmanaged disk VM should be restored with Managed disks. + /// DiskEncryptionSet's ID - needed + /// if the VM needs to be encrypted at rest during restore with + /// customer managed key. + /// Target zone where the VM and its disks should + /// be restored. + /// Managed Identity information required to + /// access customer storage account. + /// IaaS VM workload specific + /// restore details for restores using managed identity. + /// RP Rehydration + /// Info + public IaasVMRestoreWithRehydrationRequest(string recoveryPointId = default(string), string recoveryType = default(string), string sourceResourceId = default(string), string targetVirtualMachineId = default(string), string targetResourceGroupId = default(string), string storageAccountId = default(string), string virtualNetworkId = default(string), string subnetId = default(string), string targetDomainNameId = default(string), string region = default(string), string affinityGroup = default(string), bool? createNewCloudService = default(bool?), bool? originalStorageAccountOption = default(bool?), EncryptionDetails encryptionDetails = default(EncryptionDetails), IList restoreDiskLunList = default(IList), bool? restoreWithManagedDisks = default(bool?), string diskEncryptionSetId = default(string), IList zones = default(IList), IdentityInfo identityInfo = default(IdentityInfo), IdentityBasedRestoreDetails identityBasedRestoreDetails = default(IdentityBasedRestoreDetails), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryPointId, recoveryType, sourceResourceId, targetVirtualMachineId, targetResourceGroupId, storageAccountId, virtualNetworkId, subnetId, targetDomainNameId, region, affinityGroup, createNewCloudService, originalStorageAccountOption, encryptionDetails, restoreDiskLunList, restoreWithManagedDisks, diskEncryptionSetId, zones, identityInfo, identityBasedRestoreDetails) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityBasedRestoreDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityBasedRestoreDetails.cs new file mode 100644 index 000000000000..c3bd66edb52a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityBasedRestoreDetails.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// IaaS VM workload specific restore details for restores using managed + /// identity + /// + public partial class IdentityBasedRestoreDetails + { + /// + /// Initializes a new instance of the IdentityBasedRestoreDetails + /// class. + /// + public IdentityBasedRestoreDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IdentityBasedRestoreDetails + /// class. + /// + /// Gets the class type. + /// Fully qualified ARM ID of the + /// target storage account. + public IdentityBasedRestoreDetails(string objectType = default(string), string targetStorageAccountId = default(string)) + { + ObjectType = objectType; + TargetStorageAccountId = targetStorageAccountId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the class type. + /// + [JsonProperty(PropertyName = "objectType")] + public string ObjectType { get; set; } + + /// + /// Gets or sets fully qualified ARM ID of the target storage account. + /// + [JsonProperty(PropertyName = "targetStorageAccountId")] + public string TargetStorageAccountId { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityInfo.cs new file mode 100644 index 000000000000..2f1f2cbaee44 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityInfo.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Encapsulates Managed Identity related information + /// + public partial class IdentityInfo + { + /// + /// Initializes a new instance of the IdentityInfo class. + /// + public IdentityInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IdentityInfo class. + /// + /// To differentiate if the + /// managed identity is system assigned or user assigned + /// Managed Identity Resource + /// Id + /// Optional: Might not be required in the case of system assigned + /// managed identity + public IdentityInfo(bool? isSystemAssignedIdentity = default(bool?), string managedIdentityResourceId = default(string)) + { + IsSystemAssignedIdentity = isSystemAssignedIdentity; + ManagedIdentityResourceId = managedIdentityResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets to differentiate if the managed identity is system + /// assigned or user assigned + /// + [JsonProperty(PropertyName = "isSystemAssignedIdentity")] + public bool? IsSystemAssignedIdentity { get; set; } + + /// + /// Gets or sets managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned + /// managed identity + /// + [JsonProperty(PropertyName = "managedIdentityResourceId")] + public string ManagedIdentityResourceId { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InfrastructureEncryptionState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InfrastructureEncryptionState.cs new file mode 100644 index 000000000000..c065ffe67036 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InfrastructureEncryptionState.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for InfrastructureEncryptionState. + /// + public static class InfrastructureEncryptionState + { + public const string Invalid = "Invalid"; + public const string Disabled = "Disabled"; + public const string Enabled = "Enabled"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryInfo.cs new file mode 100644 index 000000000000..e97a60e855aa --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryInfo.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Details about inquired protectable items under a given container. + /// + public partial class InquiryInfo + { + /// + /// Initializes a new instance of the InquiryInfo class. + /// + public InquiryInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InquiryInfo class. + /// + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// Error Details if the Status is + /// non-success. + /// Inquiry Details which will have + /// workload specific details. + /// For e.g. - For SQL and oracle this will contain different + /// details. + public InquiryInfo(string status = default(string), ErrorDetail errorDetail = default(ErrorDetail), IList inquiryDetails = default(IList)) + { + Status = status; + ErrorDetail = errorDetail; + InquiryDetails = inquiryDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets inquiry Status for this container such as + /// InProgress | Failed | Succeeded + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets error Details if the Status is non-success. + /// + [JsonProperty(PropertyName = "errorDetail")] + public ErrorDetail ErrorDetail { get; set; } + + /// + /// Gets or sets inquiry Details which will have workload specific + /// details. + /// For e.g. - For SQL and oracle this will contain different details. + /// + [JsonProperty(PropertyName = "inquiryDetails")] + public IList InquiryDetails { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryStatus.cs new file mode 100644 index 000000000000..92b3e89bf0e2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryStatus.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for InquiryStatus. + /// + public static class InquiryStatus + { + public const string Invalid = "Invalid"; + public const string Success = "Success"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryValidation.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryValidation.cs new file mode 100644 index 000000000000..c91faf5c1cb2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InquiryValidation.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Validation for inquired protectable items under a given container. + /// + public partial class InquiryValidation + { + /// + /// Initializes a new instance of the InquiryValidation class. + /// + public InquiryValidation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InquiryValidation class. + /// + /// Status for the Inquiry Validation. + /// Error Detail in case the status is + /// non-success. + /// Error Additional Detail in case the + /// status is non-success. + public InquiryValidation(string status = default(string), ErrorDetail errorDetail = default(ErrorDetail), string additionalDetail = default(string)) + { + Status = status; + ErrorDetail = errorDetail; + AdditionalDetail = additionalDetail; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status for the Inquiry Validation. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets error Detail in case the status is non-success. + /// + [JsonProperty(PropertyName = "errorDetail")] + public ErrorDetail ErrorDetail { get; set; } + + /// + /// Gets error Additional Detail in case the status is non-success. + /// + [JsonProperty(PropertyName = "additionalDetail")] + public string AdditionalDetail { get; private set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InstantItemRecoveryTarget.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InstantItemRecoveryTarget.cs new file mode 100644 index 000000000000..b2ecc356b94a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InstantItemRecoveryTarget.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Target details for file / folder restore. + /// + public partial class InstantItemRecoveryTarget + { + /// + /// Initializes a new instance of the InstantItemRecoveryTarget class. + /// + public InstantItemRecoveryTarget() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstantItemRecoveryTarget class. + /// + /// List of client scripts. + public InstantItemRecoveryTarget(IList clientScripts = default(IList)) + { + ClientScripts = clientScripts; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of client scripts. + /// + [JsonProperty(PropertyName = "clientScripts")] + public IList ClientScripts { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InstantRPAdditionalDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InstantRPAdditionalDetails.cs new file mode 100644 index 000000000000..93a402838646 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/InstantRPAdditionalDetails.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class InstantRPAdditionalDetails + { + /// + /// Initializes a new instance of the InstantRPAdditionalDetails class. + /// + public InstantRPAdditionalDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstantRPAdditionalDetails class. + /// + public InstantRPAdditionalDetails(string azureBackupRGNamePrefix = default(string), string azureBackupRGNameSuffix = default(string)) + { + AzureBackupRGNamePrefix = azureBackupRGNamePrefix; + AzureBackupRGNameSuffix = azureBackupRGNameSuffix; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "azureBackupRGNamePrefix")] + public string AzureBackupRGNamePrefix { get; set; } + + /// + /// + [JsonProperty(PropertyName = "azureBackupRGNameSuffix")] + public string AzureBackupRGNameSuffix { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IntentItemType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IntentItemType.cs new file mode 100644 index 000000000000..9335e1f19ef5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IntentItemType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for IntentItemType. + /// + public static class IntentItemType + { + public const string Invalid = "Invalid"; + public const string SQLInstance = "SQLInstance"; + public const string SQLAvailabilityGroupContainer = "SQLAvailabilityGroupContainer"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Job.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Job.cs new file mode 100644 index 000000000000..3cf708fd29ad --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Job.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines workload agnostic properties for a job. + /// + public partial class Job + { + /// + /// Initializes a new instance of the Job class. + /// + public Job() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Job class. + /// + /// Friendly name of the entity on + /// which the current job is executing. + /// Backup management type to + /// execute the current job. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// The operation name. + /// Job status. + /// The start time. + /// The end time. + /// ActivityId of job. + public Job(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string)) + { + EntityFriendlyName = entityFriendlyName; + BackupManagementType = backupManagementType; + Operation = operation; + Status = status; + StartTime = startTime; + EndTime = endTime; + ActivityId = activityId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the entity on which the current job + /// is executing. + /// + [JsonProperty(PropertyName = "entityFriendlyName")] + public string EntityFriendlyName { get; set; } + + /// + /// Gets or sets backup management type to execute the current job. + /// Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets the operation name. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets job status. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the start time. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the end time. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets activityId of job. + /// + [JsonProperty(PropertyName = "activityId")] + public string ActivityId { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobOperationType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobOperationType.cs new file mode 100644 index 000000000000..cb0a15cc5ee0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobOperationType.cs @@ -0,0 +1,31 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for JobOperationType. + /// + public static class JobOperationType + { + public const string Invalid = "Invalid"; + public const string Register = "Register"; + public const string UnRegister = "UnRegister"; + public const string ConfigureBackup = "ConfigureBackup"; + public const string Backup = "Backup"; + public const string Restore = "Restore"; + public const string DisableBackup = "DisableBackup"; + public const string DeleteBackupData = "DeleteBackupData"; + public const string CrossRegionRestore = "CrossRegionRestore"; + public const string Undelete = "Undelete"; + public const string UpdateCustomerManagedKey = "UpdateCustomerManagedKey"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobQueryObject.cs new file mode 100644 index 000000000000..e37e367742dd --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobQueryObject.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Filters to list the jobs. + /// + public partial class JobQueryObject + { + /// + /// Initializes a new instance of the JobQueryObject class. + /// + public JobQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JobQueryObject class. + /// + /// Status of the job. Possible values include: + /// 'Invalid', 'InProgress', 'Completed', 'Failed', + /// 'CompletedWithWarnings', 'Cancelled', 'Cancelling' + /// Type of backup management for + /// the job. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', + /// 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Type of operation. Possible values include: + /// 'Invalid', 'Register', 'UnRegister', 'ConfigureBackup', 'Backup', + /// 'Restore', 'DisableBackup', 'DeleteBackupData', + /// 'CrossRegionRestore', 'Undelete', + /// 'UpdateCustomerManagedKey' + /// JobID represents the job uniquely. + /// Job has started at this time. Value is in + /// UTC. + /// Job has ended at this time. Value is in + /// UTC. + public JobQueryObject(string status = default(string), string backupManagementType = default(string), string operation = default(string), string jobId = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?)) + { + Status = status; + BackupManagementType = backupManagementType; + Operation = operation; + JobId = jobId; + StartTime = startTime; + EndTime = endTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of the job. Possible values include: 'Invalid', + /// 'InProgress', 'Completed', 'Failed', 'CompletedWithWarnings', + /// 'Cancelled', 'Cancelling' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets type of backup management for the job. Possible values + /// include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets type of operation. Possible values include: 'Invalid', + /// 'Register', 'UnRegister', 'ConfigureBackup', 'Backup', 'Restore', + /// 'DisableBackup', 'DeleteBackupData', 'CrossRegionRestore', + /// 'Undelete', 'UpdateCustomerManagedKey' + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets jobID represents the job uniquely. + /// + [JsonProperty(PropertyName = "jobId")] + public string JobId { get; set; } + + /// + /// Gets or sets job has started at this time. Value is in UTC. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets job has ended at this time. Value is in UTC. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobResource.cs new file mode 100644 index 000000000000..bb3dbe233758 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobResource.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines workload agnostic properties for a job. + /// + public partial class JobResource : Resource + { + /// + /// Initializes a new instance of the JobResource class. + /// + public JobResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JobResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// JobResource properties + public JobResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), Job properties = default(Job)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets jobResource properties + /// + [JsonProperty(PropertyName = "properties")] + public Job Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobStatus.cs new file mode 100644 index 000000000000..c949477860ee --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobStatus.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for JobStatus. + /// + public static class JobStatus + { + public const string Invalid = "Invalid"; + public const string InProgress = "InProgress"; + public const string Completed = "Completed"; + public const string Failed = "Failed"; + public const string CompletedWithWarnings = "CompletedWithWarnings"; + public const string Cancelled = "Cancelled"; + public const string Cancelling = "Cancelling"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobSupportedAction.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobSupportedAction.cs new file mode 100644 index 000000000000..de0a683deb51 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/JobSupportedAction.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for JobSupportedAction. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum JobSupportedAction + { + [EnumMember(Value = "Invalid")] + Invalid, + [EnumMember(Value = "Cancellable")] + Cancellable, + [EnumMember(Value = "Retriable")] + Retriable + } + internal static class JobSupportedActionEnumExtension + { + internal static string ToSerializedValue(this JobSupportedAction? value) + { + return value == null ? null : ((JobSupportedAction)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this JobSupportedAction value) + { + switch( value ) + { + case JobSupportedAction.Invalid: + return "Invalid"; + case JobSupportedAction.Cancellable: + return "Cancellable"; + case JobSupportedAction.Retriable: + return "Retriable"; + } + return null; + } + + internal static JobSupportedAction? ParseJobSupportedAction(this string value) + { + switch( value ) + { + case "Invalid": + return JobSupportedAction.Invalid; + case "Cancellable": + return JobSupportedAction.Cancellable; + case "Retriable": + return JobSupportedAction.Retriable; + } + return null; + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KEKDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KEKDetails.cs new file mode 100644 index 000000000000..cc08fd77e669 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KEKDetails.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// KEK is encryption key for BEK. + /// + public partial class KEKDetails + { + /// + /// Initializes a new instance of the KEKDetails class. + /// + public KEKDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KEKDetails class. + /// + /// Key is KEK. + /// Key Vault ID where this Key is + /// stored. + /// KEK data. + public KEKDetails(string keyUrl = default(string), string keyVaultId = default(string), string keyBackupData = default(string)) + { + KeyUrl = keyUrl; + KeyVaultId = keyVaultId; + KeyBackupData = keyBackupData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key is KEK. + /// + [JsonProperty(PropertyName = "keyUrl")] + public string KeyUrl { get; set; } + + /// + /// Gets or sets key Vault ID where this Key is stored. + /// + [JsonProperty(PropertyName = "keyVaultId")] + public string KeyVaultId { get; set; } + + /// + /// Gets or sets KEK data. + /// + [JsonProperty(PropertyName = "keyBackupData")] + public string KeyBackupData { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KPIResourceHealthDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KPIResourceHealthDetails.cs new file mode 100644 index 000000000000..1079e3535ff4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KPIResourceHealthDetails.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// KPI Resource Health Details + /// + public partial class KPIResourceHealthDetails + { + /// + /// Initializes a new instance of the KPIResourceHealthDetails class. + /// + public KPIResourceHealthDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KPIResourceHealthDetails class. + /// + /// Resource Health Status. Possible + /// values include: 'Healthy', 'TransientDegraded', + /// 'PersistentDegraded', 'TransientUnhealthy', 'PersistentUnhealthy', + /// 'Invalid' + /// Resource Health Status + public KPIResourceHealthDetails(string resourceHealthStatus = default(string), IList resourceHealthDetails = default(IList)) + { + ResourceHealthStatus = resourceHealthStatus; + ResourceHealthDetails = resourceHealthDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource Health Status. Possible values include: + /// 'Healthy', 'TransientDegraded', 'PersistentDegraded', + /// 'TransientUnhealthy', 'PersistentUnhealthy', 'Invalid' + /// + [JsonProperty(PropertyName = "resourceHealthStatus")] + public string ResourceHealthStatus { get; set; } + + /// + /// Gets or sets resource Health Status + /// + [JsonProperty(PropertyName = "resourceHealthDetails")] + public IList ResourceHealthDetails { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KeyAndSecretDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KeyAndSecretDetails.cs new file mode 100644 index 000000000000..ac25ed561c1c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/KeyAndSecretDetails.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// BEK is bitlocker key. + /// KEK is encryption key for BEK + /// If the VM was encrypted then we will store following details : + /// 1. Secret(BEK) - Url + Backup Data + vaultId. + /// 2. Key(KEK) - Url + Backup Data + vaultId. + /// 3. EncryptionMechanism + /// BEK and KEK can potentially have different vault ids. + /// + public partial class KeyAndSecretDetails + { + /// + /// Initializes a new instance of the KeyAndSecretDetails class. + /// + public KeyAndSecretDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyAndSecretDetails class. + /// + /// KEK is encryption key for BEK. + /// BEK is bitlocker encryption key. + /// Encryption mechanism: None/ + /// SinglePass/ DoublePass + public KeyAndSecretDetails(KEKDetails kekDetails = default(KEKDetails), BEKDetails bekDetails = default(BEKDetails), string encryptionMechanism = default(string)) + { + KekDetails = kekDetails; + BekDetails = bekDetails; + EncryptionMechanism = encryptionMechanism; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets KEK is encryption key for BEK. + /// + [JsonProperty(PropertyName = "kekDetails")] + public KEKDetails KekDetails { get; set; } + + /// + /// Gets or sets BEK is bitlocker encryption key. + /// + [JsonProperty(PropertyName = "bekDetails")] + public BEKDetails BekDetails { get; set; } + + /// + /// Gets or sets encryption mechanism: None/ SinglePass/ DoublePass + /// + [JsonProperty(PropertyName = "encryptionMechanism")] + public string EncryptionMechanism { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LastBackupStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LastBackupStatus.cs new file mode 100644 index 000000000000..439465987978 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LastBackupStatus.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for LastBackupStatus. + /// + public static class LastBackupStatus + { + public const string Invalid = "Invalid"; + public const string Healthy = "Healthy"; + public const string Unhealthy = "Unhealthy"; + public const string IRPending = "IRPending"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LastUpdateStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LastUpdateStatus.cs new file mode 100644 index 000000000000..76a19234bd73 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LastUpdateStatus.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for LastUpdateStatus. + /// + public static class LastUpdateStatus + { + public const string Invalid = "Invalid"; + public const string NotEnabled = "NotEnabled"; + public const string PartiallySucceeded = "PartiallySucceeded"; + public const string PartiallyFailed = "PartiallyFailed"; + public const string Failed = "Failed"; + public const string Succeeded = "Succeeded"; + public const string Initialized = "Initialized"; + public const string FirstInitialization = "FirstInitialization"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ListRecoveryPointsRecommendedForMoveRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ListRecoveryPointsRecommendedForMoveRequest.cs new file mode 100644 index 000000000000..b6b295f0e4a2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ListRecoveryPointsRecommendedForMoveRequest.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ListRecoveryPointsRecommendedForMoveRequest Request + /// + public partial class ListRecoveryPointsRecommendedForMoveRequest + { + /// + /// Initializes a new instance of the + /// ListRecoveryPointsRecommendedForMoveRequest class. + /// + public ListRecoveryPointsRecommendedForMoveRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ListRecoveryPointsRecommendedForMoveRequest class. + /// + /// Gets the class type. + /// List of Recovery Points excluded from + /// Move + public ListRecoveryPointsRecommendedForMoveRequest(string objectType = default(string), IList excludedRPList = default(IList)) + { + ObjectType = objectType; + ExcludedRPList = excludedRPList; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the class type. + /// + [JsonProperty(PropertyName = "objectType")] + public string ObjectType { get; set; } + + /// + /// Gets or sets list of Recovery Points excluded from Move + /// + [JsonProperty(PropertyName = "excludedRPList")] + public IList ExcludedRPList { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LogSchedulePolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LogSchedulePolicy.cs new file mode 100644 index 000000000000..cf5ac07f31fe --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LogSchedulePolicy.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Log policy schedule. + /// + public partial class LogSchedulePolicy : SchedulePolicy + { + /// + /// Initializes a new instance of the LogSchedulePolicy class. + /// + public LogSchedulePolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LogSchedulePolicy class. + /// + /// Frequency of the log schedule + /// operation of this policy in minutes. + public LogSchedulePolicy(int? scheduleFrequencyInMins = default(int?)) + { + ScheduleFrequencyInMins = scheduleFrequencyInMins; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets frequency of the log schedule operation of this policy + /// in minutes. + /// + [JsonProperty(PropertyName = "scheduleFrequencyInMins")] + public int? ScheduleFrequencyInMins { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LongTermRetentionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LongTermRetentionPolicy.cs new file mode 100644 index 000000000000..fabc44d53521 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LongTermRetentionPolicy.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Long term retention policy. + /// + public partial class LongTermRetentionPolicy : RetentionPolicy + { + /// + /// Initializes a new instance of the LongTermRetentionPolicy class. + /// + public LongTermRetentionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LongTermRetentionPolicy class. + /// + /// Daily retention schedule of the + /// protection policy. + /// Weekly retention schedule of the + /// protection policy. + /// Monthly retention schedule of the + /// protection policy. + /// Yearly retention schedule of the + /// protection policy. + public LongTermRetentionPolicy(DailyRetentionSchedule dailySchedule = default(DailyRetentionSchedule), WeeklyRetentionSchedule weeklySchedule = default(WeeklyRetentionSchedule), MonthlyRetentionSchedule monthlySchedule = default(MonthlyRetentionSchedule), YearlyRetentionSchedule yearlySchedule = default(YearlyRetentionSchedule)) + { + DailySchedule = dailySchedule; + WeeklySchedule = weeklySchedule; + MonthlySchedule = monthlySchedule; + YearlySchedule = yearlySchedule; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets daily retention schedule of the protection policy. + /// + [JsonProperty(PropertyName = "dailySchedule")] + public DailyRetentionSchedule DailySchedule { get; set; } + + /// + /// Gets or sets weekly retention schedule of the protection policy. + /// + [JsonProperty(PropertyName = "weeklySchedule")] + public WeeklyRetentionSchedule WeeklySchedule { get; set; } + + /// + /// Gets or sets monthly retention schedule of the protection policy. + /// + [JsonProperty(PropertyName = "monthlySchedule")] + public MonthlyRetentionSchedule MonthlySchedule { get; set; } + + /// + /// Gets or sets yearly retention schedule of the protection policy. + /// + [JsonProperty(PropertyName = "yearlySchedule")] + public YearlyRetentionSchedule YearlySchedule { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LongTermSchedulePolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LongTermSchedulePolicy.cs new file mode 100644 index 000000000000..23c569db3e18 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/LongTermSchedulePolicy.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Long term policy schedule. + /// + public partial class LongTermSchedulePolicy : SchedulePolicy + { + /// + /// Initializes a new instance of the LongTermSchedulePolicy class. + /// + public LongTermSchedulePolicy() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MABContainerHealthDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MABContainerHealthDetails.cs new file mode 100644 index 000000000000..d76e5f8e6619 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MABContainerHealthDetails.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// MAB workload-specific Health Details. + /// + public partial class MABContainerHealthDetails + { + /// + /// Initializes a new instance of the MABContainerHealthDetails class. + /// + public MABContainerHealthDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MABContainerHealthDetails class. + /// + /// Health Code + /// Health Title + /// Health Message + /// Health Recommended Actions + public MABContainerHealthDetails(int? code = default(int?), string title = default(string), string message = default(string), IList recommendations = default(IList)) + { + Code = code; + Title = title; + Message = message; + Recommendations = recommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets health Code + /// + [JsonProperty(PropertyName = "code")] + public int? Code { get; set; } + + /// + /// Gets or sets health Title + /// + [JsonProperty(PropertyName = "title")] + public string Title { get; set; } + + /// + /// Gets or sets health Message + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets health Recommended Actions + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainer.cs new file mode 100644 index 000000000000..c530394579cb --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainer.cs @@ -0,0 +1,120 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Container with items backed up using MAB backup engine. + /// + [Newtonsoft.Json.JsonObject("Windows")] + public partial class MabContainer : ProtectionContainer + { + /// + /// Initializes a new instance of the MabContainer class. + /// + public MabContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MabContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + /// Can the container be registered one + /// more time. + /// ContainerID represents the + /// container. + /// Number of items backed up in this + /// container. + /// Agent version of this container. + /// Additional information for this + /// container + /// Health details on this mab + /// container. + /// Health state of mab + /// container. + public MabContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), bool? canReRegister = default(bool?), long? containerId = default(long?), long? protectedItemCount = default(long?), string agentVersion = default(string), MabContainerExtendedInfo extendedInfo = default(MabContainerExtendedInfo), IList mabContainerHealthDetails = default(IList), string containerHealthState = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + { + CanReRegister = canReRegister; + ContainerId = containerId; + ProtectedItemCount = protectedItemCount; + AgentVersion = agentVersion; + ExtendedInfo = extendedInfo; + MabContainerHealthDetails = mabContainerHealthDetails; + ContainerHealthState = containerHealthState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets can the container be registered one more time. + /// + [JsonProperty(PropertyName = "canReRegister")] + public bool? CanReRegister { get; set; } + + /// + /// Gets or sets containerID represents the container. + /// + [JsonProperty(PropertyName = "containerId")] + public long? ContainerId { get; set; } + + /// + /// Gets or sets number of items backed up in this container. + /// + [JsonProperty(PropertyName = "protectedItemCount")] + public long? ProtectedItemCount { get; set; } + + /// + /// Gets or sets agent version of this container. + /// + [JsonProperty(PropertyName = "agentVersion")] + public string AgentVersion { get; set; } + + /// + /// Gets or sets additional information for this container + /// + [JsonProperty(PropertyName = "extendedInfo")] + public MabContainerExtendedInfo ExtendedInfo { get; set; } + + /// + /// Gets or sets health details on this mab container. + /// + [JsonProperty(PropertyName = "mabContainerHealthDetails")] + public IList MabContainerHealthDetails { get; set; } + + /// + /// Gets or sets health state of mab container. + /// + [JsonProperty(PropertyName = "containerHealthState")] + public string ContainerHealthState { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainerExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainerExtendedInfo.cs new file mode 100644 index 000000000000..72b3f3a066d7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainerExtendedInfo.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Additional information of the container. + /// + public partial class MabContainerExtendedInfo + { + /// + /// Initializes a new instance of the MabContainerExtendedInfo class. + /// + public MabContainerExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MabContainerExtendedInfo class. + /// + /// Time stamp when this container was + /// refreshed. + /// Type of backup items associated with + /// this container. Possible values include: 'Invalid', 'VM', + /// 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', + /// 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', + /// 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', + /// 'SAPAseDatabase' + /// List of backup items associated with this + /// container. + /// Backup policy associated with this + /// container. + /// Latest backup status of this + /// container. + public MabContainerExtendedInfo(System.DateTime? lastRefreshedAt = default(System.DateTime?), string backupItemType = default(string), IList backupItems = default(IList), string policyName = default(string), string lastBackupStatus = default(string)) + { + LastRefreshedAt = lastRefreshedAt; + BackupItemType = backupItemType; + BackupItems = backupItems; + PolicyName = policyName; + LastBackupStatus = lastBackupStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets time stamp when this container was refreshed. + /// + [JsonProperty(PropertyName = "lastRefreshedAt")] + public System.DateTime? LastRefreshedAt { get; set; } + + /// + /// Gets or sets type of backup items associated with this container. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "backupItemType")] + public string BackupItemType { get; set; } + + /// + /// Gets or sets list of backup items associated with this container. + /// + [JsonProperty(PropertyName = "backupItems")] + public IList BackupItems { get; set; } + + /// + /// Gets or sets backup policy associated with this container. + /// + [JsonProperty(PropertyName = "policyName")] + public string PolicyName { get; set; } + + /// + /// Gets or sets latest backup status of this container. + /// + [JsonProperty(PropertyName = "lastBackupStatus")] + public string LastBackupStatus { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabErrorInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabErrorInfo.cs new file mode 100644 index 000000000000..7f902f825534 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabErrorInfo.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// MAB workload-specific error information. + /// + public partial class MabErrorInfo + { + /// + /// Initializes a new instance of the MabErrorInfo class. + /// + public MabErrorInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MabErrorInfo class. + /// + /// Localized error string. + /// List of localized + /// recommendations. + public MabErrorInfo(string errorString = default(string), IList recommendations = default(IList)) + { + ErrorString = errorString; + Recommendations = recommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets localized error string. + /// + [JsonProperty(PropertyName = "errorString")] + public string ErrorString { get; private set; } + + /// + /// Gets list of localized recommendations. + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; private set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs new file mode 100644 index 000000000000..e4a7acb9c5ff --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs @@ -0,0 +1,149 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// MAB workload-specific backup item. + /// + public partial class MabFileFolderProtectedItem : ProtectedItem + { + /// + /// Initializes a new instance of the MabFileFolderProtectedItem class. + /// + public MabFileFolderProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MabFileFolderProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + /// Friendly name of this backup + /// item. + /// Name of the computer associated with + /// this backup item. + /// Status of last backup + /// operation. + /// Timestamp of the last backup operation + /// on this backup item. + /// Protected, ProtectionStopped, + /// IRPending or ProtectionError + /// Sync time for deferred + /// deletion in UTC + /// Additional information with this backup + /// item. + public MabFileFolderProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string computerName = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectionState = default(string), long? deferredDeleteSyncTimeInUTC = default(long?), MabFileFolderProtectedItemExtendedInfo extendedInfo = default(MabFileFolderProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) + { + FriendlyName = friendlyName; + ComputerName = computerName; + LastBackupStatus = lastBackupStatus; + LastBackupTime = lastBackupTime; + ProtectionState = protectionState; + DeferredDeleteSyncTimeInUTC = deferredDeleteSyncTimeInUTC; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of this backup item. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets name of the computer associated with this backup item. + /// + [JsonProperty(PropertyName = "computerName")] + public string ComputerName { get; set; } + + /// + /// Gets or sets status of last backup operation. + /// + [JsonProperty(PropertyName = "lastBackupStatus")] + public string LastBackupStatus { get; set; } + + /// + /// Gets or sets timestamp of the last backup operation on this backup + /// item. + /// + [JsonProperty(PropertyName = "lastBackupTime")] + public System.DateTime? LastBackupTime { get; set; } + + /// + /// Gets or sets protected, ProtectionStopped, IRPending or + /// ProtectionError + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + /// + /// Gets or sets sync time for deferred deletion in UTC + /// + [JsonProperty(PropertyName = "deferredDeleteSyncTimeInUTC")] + public long? DeferredDeleteSyncTimeInUTC { get; set; } + + /// + /// Gets or sets additional information with this backup item. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public MabFileFolderProtectedItemExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItemExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItemExtendedInfo.cs new file mode 100644 index 000000000000..7f40669f47e5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItemExtendedInfo.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional information on the backed up item. + /// + public partial class MabFileFolderProtectedItemExtendedInfo + { + /// + /// Initializes a new instance of the + /// MabFileFolderProtectedItemExtendedInfo class. + /// + public MabFileFolderProtectedItemExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MabFileFolderProtectedItemExtendedInfo class. + /// + /// Last time when the agent data synced + /// to service. + /// The oldest backup copy + /// available. + /// Number of backup copies associated + /// with the backup item. + public MabFileFolderProtectedItemExtendedInfo(System.DateTime? lastRefreshedAt = default(System.DateTime?), System.DateTime? oldestRecoveryPoint = default(System.DateTime?), int? recoveryPointCount = default(int?)) + { + LastRefreshedAt = lastRefreshedAt; + OldestRecoveryPoint = oldestRecoveryPoint; + RecoveryPointCount = recoveryPointCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets last time when the agent data synced to service. + /// + [JsonProperty(PropertyName = "lastRefreshedAt")] + public System.DateTime? LastRefreshedAt { get; set; } + + /// + /// Gets or sets the oldest backup copy available. + /// + [JsonProperty(PropertyName = "oldestRecoveryPoint")] + public System.DateTime? OldestRecoveryPoint { get; set; } + + /// + /// Gets or sets number of backup copies associated with the backup + /// item. + /// + [JsonProperty(PropertyName = "recoveryPointCount")] + public int? RecoveryPointCount { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJob.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJob.cs new file mode 100644 index 000000000000..d4256be83cff --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJob.cs @@ -0,0 +1,136 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// MAB workload-specific job. + /// + public partial class MabJob : Job + { + /// + /// Initializes a new instance of the MabJob class. + /// + public MabJob() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MabJob class. + /// + /// Friendly name of the entity on + /// which the current job is executing. + /// Backup management type to + /// execute the current job. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// The operation name. + /// Job status. + /// The start time. + /// The end time. + /// ActivityId of job. + /// Time taken by job to run. + /// The state/actions applicable on jobs like + /// cancel/retry. + /// Name of server protecting the + /// DS. + /// Server type of MAB container. Possible + /// values include: 'Invalid', 'Unknown', 'IaasVMContainer', + /// 'IaasVMServiceContainer', 'DPMContainer', + /// 'AzureBackupServerContainer', 'MABContainer', 'Cluster', + /// 'AzureSqlContainer', 'Windows', 'VCenter', 'VMAppContainer', + /// 'SQLAGWorkLoadContainer', 'StorageContainer', + /// 'GenericContainer' + /// Workload type of backup item. Possible + /// values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', + /// 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', + /// 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// The errors. + /// Additional information on the + /// job. + public MabJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList actionsInfo = default(IList), string mabServerName = default(string), string mabServerType = default(string), string workloadType = default(string), IList errorDetails = default(IList), MabJobExtendedInfo extendedInfo = default(MabJobExtendedInfo)) + : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) + { + Duration = duration; + ActionsInfo = actionsInfo; + MabServerName = mabServerName; + MabServerType = mabServerType; + WorkloadType = workloadType; + ErrorDetails = errorDetails; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets time taken by job to run. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets the state/actions applicable on jobs like + /// cancel/retry. + /// + [JsonProperty(PropertyName = "actionsInfo")] + public IList ActionsInfo { get; set; } + + /// + /// Gets or sets name of server protecting the DS. + /// + [JsonProperty(PropertyName = "mabServerName")] + public string MabServerName { get; set; } + + /// + /// Gets or sets server type of MAB container. Possible values include: + /// 'Invalid', 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', + /// 'DPMContainer', 'AzureBackupServerContainer', 'MABContainer', + /// 'Cluster', 'AzureSqlContainer', 'Windows', 'VCenter', + /// 'VMAppContainer', 'SQLAGWorkLoadContainer', 'StorageContainer', + /// 'GenericContainer' + /// + [JsonProperty(PropertyName = "mabServerType")] + public string MabServerType { get; set; } + + /// + /// Gets or sets workload type of backup item. Possible values include: + /// 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + /// 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + /// 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + /// + /// Gets or sets the errors. + /// + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; set; } + + /// + /// Gets or sets additional information on the job. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public MabJobExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJobExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJobExtendedInfo.cs new file mode 100644 index 000000000000..936495b24a74 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJobExtendedInfo.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Additional information for the MAB workload-specific job. + /// + public partial class MabJobExtendedInfo + { + /// + /// Initializes a new instance of the MabJobExtendedInfo class. + /// + public MabJobExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MabJobExtendedInfo class. + /// + /// List of tasks for this job. + /// The job properties. + /// Non localized error message + /// specific to this job. + public MabJobExtendedInfo(IList tasksList = default(IList), IDictionary propertyBag = default(IDictionary), string dynamicErrorMessage = default(string)) + { + TasksList = tasksList; + PropertyBag = propertyBag; + DynamicErrorMessage = dynamicErrorMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of tasks for this job. + /// + [JsonProperty(PropertyName = "tasksList")] + public IList TasksList { get; set; } + + /// + /// Gets or sets the job properties. + /// + [JsonProperty(PropertyName = "propertyBag")] + public IDictionary PropertyBag { get; set; } + + /// + /// Gets or sets non localized error message specific to this job. + /// + [JsonProperty(PropertyName = "dynamicErrorMessage")] + public string DynamicErrorMessage { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJobTaskDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJobTaskDetails.cs new file mode 100644 index 000000000000..eea97e6f4c34 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabJobTaskDetails.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// MAB workload-specific job task details. + /// + public partial class MabJobTaskDetails + { + /// + /// Initializes a new instance of the MabJobTaskDetails class. + /// + public MabJobTaskDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MabJobTaskDetails class. + /// + /// The task display name. + /// The start time. + /// The end time. + /// Time elapsed for task. + /// The status. + public MabJobTaskDetails(string taskId = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), System.TimeSpan? duration = default(System.TimeSpan?), string status = default(string)) + { + TaskId = taskId; + StartTime = startTime; + EndTime = endTime; + Duration = duration; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the task display name. + /// + [JsonProperty(PropertyName = "taskId")] + public string TaskId { get; set; } + + /// + /// Gets or sets the start time. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the end time. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets time elapsed for task. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets the status. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabProtectionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabProtectionPolicy.cs new file mode 100644 index 000000000000..b27b8a6cbdce --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabProtectionPolicy.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Mab container-specific backup policy. + /// + [Newtonsoft.Json.JsonObject("MAB")] + public partial class MabProtectionPolicy : ProtectionPolicy + { + /// + /// Initializes a new instance of the MabProtectionPolicy class. + /// + public MabProtectionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MabProtectionPolicy class. + /// + /// Number of items associated with + /// this policy. + /// ResourceGuard + /// Operation Requests + /// Backup schedule of backup + /// policy. + /// Retention policy details. + public MabProtectionPolicy(int? protectedItemsCount = default(int?), IList resourceGuardOperationRequests = default(IList), SchedulePolicy schedulePolicy = default(SchedulePolicy), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + : base(protectedItemsCount, resourceGuardOperationRequests) + { + SchedulePolicy = schedulePolicy; + RetentionPolicy = retentionPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup schedule of backup policy. + /// + [JsonProperty(PropertyName = "schedulePolicy")] + public SchedulePolicy SchedulePolicy { get; set; } + + /// + /// Gets or sets retention policy details. + /// + [JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabServerType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabServerType.cs new file mode 100644 index 000000000000..763a2e9c8d7c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabServerType.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for MabServerType. + /// + public static class MabServerType + { + public const string Invalid = "Invalid"; + public const string Unknown = "Unknown"; + public const string IaasVMContainer = "IaasVMContainer"; + public const string IaasVMServiceContainer = "IaasVMServiceContainer"; + public const string DPMContainer = "DPMContainer"; + public const string AzureBackupServerContainer = "AzureBackupServerContainer"; + public const string MABContainer = "MABContainer"; + public const string Cluster = "Cluster"; + public const string AzureSqlContainer = "AzureSqlContainer"; + public const string Windows = "Windows"; + public const string VCenter = "VCenter"; + public const string VMAppContainer = "VMAppContainer"; + public const string SQLAGWorkLoadContainer = "SQLAGWorkLoadContainer"; + public const string StorageContainer = "StorageContainer"; + public const string GenericContainer = "GenericContainer"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MonthOfYear.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MonthOfYear.cs new file mode 100644 index 000000000000..f3831fc793c9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MonthOfYear.cs @@ -0,0 +1,126 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for MonthOfYear. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum MonthOfYear + { + [EnumMember(Value = "Invalid")] + Invalid, + [EnumMember(Value = "January")] + January, + [EnumMember(Value = "February")] + February, + [EnumMember(Value = "March")] + March, + [EnumMember(Value = "April")] + April, + [EnumMember(Value = "May")] + May, + [EnumMember(Value = "June")] + June, + [EnumMember(Value = "July")] + July, + [EnumMember(Value = "August")] + August, + [EnumMember(Value = "September")] + September, + [EnumMember(Value = "October")] + October, + [EnumMember(Value = "November")] + November, + [EnumMember(Value = "December")] + December + } + internal static class MonthOfYearEnumExtension + { + internal static string ToSerializedValue(this MonthOfYear? value) + { + return value == null ? null : ((MonthOfYear)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this MonthOfYear value) + { + switch( value ) + { + case MonthOfYear.Invalid: + return "Invalid"; + case MonthOfYear.January: + return "January"; + case MonthOfYear.February: + return "February"; + case MonthOfYear.March: + return "March"; + case MonthOfYear.April: + return "April"; + case MonthOfYear.May: + return "May"; + case MonthOfYear.June: + return "June"; + case MonthOfYear.July: + return "July"; + case MonthOfYear.August: + return "August"; + case MonthOfYear.September: + return "September"; + case MonthOfYear.October: + return "October"; + case MonthOfYear.November: + return "November"; + case MonthOfYear.December: + return "December"; + } + return null; + } + + internal static MonthOfYear? ParseMonthOfYear(this string value) + { + switch( value ) + { + case "Invalid": + return MonthOfYear.Invalid; + case "January": + return MonthOfYear.January; + case "February": + return MonthOfYear.February; + case "March": + return MonthOfYear.March; + case "April": + return MonthOfYear.April; + case "May": + return MonthOfYear.May; + case "June": + return MonthOfYear.June; + case "July": + return MonthOfYear.July; + case "August": + return MonthOfYear.August; + case "September": + return MonthOfYear.September; + case "October": + return MonthOfYear.October; + case "November": + return MonthOfYear.November; + case "December": + return MonthOfYear.December; + } + return null; + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MonthlyRetentionSchedule.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MonthlyRetentionSchedule.cs new file mode 100644 index 000000000000..1968a0e8569d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MonthlyRetentionSchedule.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Monthly retention schedule. + /// + public partial class MonthlyRetentionSchedule + { + /// + /// Initializes a new instance of the MonthlyRetentionSchedule class. + /// + public MonthlyRetentionSchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MonthlyRetentionSchedule class. + /// + /// Retention schedule format + /// type for monthly retention policy. Possible values include: + /// 'Invalid', 'Daily', 'Weekly' + /// Daily retention format for + /// monthly retention policy. + /// Weekly retention format for + /// monthly retention policy. + /// Retention times of retention + /// policy. + /// Retention duration of retention + /// Policy. + public MonthlyRetentionSchedule(string retentionScheduleFormatType = default(string), DailyRetentionFormat retentionScheduleDaily = default(DailyRetentionFormat), WeeklyRetentionFormat retentionScheduleWeekly = default(WeeklyRetentionFormat), IList retentionTimes = default(IList), RetentionDuration retentionDuration = default(RetentionDuration)) + { + RetentionScheduleFormatType = retentionScheduleFormatType; + RetentionScheduleDaily = retentionScheduleDaily; + RetentionScheduleWeekly = retentionScheduleWeekly; + RetentionTimes = retentionTimes; + RetentionDuration = retentionDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets retention schedule format type for monthly retention + /// policy. Possible values include: 'Invalid', 'Daily', 'Weekly' + /// + [JsonProperty(PropertyName = "retentionScheduleFormatType")] + public string RetentionScheduleFormatType { get; set; } + + /// + /// Gets or sets daily retention format for monthly retention policy. + /// + [JsonProperty(PropertyName = "retentionScheduleDaily")] + public DailyRetentionFormat RetentionScheduleDaily { get; set; } + + /// + /// Gets or sets weekly retention format for monthly retention policy. + /// + [JsonProperty(PropertyName = "retentionScheduleWeekly")] + public WeeklyRetentionFormat RetentionScheduleWeekly { get; set; } + + /// + /// Gets or sets retention times of retention policy. + /// + [JsonProperty(PropertyName = "retentionTimes")] + public IList RetentionTimes { get; set; } + + /// + /// Gets or sets retention duration of retention Policy. + /// + [JsonProperty(PropertyName = "retentionDuration")] + public RetentionDuration RetentionDuration { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MoveRPAcrossTiersRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MoveRPAcrossTiersRequest.cs new file mode 100644 index 000000000000..3935a72b0349 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MoveRPAcrossTiersRequest.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class MoveRPAcrossTiersRequest + { + /// + /// Initializes a new instance of the MoveRPAcrossTiersRequest class. + /// + public MoveRPAcrossTiersRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MoveRPAcrossTiersRequest class. + /// + /// Gets the class type. + /// Source tier from where RP needs to be + /// moved. Possible values include: 'Invalid', 'InstantRP', + /// 'HardenedRP', 'ArchivedRP' + /// Target tier where RP needs to be + /// moved. Possible values include: 'Invalid', 'InstantRP', + /// 'HardenedRP', 'ArchivedRP' + public MoveRPAcrossTiersRequest(string objectType = default(string), RecoveryPointTierType? sourceTierType = default(RecoveryPointTierType?), RecoveryPointTierType? targetTierType = default(RecoveryPointTierType?)) + { + ObjectType = objectType; + SourceTierType = sourceTierType; + TargetTierType = targetTierType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the class type. + /// + [JsonProperty(PropertyName = "objectType")] + public string ObjectType { get; set; } + + /// + /// Gets or sets source tier from where RP needs to be moved. Possible + /// values include: 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' + /// + [JsonProperty(PropertyName = "sourceTierType")] + public RecoveryPointTierType? SourceTierType { get; set; } + + /// + /// Gets or sets target tier where RP needs to be moved. Possible + /// values include: 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' + /// + [JsonProperty(PropertyName = "targetTierType")] + public RecoveryPointTierType? TargetTierType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NameInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NameInfo.cs new file mode 100644 index 000000000000..f6321b5d7161 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NameInfo.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The name of usage. + /// + public partial class NameInfo + { + /// + /// Initializes a new instance of the NameInfo class. + /// + public NameInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NameInfo class. + /// + /// Value of usage. + /// Localized value of usage. + public NameInfo(string value = default(string), string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets value of usage. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets localized value of usage. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponse.cs new file mode 100644 index 000000000000..2559d2ec61ff --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponse.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error response. + /// + public partial class NewErrorResponse + { + /// + /// Initializes a new instance of the NewErrorResponse class. + /// + public NewErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NewErrorResponse class. + /// + /// The error object. + public NewErrorResponse(NewErrorResponseError error = default(NewErrorResponseError)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public NewErrorResponseError Error { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponseError.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponseError.cs new file mode 100644 index 000000000000..5180ae8876c5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponseError.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error object. + /// + public partial class NewErrorResponseError + { + /// + /// Initializes a new instance of the NewErrorResponseError class. + /// + public NewErrorResponseError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NewErrorResponseError class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public NewErrorResponseError(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponseException.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponseException.cs new file mode 100644 index 000000000000..24ed879e2521 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/NewErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with NewErrorResponse + /// information. + /// + public partial class NewErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public NewErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the NewErrorResponseException class. + /// + public NewErrorResponseException() + { + } + + /// + /// Initializes a new instance of the NewErrorResponseException class. + /// + /// The exception message. + public NewErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the NewErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public NewErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfo.cs new file mode 100644 index 000000000000..5e8773e09d04 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfo.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Operation result info. + /// + public partial class OperationResultInfo : OperationResultInfoBase + { + /// + /// Initializes a new instance of the OperationResultInfo class. + /// + public OperationResultInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationResultInfo class. + /// + /// List of jobs created by this + /// operation. + public OperationResultInfo(IList jobList = default(IList)) + { + JobList = jobList; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of jobs created by this operation. + /// + [JsonProperty(PropertyName = "jobList")] + public IList JobList { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfoBase.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfoBase.cs new file mode 100644 index 000000000000..aa6493f1590b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfoBase.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Base class for operation result info. + /// + public partial class OperationResultInfoBase + { + /// + /// Initializes a new instance of the OperationResultInfoBase class. + /// + public OperationResultInfoBase() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfoBaseResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfoBaseResource.cs new file mode 100644 index 000000000000..35661a902c33 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationResultInfoBaseResource.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for operation result info. + /// + public partial class OperationResultInfoBaseResource : OperationWorkerResponse + { + /// + /// Initializes a new instance of the OperationResultInfoBaseResource + /// class. + /// + public OperationResultInfoBaseResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationResultInfoBaseResource + /// class. + /// + /// HTTP Status Code of the operation. + /// Possible values include: 'Continue', 'SwitchingProtocols', 'OK', + /// 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', + /// 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', + /// 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', + /// 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', + /// 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', + /// 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + /// 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + /// 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + /// 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + /// 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + /// 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + /// 'NotImplemented', 'BadGateway', 'ServiceUnavailable', + /// 'GatewayTimeout', 'HttpVersionNotSupported' + /// HTTP headers associated with this + /// operation. + /// OperationResultInfoBaseResource + /// operation + public OperationResultInfoBaseResource(HttpStatusCode? statusCode = default(HttpStatusCode?), IDictionary> headers = default(IDictionary>), OperationResultInfoBase operation = default(OperationResultInfoBase)) + : base(statusCode, headers) + { + Operation = operation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operationResultInfoBaseResource operation + /// + [JsonProperty(PropertyName = "operation")] + public OperationResultInfoBase Operation { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatus.cs new file mode 100644 index 000000000000..a6f9a2a220b1 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatus.cs @@ -0,0 +1,104 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Operation status. + /// + public partial class OperationStatus + { + /// + /// Initializes a new instance of the OperationStatus class. + /// + public OperationStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationStatus class. + /// + /// ID of the operation. + /// Name of the operation. + /// Operation status. Possible values include: + /// 'Invalid', 'InProgress', 'Succeeded', 'Failed', 'Canceled' + /// Operation start time. Format: + /// ISO-8601. + /// Operation end time. Format: ISO-8601. + /// Error information related to this + /// operation. + /// Additional information associated with + /// this operation. + public OperationStatus(string id = default(string), string name = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), OperationStatusError error = default(OperationStatusError), OperationStatusExtendedInfo properties = default(OperationStatusExtendedInfo)) + { + Id = id; + Name = name; + Status = status; + StartTime = startTime; + EndTime = endTime; + Error = error; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ID of the operation. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets name of the operation. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets operation status. Possible values include: 'Invalid', + /// 'InProgress', 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets operation start time. Format: ISO-8601. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets operation end time. Format: ISO-8601. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets error information related to this operation. + /// + [JsonProperty(PropertyName = "error")] + public OperationStatusError Error { get; set; } + + /// + /// Gets or sets additional information associated with this operation. + /// + [JsonProperty(PropertyName = "properties")] + public OperationStatusExtendedInfo Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusError.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusError.cs new file mode 100644 index 000000000000..47f83321c96b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusError.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error information associated with operation status call. + /// + public partial class OperationStatusError + { + /// + /// Initializes a new instance of the OperationStatusError class. + /// + public OperationStatusError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationStatusError class. + /// + /// Error code of the operation failure. + /// Error message displayed if the operation + /// failure. + public OperationStatusError(string code = default(string), string message = default(string)) + { + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code of the operation failure. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets error message displayed if the operation failure. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusExtendedInfo.cs new file mode 100644 index 000000000000..3d325b1cdba8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusExtendedInfo.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Base class for additional information of operation status. + /// + public partial class OperationStatusExtendedInfo + { + /// + /// Initializes a new instance of the OperationStatusExtendedInfo + /// class. + /// + public OperationStatusExtendedInfo() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusJobExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusJobExtendedInfo.cs new file mode 100644 index 000000000000..ee83676e45b9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusJobExtendedInfo.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Operation status job extended info. + /// + public partial class OperationStatusJobExtendedInfo : OperationStatusExtendedInfo + { + /// + /// Initializes a new instance of the OperationStatusJobExtendedInfo + /// class. + /// + public OperationStatusJobExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationStatusJobExtendedInfo + /// class. + /// + /// ID of the job created for this protected + /// item. + public OperationStatusJobExtendedInfo(string jobId = default(string)) + { + JobId = jobId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ID of the job created for this protected item. + /// + [JsonProperty(PropertyName = "jobId")] + public string JobId { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusJobsExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusJobsExtendedInfo.cs new file mode 100644 index 000000000000..a169aeaf4d4f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusJobsExtendedInfo.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Operation status extended info for list of jobs. + /// + public partial class OperationStatusJobsExtendedInfo : OperationStatusExtendedInfo + { + /// + /// Initializes a new instance of the OperationStatusJobsExtendedInfo + /// class. + /// + public OperationStatusJobsExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationStatusJobsExtendedInfo + /// class. + /// + /// IDs of the jobs created for the protected + /// item. + /// Stores all the failed jobs along with + /// the corresponding error codes. + public OperationStatusJobsExtendedInfo(IList jobIds = default(IList), IDictionary failedJobsError = default(IDictionary)) + { + JobIds = jobIds; + FailedJobsError = failedJobsError; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets iDs of the jobs created for the protected item. + /// + [JsonProperty(PropertyName = "jobIds")] + public IList JobIds { get; set; } + + /// + /// Gets or sets stores all the failed jobs along with the + /// corresponding error codes. + /// + [JsonProperty(PropertyName = "failedJobsError")] + public IDictionary FailedJobsError { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusProvisionILRExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusProvisionILRExtendedInfo.cs new file mode 100644 index 000000000000..7d557396cdb6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusProvisionILRExtendedInfo.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Operation status extended info for ILR provision action. + /// + public partial class OperationStatusProvisionILRExtendedInfo : OperationStatusExtendedInfo + { + /// + /// Initializes a new instance of the + /// OperationStatusProvisionILRExtendedInfo class. + /// + public OperationStatusProvisionILRExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// OperationStatusProvisionILRExtendedInfo class. + /// + /// Target details for file / folder + /// restore. + public OperationStatusProvisionILRExtendedInfo(InstantItemRecoveryTarget recoveryTarget = default(InstantItemRecoveryTarget)) + { + RecoveryTarget = recoveryTarget; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets target details for file / folder restore. + /// + [JsonProperty(PropertyName = "recoveryTarget")] + public InstantItemRecoveryTarget RecoveryTarget { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValidateOperationExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValidateOperationExtendedInfo.cs new file mode 100644 index 000000000000..a2a722ac3fde --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValidateOperationExtendedInfo.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Operation status extended info for ValidateOperation action. + /// + public partial class OperationStatusValidateOperationExtendedInfo : OperationStatusExtendedInfo + { + /// + /// Initializes a new instance of the + /// OperationStatusValidateOperationExtendedInfo class. + /// + public OperationStatusValidateOperationExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// OperationStatusValidateOperationExtendedInfo class. + /// + /// Gets the validation + /// operation response + public OperationStatusValidateOperationExtendedInfo(ValidateOperationResponse validateOperationResponse = default(ValidateOperationResponse)) + { + ValidateOperationResponse = validateOperationResponse; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the validation operation response + /// + [JsonProperty(PropertyName = "validateOperationResponse")] + public ValidateOperationResponse ValidateOperationResponse { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValues.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValues.cs new file mode 100644 index 000000000000..deae35f3248e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValues.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for OperationStatusValues. + /// + public static class OperationStatusValues + { + public const string Invalid = "Invalid"; + public const string InProgress = "InProgress"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationType.cs new file mode 100644 index 000000000000..0172814ee483 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for OperationType. + /// + public static class OperationType + { + public const string Invalid = "Invalid"; + public const string Register = "Register"; + public const string Reregister = "Reregister"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationWorkerResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationWorkerResponse.cs new file mode 100644 index 000000000000..935178db42d5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationWorkerResponse.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This is the base class for operation result responses. + /// + public partial class OperationWorkerResponse + { + /// + /// Initializes a new instance of the OperationWorkerResponse class. + /// + public OperationWorkerResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationWorkerResponse class. + /// + /// HTTP Status Code of the operation. + /// Possible values include: 'Continue', 'SwitchingProtocols', 'OK', + /// 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', + /// 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', + /// 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', + /// 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', + /// 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', + /// 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + /// 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + /// 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + /// 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + /// 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + /// 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + /// 'NotImplemented', 'BadGateway', 'ServiceUnavailable', + /// 'GatewayTimeout', 'HttpVersionNotSupported' + /// HTTP headers associated with this + /// operation. + public OperationWorkerResponse(HttpStatusCode? statusCode = default(HttpStatusCode?), IDictionary> headers = default(IDictionary>)) + { + StatusCode = statusCode; + Headers = headers; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets HTTP Status Code of the operation. Possible values + /// include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', + /// 'Accepted', 'NonAuthoritativeInformation', 'NoContent', + /// 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', + /// 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', + /// 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', + /// 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', + /// 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + /// 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + /// 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + /// 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + /// 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + /// 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + /// 'NotImplemented', 'BadGateway', 'ServiceUnavailable', + /// 'GatewayTimeout', 'HttpVersionNotSupported' + /// + [JsonProperty(PropertyName = "statusCode")] + public HttpStatusCode? StatusCode { get; set; } + + /// + /// Gets or sets HTTP headers associated with this operation. + /// + [JsonProperty(PropertyName = "headers")] + public IDictionary> Headers { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OverwriteOptions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OverwriteOptions.cs new file mode 100644 index 000000000000..eff5571d5360 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OverwriteOptions.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for OverwriteOptions. + /// + public static class OverwriteOptions + { + public const string Invalid = "Invalid"; + public const string FailOnConflict = "FailOnConflict"; + public const string Overwrite = "Overwrite"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Page.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Page.cs new file mode 100644 index 000000000000..120229a5943a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Page1.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Page1.cs new file mode 100644 index 000000000000..131bec874574 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PointInTimeRange.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PointInTimeRange.cs new file mode 100644 index 000000000000..84416c51f2ad --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PointInTimeRange.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Provides details for log ranges + /// + public partial class PointInTimeRange + { + /// + /// Initializes a new instance of the PointInTimeRange class. + /// + public PointInTimeRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PointInTimeRange class. + /// + /// Start time of the time range for log + /// recovery. + /// End time of the time range for log + /// recovery. + public PointInTimeRange(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?)) + { + StartTime = startTime; + EndTime = endTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets start time of the time range for log recovery. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets end time of the time range for log recovery. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PolicyType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PolicyType.cs new file mode 100644 index 000000000000..e3135724a356 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PolicyType.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for PolicyType. + /// + public static class PolicyType + { + public const string Invalid = "Invalid"; + public const string Full = "Full"; + public const string Differential = "Differential"; + public const string Log = "Log"; + public const string CopyOnlyFull = "CopyOnlyFull"; + public const string Incremental = "Incremental"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreBackupValidation.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreBackupValidation.cs new file mode 100644 index 000000000000..9e2060d59eba --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreBackupValidation.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Pre-backup validation for Azure VM Workload provider. + /// + public partial class PreBackupValidation + { + /// + /// Initializes a new instance of the PreBackupValidation class. + /// + public PreBackupValidation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PreBackupValidation class. + /// + /// Status of protectable item, i.e. + /// InProgress,Succeeded,Failed. Possible values include: 'Invalid', + /// 'Success', 'Failed' + /// Error code of protectable item + /// Message corresponding to the error code for + /// the protectable item + public PreBackupValidation(string status = default(string), string code = default(string), string message = default(string)) + { + Status = status; + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of protectable item, i.e. + /// InProgress,Succeeded,Failed. Possible values include: 'Invalid', + /// 'Success', 'Failed' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets error code of protectable item + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets message corresponding to the error code for the + /// protectable item + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreValidateEnableBackupRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreValidateEnableBackupRequest.cs new file mode 100644 index 000000000000..310da786f3e2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreValidateEnableBackupRequest.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Contract to validate if backup can be enabled on the given resource in + /// a given vault and given configuration. + /// It will validate followings + /// 1. Vault capacity + /// 2. VM is already protected + /// 3. Any VM related configuration passed in properties. + /// + public partial class PreValidateEnableBackupRequest + { + /// + /// Initializes a new instance of the PreValidateEnableBackupRequest + /// class. + /// + public PreValidateEnableBackupRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PreValidateEnableBackupRequest + /// class. + /// + /// ProtectedItem Type- VM, SqlDataBase, + /// AzureFileShare etc. Possible values include: 'Invalid', 'VM', + /// 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', + /// 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', + /// 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', + /// 'SAPAseDatabase' + /// ARM Virtual Machine Id + /// ARM id of the Recovery Services Vault + /// Configuration of VM if any needs to be + /// validated like OS type etc + public PreValidateEnableBackupRequest(string resourceType = default(string), string resourceId = default(string), string vaultId = default(string), string properties = default(string)) + { + ResourceType = resourceType; + ResourceId = resourceId; + VaultId = vaultId; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets protectedItem Type- VM, SqlDataBase, AzureFileShare + /// etc. Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; set; } + + /// + /// Gets or sets ARM Virtual Machine Id + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets ARM id of the Recovery Services Vault + /// + [JsonProperty(PropertyName = "vaultId")] + public string VaultId { get; set; } + + /// + /// Gets or sets configuration of VM if any needs to be validated like + /// OS type etc + /// + [JsonProperty(PropertyName = "properties")] + public string Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreValidateEnableBackupResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreValidateEnableBackupResponse.cs new file mode 100644 index 000000000000..8d201e0d8044 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PreValidateEnableBackupResponse.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response contract for enable backup validation request + /// + public partial class PreValidateEnableBackupResponse + { + /// + /// Initializes a new instance of the PreValidateEnableBackupResponse + /// class. + /// + public PreValidateEnableBackupResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PreValidateEnableBackupResponse + /// class. + /// + /// Validation Status. Possible values include: + /// 'Invalid', 'Succeeded', 'Failed' + /// Response error code + /// Response error message + /// Recommended action for user + /// Specifies the product specific + /// container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. + /// This is required + /// for portal + /// Specifies the product specific ds + /// name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for + /// portal + public PreValidateEnableBackupResponse(string status = default(string), string errorCode = default(string), string errorMessage = default(string), string recommendation = default(string), string containerName = default(string), string protectedItemName = default(string)) + { + Status = status; + ErrorCode = errorCode; + ErrorMessage = errorMessage; + Recommendation = recommendation; + ContainerName = containerName; + ProtectedItemName = protectedItemName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets validation Status. Possible values include: 'Invalid', + /// 'Succeeded', 'Failed' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets response error code + /// + [JsonProperty(PropertyName = "errorCode")] + public string ErrorCode { get; set; } + + /// + /// Gets or sets response error message + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + + /// + /// Gets or sets recommended action for user + /// + [JsonProperty(PropertyName = "recommendation")] + public string Recommendation { get; set; } + + /// + /// Gets or sets specifies the product specific container name. E.g. + /// iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + /// for portal + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets specifies the product specific ds name. E.g. + /// vm;iaasvmcontainer;rgname;vmname. This is required for portal + /// + [JsonProperty(PropertyName = "protectedItemName")] + public string ProtectedItemName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrepareDataMoveRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrepareDataMoveRequest.cs new file mode 100644 index 000000000000..ccaf37f9c844 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrepareDataMoveRequest.cs @@ -0,0 +1,114 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Prepare DataMove Request + /// + public partial class PrepareDataMoveRequest + { + /// + /// Initializes a new instance of the PrepareDataMoveRequest class. + /// + public PrepareDataMoveRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrepareDataMoveRequest class. + /// + /// ARM Id of target vault + /// Target Region + /// DataMove Level. Possible values + /// include: 'Invalid', 'Vault', 'Container' + /// Source Container ArmIds + /// This needs to be populated only if DataMoveLevel is set to + /// container + /// Ignore the artifacts which are already + /// moved. + public PrepareDataMoveRequest(string targetResourceId, string targetRegion, string dataMoveLevel, IList sourceContainerArmIds = default(IList), bool? ignoreMoved = default(bool?)) + { + TargetResourceId = targetResourceId; + TargetRegion = targetRegion; + DataMoveLevel = dataMoveLevel; + SourceContainerArmIds = sourceContainerArmIds; + IgnoreMoved = ignoreMoved; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ARM Id of target vault + /// + [JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId { get; set; } + + /// + /// Gets or sets target Region + /// + [JsonProperty(PropertyName = "targetRegion")] + public string TargetRegion { get; set; } + + /// + /// Gets or sets dataMove Level. Possible values include: 'Invalid', + /// 'Vault', 'Container' + /// + [JsonProperty(PropertyName = "dataMoveLevel")] + public string DataMoveLevel { get; set; } + + /// + /// Gets or sets source Container ArmIds + /// This needs to be populated only if DataMoveLevel is set to + /// container + /// + [JsonProperty(PropertyName = "sourceContainerArmIds")] + public IList SourceContainerArmIds { get; set; } + + /// + /// Gets or sets ignore the artifacts which are already moved. + /// + [JsonProperty(PropertyName = "ignoreMoved")] + public bool? IgnoreMoved { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + } + if (TargetRegion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetRegion"); + } + if (DataMoveLevel == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DataMoveLevel"); + } + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrepareDataMoveResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrepareDataMoveResponse.cs new file mode 100644 index 000000000000..f06503738b7c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrepareDataMoveResponse.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Prepare DataMove Response + /// + public partial class PrepareDataMoveResponse : VaultStorageConfigOperationResultResponse + { + /// + /// Initializes a new instance of the PrepareDataMoveResponse class. + /// + public PrepareDataMoveResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrepareDataMoveResponse class. + /// + /// Co-relationId for move + /// operation + /// Source Vault Properties + public PrepareDataMoveResponse(string correlationId = default(string), IDictionary sourceVaultProperties = default(IDictionary)) + { + CorrelationId = correlationId; + SourceVaultProperties = sourceVaultProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets co-relationId for move operation + /// + [JsonProperty(PropertyName = "correlationId")] + public string CorrelationId { get; set; } + + /// + /// Gets or sets source Vault Properties + /// + [JsonProperty(PropertyName = "sourceVaultProperties")] + public IDictionary SourceVaultProperties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 000000000000..d0d6c1d24919 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Private Endpoint network resource that is linked to the Private + /// Endpoint connection + /// + public partial class PrivateEndpoint + { + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + public PrivateEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + /// Gets or sets id + public PrivateEndpoint(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..3c05f11baaa2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Private Endpoint Connection Response Properties + /// + public partial class PrivateEndpointConnection + { + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + public PrivateEndpointConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + /// Gets or sets provisioning state of + /// the private endpoint connection. Possible values include: + /// 'Succeeded', 'Deleting', 'Failed', 'Pending' + /// Gets or sets private endpoint + /// associated with the private endpoint connection + /// Gets or sets + /// private link service connection state + public PrivateEndpointConnection(string provisioningState = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState)) + { + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets provisioning state of the private endpoint connection. + /// Possible values include: 'Succeeded', 'Deleting', 'Failed', + /// 'Pending' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets private endpoint associated with the private endpoint + /// connection + /// + [JsonProperty(PropertyName = "privateEndpoint")] + public PrivateEndpoint PrivateEndpoint { get; set; } + + /// + /// Gets or sets private link service connection state + /// + [JsonProperty(PropertyName = "privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnectionResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..635f1f0adb94 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnectionResource.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Private Endpoint Connection Response Properties + /// + public partial class PrivateEndpointConnectionResource : Resource + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionResource + /// class. + /// + public PrivateEndpointConnectionResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnectionResource + /// class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// PrivateEndpointConnectionResource + /// properties + public PrivateEndpointConnectionResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), PrivateEndpointConnection properties = default(PrivateEndpointConnection)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets privateEndpointConnectionResource properties + /// + [JsonProperty(PropertyName = "properties")] + public PrivateEndpointConnection Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnectionStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnectionStatus.cs new file mode 100644 index 000000000000..afec61ab3d8e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateEndpointConnectionStatus.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for PrivateEndpointConnectionStatus. + /// + public static class PrivateEndpointConnectionStatus + { + public const string Pending = "Pending"; + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + public const string Disconnected = "Disconnected"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateLinkServiceConnectionState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..b12ab9d7ea59 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Private Link Service Connection State + /// + public partial class PrivateLinkServiceConnectionState + { + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + public PrivateLinkServiceConnectionState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + /// Gets or sets the status. Possible values + /// include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + /// Gets or sets description + /// Gets or sets actions required + public PrivateLinkServiceConnectionState(string status = default(string), string description = default(string), string actionRequired = default(string)) + { + Status = status; + Description = description; + ActionRequired = actionRequired; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the status. Possible values include: 'Pending', + /// 'Approved', 'Rejected', 'Disconnected' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets description + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets actions required + /// + [JsonProperty(PropertyName = "actionRequired")] + public string ActionRequired { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectableContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectableContainer.cs new file mode 100644 index 000000000000..f431dbd60078 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectableContainer.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Protectable Container Class. + /// + public partial class ProtectableContainer + { + /// + /// Initializes a new instance of the ProtectableContainer class. + /// + public ProtectableContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectableContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of health of the + /// container. + /// Fabric Id of the container such as ARM + /// Id. + public ProtectableContainer(string friendlyName = default(string), string backupManagementType = default(string), string healthStatus = default(string), string containerId = default(string)) + { + FriendlyName = friendlyName; + BackupManagementType = backupManagementType; + HealthStatus = healthStatus; + ContainerId = containerId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the container. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets type of backup management for the container. Possible + /// values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets status of health of the container. + /// + [JsonProperty(PropertyName = "healthStatus")] + public string HealthStatus { get; set; } + + /// + /// Gets or sets fabric Id of the container such as ARM Id. + /// + [JsonProperty(PropertyName = "containerId")] + public string ContainerId { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectableContainerResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectableContainerResource.cs new file mode 100644 index 000000000000..70230fc2d285 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectableContainerResource.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Protectable Container Class. + /// + public partial class ProtectableContainerResource : Resource + { + /// + /// Initializes a new instance of the ProtectableContainerResource + /// class. + /// + public ProtectableContainerResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectableContainerResource + /// class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// ProtectableContainerResource + /// properties + public ProtectableContainerResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), ProtectableContainer properties = default(ProtectableContainer)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets protectableContainerResource properties + /// + [JsonProperty(PropertyName = "properties")] + public ProtectableContainer Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs new file mode 100644 index 000000000000..5b3d042654d2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs @@ -0,0 +1,212 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup items. + /// + public partial class ProtectedItem + { + /// + /// Initializes a new instance of the ProtectedItem class. + /// + public ProtectedItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectedItem class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Unique name of container + /// ARM ID of the resource to be backed + /// up. + /// ID of the backup policy with which this item + /// is backed up. + /// Timestamp when the last (latest) + /// backup copy was created for this backup item. + /// Name of the backup set the backup item + /// belongs to + /// Create mode to indicate recovery of + /// existing soft deleted data source or creation of new data source. + /// Possible values include: 'Invalid', 'Default', 'Recover' + /// Time for deferred deletion in + /// UTC + /// Flag to identify whether + /// the DS is scheduled for deferred delete + /// Time remaining before the + /// DS marked for deferred delete is permanently deleted + /// Flag to identify + /// whether the deferred deleted DS is to be purged soon + /// Flag to identify that deferred deleted DS + /// is to be moved into Pause state + /// ResourceGuardOperationRequests + /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + public ProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string)) + { + BackupManagementType = backupManagementType; + WorkloadType = workloadType; + ContainerName = containerName; + SourceResourceId = sourceResourceId; + PolicyId = policyId; + LastRecoveryPoint = lastRecoveryPoint; + BackupSetName = backupSetName; + CreateMode = createMode; + DeferredDeleteTimeInUTC = deferredDeleteTimeInUTC; + IsScheduledForDeferredDelete = isScheduledForDeferredDelete; + DeferredDeleteTimeRemaining = deferredDeleteTimeRemaining; + IsDeferredDeleteScheduleUpcoming = isDeferredDeleteScheduleUpcoming; + IsRehydrate = isRehydrate; + ResourceGuardOperationRequests = resourceGuardOperationRequests; + IsArchiveEnabled = isArchiveEnabled; + PolicyName = policyName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of backup management for the backed up item. + /// Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets type of workload this item represents. Possible values + /// include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', + /// 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + /// 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + /// + /// Gets or sets unique name of container + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets ARM ID of the resource to be backed up. + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + /// + /// Gets or sets ID of the backup policy with which this item is backed + /// up. + /// + [JsonProperty(PropertyName = "policyId")] + public string PolicyId { get; set; } + + /// + /// Gets or sets timestamp when the last (latest) backup copy was + /// created for this backup item. + /// + [JsonProperty(PropertyName = "lastRecoveryPoint")] + public System.DateTime? LastRecoveryPoint { get; set; } + + /// + /// Gets or sets name of the backup set the backup item belongs to + /// + [JsonProperty(PropertyName = "backupSetName")] + public string BackupSetName { get; set; } + + /// + /// Gets or sets create mode to indicate recovery of existing soft + /// deleted data source or creation of new data source. Possible values + /// include: 'Invalid', 'Default', 'Recover' + /// + [JsonProperty(PropertyName = "createMode")] + public string CreateMode { get; set; } + + /// + /// Gets or sets time for deferred deletion in UTC + /// + [JsonProperty(PropertyName = "deferredDeleteTimeInUTC")] + public System.DateTime? DeferredDeleteTimeInUTC { get; set; } + + /// + /// Gets or sets flag to identify whether the DS is scheduled for + /// deferred delete + /// + [JsonProperty(PropertyName = "isScheduledForDeferredDelete")] + public bool? IsScheduledForDeferredDelete { get; set; } + + /// + /// Gets or sets time remaining before the DS marked for deferred + /// delete is permanently deleted + /// + [JsonProperty(PropertyName = "deferredDeleteTimeRemaining")] + public string DeferredDeleteTimeRemaining { get; set; } + + /// + /// Gets or sets flag to identify whether the deferred deleted DS is to + /// be purged soon + /// + [JsonProperty(PropertyName = "isDeferredDeleteScheduleUpcoming")] + public bool? IsDeferredDeleteScheduleUpcoming { get; set; } + + /// + /// Gets or sets flag to identify that deferred deleted DS is to be + /// moved into Pause state + /// + [JsonProperty(PropertyName = "isRehydrate")] + public bool? IsRehydrate { get; set; } + + /// + /// Gets or sets resourceGuardOperationRequests on which LAC check will + /// be performed + /// + [JsonProperty(PropertyName = "resourceGuardOperationRequests")] + public IList ResourceGuardOperationRequests { get; set; } + + /// + /// Gets or sets flag to identify whether datasource is protected in + /// archive + /// + [JsonProperty(PropertyName = "isArchiveEnabled")] + public bool? IsArchiveEnabled { get; set; } + + /// + /// Gets or sets name of the policy used for protection + /// + [JsonProperty(PropertyName = "policyName")] + public string PolicyName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemHealthStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemHealthStatus.cs new file mode 100644 index 000000000000..7d2f8e1431de --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemHealthStatus.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for ProtectedItemHealthStatus. + /// + public static class ProtectedItemHealthStatus + { + public const string Invalid = "Invalid"; + public const string Healthy = "Healthy"; + public const string Unhealthy = "Unhealthy"; + public const string NotReachable = "NotReachable"; + public const string IRPending = "IRPending"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemQueryObject.cs new file mode 100644 index 000000000000..3e2d464bdc71 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemQueryObject.cs @@ -0,0 +1,133 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Filters to list backup items. + /// + public partial class ProtectedItemQueryObject + { + /// + /// Initializes a new instance of the ProtectedItemQueryObject class. + /// + public ProtectedItemQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectedItemQueryObject class. + /// + /// Health State for the backed up item. + /// Possible values include: 'Passed', 'ActionRequired', + /// 'ActionSuggested', 'Invalid' + /// Backup management type for the + /// backed up item. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + /// Backup policy name associated with the + /// backup item. + /// Name of the container. + /// Backup Engine name + /// Friendly name of protected item + /// Name of the fabric. + /// Name of the backup set. + public ProtectedItemQueryObject(string healthState = default(string), string backupManagementType = default(string), string itemType = default(string), string policyName = default(string), string containerName = default(string), string backupEngineName = default(string), string friendlyName = default(string), string fabricName = default(string), string backupSetName = default(string)) + { + HealthState = healthState; + BackupManagementType = backupManagementType; + ItemType = itemType; + PolicyName = policyName; + ContainerName = containerName; + BackupEngineName = backupEngineName; + FriendlyName = friendlyName; + FabricName = fabricName; + BackupSetName = backupSetName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets health State for the backed up item. Possible values + /// include: 'Passed', 'ActionRequired', 'ActionSuggested', 'Invalid' + /// + [JsonProperty(PropertyName = "healthState")] + public string HealthState { get; set; } + + /// + /// Gets or sets backup management type for the backed up item. + /// Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets type of workload this item represents. Possible values + /// include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', + /// 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + /// 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "itemType")] + public string ItemType { get; set; } + + /// + /// Gets or sets backup policy name associated with the backup item. + /// + [JsonProperty(PropertyName = "policyName")] + public string PolicyName { get; set; } + + /// + /// Gets or sets name of the container. + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets backup Engine name + /// + [JsonProperty(PropertyName = "backupEngineName")] + public string BackupEngineName { get; set; } + + /// + /// Gets or sets friendly name of protected item + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets name of the fabric. + /// + [JsonProperty(PropertyName = "fabricName")] + public string FabricName { get; set; } + + /// + /// Gets or sets name of the backup set. + /// + [JsonProperty(PropertyName = "backupSetName")] + public string BackupSetName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemResource.cs new file mode 100644 index 000000000000..d798dde1a3fd --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemResource.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup items. + /// + public partial class ProtectedItemResource : Resource + { + /// + /// Initializes a new instance of the ProtectedItemResource class. + /// + public ProtectedItemResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectedItemResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// ProtectedItemResource properties + public ProtectedItemResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), ProtectedItem properties = default(ProtectedItem)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets protectedItemResource properties + /// + [JsonProperty(PropertyName = "properties")] + public ProtectedItem Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemState.cs new file mode 100644 index 000000000000..29006de7db92 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItemState.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for ProtectedItemState. + /// + public static class ProtectedItemState + { + public const string Invalid = "Invalid"; + public const string IRPending = "IRPending"; + public const string Protected = "Protected"; + public const string ProtectionError = "ProtectionError"; + public const string ProtectionStopped = "ProtectionStopped"; + public const string ProtectionPaused = "ProtectionPaused"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainer.cs new file mode 100644 index 000000000000..d00336a7e03a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainer.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Base class for container with backup items. Containers with specific + /// workloads are derived from this class. + /// + public partial class ProtectionContainer + { + /// + /// Initializes a new instance of the ProtectionContainer class. + /// + public ProtectionContainer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionContainer class. + /// + /// Friendly name of the container. + /// Type of backup management for + /// the container. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Status of registration of the + /// container with the Recovery Services Vault. + /// Status of health of the + /// container. + /// Type of the protectable object + /// associated with this container + public ProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string)) + { + FriendlyName = friendlyName; + BackupManagementType = backupManagementType; + RegistrationStatus = registrationStatus; + HealthStatus = healthStatus; + ProtectableObjectType = protectableObjectType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the container. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets type of backup management for the container. Possible + /// values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets status of registration of the container with the + /// Recovery Services Vault. + /// + [JsonProperty(PropertyName = "registrationStatus")] + public string RegistrationStatus { get; set; } + + /// + /// Gets or sets status of health of the container. + /// + [JsonProperty(PropertyName = "healthStatus")] + public string HealthStatus { get; set; } + + /// + /// Gets or sets type of the protectable object associated with this + /// container + /// + [JsonProperty(PropertyName = "protectableObjectType")] + public string ProtectableObjectType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainerResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainerResource.cs new file mode 100644 index 000000000000..bb174797790d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainerResource.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for container with backup items. Containers with specific + /// workloads are derived from this class. + /// + public partial class ProtectionContainerResource : Resource + { + /// + /// Initializes a new instance of the ProtectionContainerResource + /// class. + /// + public ProtectionContainerResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionContainerResource + /// class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// ProtectionContainerResource + /// properties + public ProtectionContainerResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), ProtectionContainer properties = default(ProtectionContainer)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets protectionContainerResource properties + /// + [JsonProperty(PropertyName = "properties")] + public ProtectionContainer Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntent.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntent.cs new file mode 100644 index 000000000000..2211153440cc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntent.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Base class for backup ProtectionIntent. + /// + public partial class ProtectionIntent + { + /// + /// Initializes a new instance of the ProtectionIntent class. + /// + public ProtectionIntent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionIntent class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// ARM ID of the resource to be backed + /// up. + /// ID of the item which is getting protected, In + /// case of Azure Vm , it is ProtectedItemId + /// ID of the backup policy with which this item + /// is backed up. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + public ProtectionIntent(string backupManagementType = default(string), string sourceResourceId = default(string), string itemId = default(string), string policyId = default(string), string protectionState = default(string)) + { + BackupManagementType = backupManagementType; + SourceResourceId = sourceResourceId; + ItemId = itemId; + PolicyId = policyId; + ProtectionState = protectionState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of backup management for the backed up item. + /// Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets ARM ID of the resource to be backed up. + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + /// + /// Gets or sets ID of the item which is getting protected, In case of + /// Azure Vm , it is ProtectedItemId + /// + [JsonProperty(PropertyName = "itemId")] + public string ItemId { get; set; } + + /// + /// Gets or sets ID of the backup policy with which this item is backed + /// up. + /// + [JsonProperty(PropertyName = "policyId")] + public string PolicyId { get; set; } + + /// + /// Gets or sets backup state of this backup item. Possible values + /// include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', + /// 'ProtectionFailed' + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntentQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntentQueryObject.cs new file mode 100644 index 000000000000..391a89122631 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntentQueryObject.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Filters to list protection intent. + /// + public partial class ProtectionIntentQueryObject + { + /// + /// Initializes a new instance of the ProtectionIntentQueryObject + /// class. + /// + public ProtectionIntentQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionIntentQueryObject + /// class. + /// + /// Backup management type for the + /// backed up item. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Type of workload this item represents. + /// Possible values include: 'Invalid', 'SQLInstance', + /// 'SQLAvailabilityGroupContainer' + /// Parent name of the intent + /// Item name of the intent + public ProtectionIntentQueryObject(string backupManagementType = default(string), string itemType = default(string), string parentName = default(string), string itemName = default(string)) + { + BackupManagementType = backupManagementType; + ItemType = itemType; + ParentName = parentName; + ItemName = itemName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup management type for the backed up item. + /// Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets type of workload this item represents. Possible values + /// include: 'Invalid', 'SQLInstance', 'SQLAvailabilityGroupContainer' + /// + [JsonProperty(PropertyName = "itemType")] + public string ItemType { get; set; } + + /// + /// Gets or sets parent name of the intent + /// + [JsonProperty(PropertyName = "parentName")] + public string ParentName { get; set; } + + /// + /// Gets or sets item name of the intent + /// + [JsonProperty(PropertyName = "itemName")] + public string ItemName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntentResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntentResource.cs new file mode 100644 index 000000000000..53c515168e61 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionIntentResource.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup ProtectionIntent. + /// + public partial class ProtectionIntentResource : Resource + { + /// + /// Initializes a new instance of the ProtectionIntentResource class. + /// + public ProtectionIntentResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionIntentResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// ProtectionIntentResource + /// properties + public ProtectionIntentResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), ProtectionIntent properties = default(ProtectionIntent)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets protectionIntentResource properties + /// + [JsonProperty(PropertyName = "properties")] + public ProtectionIntent Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicy.cs new file mode 100644 index 000000000000..31cc2b941fa4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicy.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup policy. Workload-specific backup policies are + /// derived from this class. + /// + public partial class ProtectionPolicy + { + /// + /// Initializes a new instance of the ProtectionPolicy class. + /// + public ProtectionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionPolicy class. + /// + /// Number of items associated with + /// this policy. + /// ResourceGuard + /// Operation Requests + public ProtectionPolicy(int? protectedItemsCount = default(int?), IList resourceGuardOperationRequests = default(IList)) + { + ProtectedItemsCount = protectedItemsCount; + ResourceGuardOperationRequests = resourceGuardOperationRequests; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets number of items associated with this policy. + /// + [JsonProperty(PropertyName = "protectedItemsCount")] + public int? ProtectedItemsCount { get; set; } + + /// + /// Gets or sets resourceGuard Operation Requests + /// + [JsonProperty(PropertyName = "resourceGuardOperationRequests")] + public IList ResourceGuardOperationRequests { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicyQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicyQueryObject.cs new file mode 100644 index 000000000000..bfef470ee6b3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicyQueryObject.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Filters the list backup policies API. + /// + public partial class ProtectionPolicyQueryObject + { + /// + /// Initializes a new instance of the ProtectionPolicyQueryObject + /// class. + /// + public ProtectionPolicyQueryObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionPolicyQueryObject + /// class. + /// + /// Backup management type for the + /// backup policy. Possible values include: 'Invalid', 'AzureIaasVM', + /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', + /// 'AzureWorkload', 'DefaultBackup' + /// Fabric name for filter + /// Workload type for the backup policy. + /// Possible values include: 'Invalid', 'VM', 'FileFolder', + /// 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + /// 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + public ProtectionPolicyQueryObject(string backupManagementType = default(string), string fabricName = default(string), string workloadType = default(string)) + { + BackupManagementType = backupManagementType; + FabricName = fabricName; + WorkloadType = workloadType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets backup management type for the backup policy. Possible + /// values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', + /// 'DefaultBackup' + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets fabric name for filter + /// + [JsonProperty(PropertyName = "fabricName")] + public string FabricName { get; set; } + + /// + /// Gets or sets workload type for the backup policy. Possible values + /// include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', + /// 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + /// 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', + /// 'SAPHanaDatabase', 'SAPAseDatabase' + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicyResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicyResource.cs new file mode 100644 index 000000000000..e1f68862dda3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionPolicyResource.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup policy. Workload-specific backup policies are + /// derived from this class. + /// + public partial class ProtectionPolicyResource : Resource + { + /// + /// Initializes a new instance of the ProtectionPolicyResource class. + /// + public ProtectionPolicyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionPolicyResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// ProtectionPolicyResource + /// properties + public ProtectionPolicyResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), ProtectionPolicy properties = default(ProtectionPolicy)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets protectionPolicyResource properties + /// + [JsonProperty(PropertyName = "properties")] + public ProtectionPolicy Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionState.cs new file mode 100644 index 000000000000..fbf93dc6a5b8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionState.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for ProtectionState. + /// + public static class ProtectionState + { + public const string Invalid = "Invalid"; + public const string IRPending = "IRPending"; + public const string Protected = "Protected"; + public const string ProtectionError = "ProtectionError"; + public const string ProtectionStopped = "ProtectionStopped"; + public const string ProtectionPaused = "ProtectionPaused"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionStatus.cs new file mode 100644 index 000000000000..a345b532ad13 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionStatus.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for ProtectionStatus. + /// + public static class ProtectionStatus + { + public const string Invalid = "Invalid"; + public const string NotProtected = "NotProtected"; + public const string Protecting = "Protecting"; + public const string Protected = "Protected"; + public const string ProtectionFailed = "ProtectionFailed"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProvisioningState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..3e41e51b99a6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for ProvisioningState. + /// + public static class ProvisioningState + { + public const string Succeeded = "Succeeded"; + public const string Deleting = "Deleting"; + public const string Failed = "Failed"; + public const string Pending = "Pending"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryMode.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryMode.cs new file mode 100644 index 000000000000..bfa826a823bc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryMode.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for RecoveryMode. + /// + public static class RecoveryMode + { + public const string Invalid = "Invalid"; + public const string FileRecovery = "FileRecovery"; + public const string WorkloadRecovery = "WorkloadRecovery"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPoint.cs new file mode 100644 index 000000000000..528246dc7c21 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPoint.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Base class for backup copies. Workload-specific backup copies are + /// derived from this class. + /// + public partial class RecoveryPoint + { + /// + /// Initializes a new instance of the RecoveryPoint class. + /// + public RecoveryPoint() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointDiskConfiguration.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointDiskConfiguration.cs new file mode 100644 index 000000000000..0c9ed9db05e2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointDiskConfiguration.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Disk configuration + /// + public partial class RecoveryPointDiskConfiguration + { + /// + /// Initializes a new instance of the RecoveryPointDiskConfiguration + /// class. + /// + public RecoveryPointDiskConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointDiskConfiguration + /// class. + /// + /// Number of disks + /// included in backup + /// Number of disks attached to + /// the VM + /// Information of disks included in + /// backup + /// Information of disks excluded from + /// backup + public RecoveryPointDiskConfiguration(int? numberOfDisksIncludedInBackup = default(int?), int? numberOfDisksAttachedToVm = default(int?), IList includedDiskList = default(IList), IList excludedDiskList = default(IList)) + { + NumberOfDisksIncludedInBackup = numberOfDisksIncludedInBackup; + NumberOfDisksAttachedToVm = numberOfDisksAttachedToVm; + IncludedDiskList = includedDiskList; + ExcludedDiskList = excludedDiskList; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets number of disks included in backup + /// + [JsonProperty(PropertyName = "numberOfDisksIncludedInBackup")] + public int? NumberOfDisksIncludedInBackup { get; set; } + + /// + /// Gets or sets number of disks attached to the VM + /// + [JsonProperty(PropertyName = "numberOfDisksAttachedToVm")] + public int? NumberOfDisksAttachedToVm { get; set; } + + /// + /// Gets or sets information of disks included in backup + /// + [JsonProperty(PropertyName = "includedDiskList")] + public IList IncludedDiskList { get; set; } + + /// + /// Gets or sets information of disks excluded from backup + /// + [JsonProperty(PropertyName = "excludedDiskList")] + public IList ExcludedDiskList { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointMoveReadinessInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointMoveReadinessInfo.cs new file mode 100644 index 000000000000..11498a86a7f4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointMoveReadinessInfo.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class RecoveryPointMoveReadinessInfo + { + /// + /// Initializes a new instance of the RecoveryPointMoveReadinessInfo + /// class. + /// + public RecoveryPointMoveReadinessInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointMoveReadinessInfo + /// class. + /// + public RecoveryPointMoveReadinessInfo(bool? isReadyForMove = default(bool?), string additionalInfo = default(string)) + { + IsReadyForMove = isReadyForMove; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "isReadyForMove")] + public bool? IsReadyForMove { get; set; } + + /// + /// + [JsonProperty(PropertyName = "additionalInfo")] + public string AdditionalInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointRehydrationInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointRehydrationInfo.cs new file mode 100644 index 000000000000..57ec81a187a7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointRehydrationInfo.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// RP Rehydration Info + /// + public partial class RecoveryPointRehydrationInfo + { + /// + /// Initializes a new instance of the RecoveryPointRehydrationInfo + /// class. + /// + public RecoveryPointRehydrationInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointRehydrationInfo + /// class. + /// + /// How long the rehydrated + /// RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// Rehydration Priority. Possible + /// values include: 'Standard', 'High' + public RecoveryPointRehydrationInfo(string rehydrationRetentionDuration = default(string), string rehydrationPriority = default(string)) + { + RehydrationRetentionDuration = rehydrationRetentionDuration; + RehydrationPriority = rehydrationPriority; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets how long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [JsonProperty(PropertyName = "rehydrationRetentionDuration")] + public string RehydrationRetentionDuration { get; set; } + + /// + /// Gets or sets rehydration Priority. Possible values include: + /// 'Standard', 'High' + /// + [JsonProperty(PropertyName = "rehydrationPriority")] + public string RehydrationPriority { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointResource.cs new file mode 100644 index 000000000000..54fc59f12925 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointResource.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup copies. Workload-specific backup copies are + /// derived from this class. + /// + public partial class RecoveryPointResource : Resource + { + /// + /// Initializes a new instance of the RecoveryPointResource class. + /// + public RecoveryPointResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// RecoveryPointResource properties + public RecoveryPointResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), RecoveryPoint properties = default(RecoveryPoint)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets recoveryPointResource properties + /// + [JsonProperty(PropertyName = "properties")] + public RecoveryPoint Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformation.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformation.cs new file mode 100644 index 000000000000..17ee9be8d5f7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformation.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Recovery point tier information. + /// + public partial class RecoveryPointTierInformation + { + /// + /// Initializes a new instance of the RecoveryPointTierInformation + /// class. + /// + public RecoveryPointTierInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointTierInformation + /// class. + /// + /// Recovery point tier type. Possible values + /// include: 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' + /// Recovery point tier status. Possible values + /// include: 'Invalid', 'Valid', 'Disabled', 'Deleted', + /// 'Rehydrated' + /// Recovery point tier status. + public RecoveryPointTierInformation(RecoveryPointTierType? type = default(RecoveryPointTierType?), RecoveryPointTierStatus? status = default(RecoveryPointTierStatus?), IDictionary extendedInfo = default(IDictionary)) + { + Type = type; + Status = status; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets recovery point tier type. Possible values include: + /// 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' + /// + [JsonProperty(PropertyName = "type")] + public RecoveryPointTierType? Type { get; set; } + + /// + /// Gets or sets recovery point tier status. Possible values include: + /// 'Invalid', 'Valid', 'Disabled', 'Deleted', 'Rehydrated' + /// + [JsonProperty(PropertyName = "status")] + public RecoveryPointTierStatus? Status { get; set; } + + /// + /// Gets or sets recovery point tier status. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public IDictionary ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformationV2.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformationV2.cs new file mode 100644 index 000000000000..dc3f086fe31b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformationV2.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// RecoveryPoint Tier Information V2 + /// + public partial class RecoveryPointTierInformationV2 : RecoveryPointTierInformation + { + /// + /// Initializes a new instance of the RecoveryPointTierInformationV2 + /// class. + /// + public RecoveryPointTierInformationV2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointTierInformationV2 + /// class. + /// + /// Recovery point tier type. Possible values + /// include: 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' + /// Recovery point tier status. Possible values + /// include: 'Invalid', 'Valid', 'Disabled', 'Deleted', + /// 'Rehydrated' + /// Recovery point tier status. + public RecoveryPointTierInformationV2(RecoveryPointTierType? type = default(RecoveryPointTierType?), RecoveryPointTierStatus? status = default(RecoveryPointTierStatus?), IDictionary extendedInfo = default(IDictionary)) + : base(type, status, extendedInfo) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierStatus.cs new file mode 100644 index 000000000000..9b061be0214c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierStatus.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for RecoveryPointTierStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum RecoveryPointTierStatus + { + [EnumMember(Value = "Invalid")] + Invalid, + [EnumMember(Value = "Valid")] + Valid, + [EnumMember(Value = "Disabled")] + Disabled, + [EnumMember(Value = "Deleted")] + Deleted, + [EnumMember(Value = "Rehydrated")] + Rehydrated + } + internal static class RecoveryPointTierStatusEnumExtension + { + internal static string ToSerializedValue(this RecoveryPointTierStatus? value) + { + return value == null ? null : ((RecoveryPointTierStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this RecoveryPointTierStatus value) + { + switch( value ) + { + case RecoveryPointTierStatus.Invalid: + return "Invalid"; + case RecoveryPointTierStatus.Valid: + return "Valid"; + case RecoveryPointTierStatus.Disabled: + return "Disabled"; + case RecoveryPointTierStatus.Deleted: + return "Deleted"; + case RecoveryPointTierStatus.Rehydrated: + return "Rehydrated"; + } + return null; + } + + internal static RecoveryPointTierStatus? ParseRecoveryPointTierStatus(this string value) + { + switch( value ) + { + case "Invalid": + return RecoveryPointTierStatus.Invalid; + case "Valid": + return RecoveryPointTierStatus.Valid; + case "Disabled": + return RecoveryPointTierStatus.Disabled; + case "Deleted": + return RecoveryPointTierStatus.Deleted; + case "Rehydrated": + return RecoveryPointTierStatus.Rehydrated; + } + return null; + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierType.cs new file mode 100644 index 000000000000..8f4110892e4e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierType.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for RecoveryPointTierType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum RecoveryPointTierType + { + [EnumMember(Value = "Invalid")] + Invalid, + [EnumMember(Value = "InstantRP")] + InstantRP, + [EnumMember(Value = "HardenedRP")] + HardenedRP, + [EnumMember(Value = "ArchivedRP")] + ArchivedRP + } + internal static class RecoveryPointTierTypeEnumExtension + { + internal static string ToSerializedValue(this RecoveryPointTierType? value) + { + return value == null ? null : ((RecoveryPointTierType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this RecoveryPointTierType value) + { + switch( value ) + { + case RecoveryPointTierType.Invalid: + return "Invalid"; + case RecoveryPointTierType.InstantRP: + return "InstantRP"; + case RecoveryPointTierType.HardenedRP: + return "HardenedRP"; + case RecoveryPointTierType.ArchivedRP: + return "ArchivedRP"; + } + return null; + } + + internal static RecoveryPointTierType? ParseRecoveryPointTierType(this string value) + { + switch( value ) + { + case "Invalid": + return RecoveryPointTierType.Invalid; + case "InstantRP": + return RecoveryPointTierType.InstantRP; + case "HardenedRP": + return RecoveryPointTierType.HardenedRP; + case "ArchivedRP": + return RecoveryPointTierType.ArchivedRP; + } + return null; + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryType.cs new file mode 100644 index 000000000000..389033fc6e6d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryType.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for RecoveryType. + /// + public static class RecoveryType + { + public const string Invalid = "Invalid"; + public const string OriginalLocation = "OriginalLocation"; + public const string AlternateLocation = "AlternateLocation"; + public const string RestoreDisks = "RestoreDisks"; + public const string Offline = "Offline"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RehydrationPriority.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RehydrationPriority.cs new file mode 100644 index 000000000000..2293fff697f7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RehydrationPriority.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for RehydrationPriority. + /// + public static class RehydrationPriority + { + public const string Standard = "Standard"; + public const string High = "High"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Resource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Resource.cs new file mode 100644 index 000000000000..cd7689bb516c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Resource.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ARM Resource. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id represents the complete path to the resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name associated with the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type represents the complete path of the form + /// Namespace/ResourceType/ResourceType/... + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets optional ETag. + /// + [JsonProperty(PropertyName = "eTag")] + public string ETag { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardOperationDetail.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardOperationDetail.cs new file mode 100644 index 000000000000..a22abdf8ec3e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardOperationDetail.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ResourceGuardOperationDetail + { + /// + /// Initializes a new instance of the ResourceGuardOperationDetail + /// class. + /// + public ResourceGuardOperationDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceGuardOperationDetail + /// class. + /// + public ResourceGuardOperationDetail(string vaultCriticalOperation = default(string), string defaultResourceRequest = default(string)) + { + VaultCriticalOperation = vaultCriticalOperation; + DefaultResourceRequest = defaultResourceRequest; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "vaultCriticalOperation")] + public string VaultCriticalOperation { get; set; } + + /// + /// + [JsonProperty(PropertyName = "defaultResourceRequest")] + public string DefaultResourceRequest { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardProxyBase.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardProxyBase.cs new file mode 100644 index 000000000000..9f2b1a84170c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardProxyBase.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class ResourceGuardProxyBase + { + /// + /// Initializes a new instance of the ResourceGuardProxyBase class. + /// + public ResourceGuardProxyBase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceGuardProxyBase class. + /// + public ResourceGuardProxyBase(string resourceGuardResourceId = default(string), IList resourceGuardOperationDetails = default(IList), string lastUpdatedTime = default(string), string description = default(string)) + { + ResourceGuardResourceId = resourceGuardResourceId; + ResourceGuardOperationDetails = resourceGuardOperationDetails; + LastUpdatedTime = lastUpdatedTime; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "resourceGuardResourceId")] + public string ResourceGuardResourceId { get; set; } + + /// + /// + [JsonProperty(PropertyName = "resourceGuardOperationDetails")] + public IList ResourceGuardOperationDetails { get; set; } + + /// + /// + [JsonProperty(PropertyName = "lastUpdatedTime")] + public string LastUpdatedTime { get; set; } + + /// + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardProxyBaseResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardProxyBaseResource.cs new file mode 100644 index 000000000000..3363535a5ca6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceGuardProxyBaseResource.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class ResourceGuardProxyBaseResource : Resource + { + /// + /// Initializes a new instance of the ResourceGuardProxyBaseResource + /// class. + /// + public ResourceGuardProxyBaseResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceGuardProxyBaseResource + /// class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// ResourceGuardProxyBaseResource + /// properties + public ResourceGuardProxyBaseResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), ResourceGuardProxyBase properties = default(ResourceGuardProxyBase)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resourceGuardProxyBaseResource properties + /// + [JsonProperty(PropertyName = "properties")] + public ResourceGuardProxyBase Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceHealthDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceHealthDetails.cs new file mode 100644 index 000000000000..f475dfd42096 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceHealthDetails.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Health Details for backup items. + /// + public partial class ResourceHealthDetails + { + /// + /// Initializes a new instance of the ResourceHealthDetails class. + /// + public ResourceHealthDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceHealthDetails class. + /// + /// Health Code + /// Health Title + /// Health Message + /// Health Recommended Actions + public ResourceHealthDetails(int? code = default(int?), string title = default(string), string message = default(string), IList recommendations = default(IList)) + { + Code = code; + Title = title; + Message = message; + Recommendations = recommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets health Code + /// + [JsonProperty(PropertyName = "code")] + public int? Code { get; private set; } + + /// + /// Gets health Title + /// + [JsonProperty(PropertyName = "title")] + public string Title { get; private set; } + + /// + /// Gets health Message + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets health Recommended Actions + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; private set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceHealthStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceHealthStatus.cs new file mode 100644 index 000000000000..8c14a42e9a72 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceHealthStatus.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for ResourceHealthStatus. + /// + public static class ResourceHealthStatus + { + public const string Healthy = "Healthy"; + public const string TransientDegraded = "TransientDegraded"; + public const string PersistentDegraded = "PersistentDegraded"; + public const string TransientUnhealthy = "TransientUnhealthy"; + public const string PersistentUnhealthy = "PersistentUnhealthy"; + public const string Invalid = "Invalid"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceList.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceList.cs new file mode 100644 index 000000000000..3a01f95d5f6a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ResourceList.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Base for all lists of resources. + /// + public partial class ResourceList + { + /// + /// Initializes a new instance of the ResourceList class. + /// + public ResourceList() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceList class. + /// + /// The uri to fetch the next page of resources. + /// Call ListNext() fetches next page of resources. + public ResourceList(string nextLink = default(string)) + { + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the uri to fetch the next page of resources. Call + /// ListNext() fetches next page of resources. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreFileSpecs.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreFileSpecs.cs new file mode 100644 index 000000000000..fa04c7e6ce72 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreFileSpecs.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Restore file specs like file path, type and target folder path info. + /// + public partial class RestoreFileSpecs + { + /// + /// Initializes a new instance of the RestoreFileSpecs class. + /// + public RestoreFileSpecs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RestoreFileSpecs class. + /// + /// Source File/Folder path + /// Indicates what the Path variable stands + /// for + /// Destination folder path in target + /// FileShare + public RestoreFileSpecs(string path = default(string), string fileSpecType = default(string), string targetFolderPath = default(string)) + { + Path = path; + FileSpecType = fileSpecType; + TargetFolderPath = targetFolderPath; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets source File/Folder path + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + + /// + /// Gets or sets indicates what the Path variable stands for + /// + [JsonProperty(PropertyName = "fileSpecType")] + public string FileSpecType { get; set; } + + /// + /// Gets or sets destination folder path in target FileShare + /// + [JsonProperty(PropertyName = "targetFolderPath")] + public string TargetFolderPath { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestorePointQueryType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestorePointQueryType.cs new file mode 100644 index 000000000000..ccbc6286ec78 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestorePointQueryType.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for RestorePointQueryType. + /// + public static class RestorePointQueryType + { + public const string Invalid = "Invalid"; + public const string Full = "Full"; + public const string Log = "Log"; + public const string Differential = "Differential"; + public const string FullAndDifferential = "FullAndDifferential"; + public const string All = "All"; + public const string Incremental = "Incremental"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestorePointType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestorePointType.cs new file mode 100644 index 000000000000..f1cbe18d8dcf --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestorePointType.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for RestorePointType. + /// + public static class RestorePointType + { + public const string Invalid = "Invalid"; + public const string Full = "Full"; + public const string Log = "Log"; + public const string Differential = "Differential"; + public const string Incremental = "Incremental"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequest.cs new file mode 100644 index 000000000000..fda504750008 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequest.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Base class for restore request. Workload-specific restore requests are + /// derived from this class. + /// + public partial class RestoreRequest + { + /// + /// Initializes a new instance of the RestoreRequest class. + /// + public RestoreRequest() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequestResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequestResource.cs new file mode 100644 index 000000000000..0eddf6f7ee93 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequestResource.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for restore request. Workload-specific restore requests are + /// derived from this class. + /// + public partial class RestoreRequestResource : Resource + { + /// + /// Initializes a new instance of the RestoreRequestResource class. + /// + public RestoreRequestResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RestoreRequestResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// RestoreRequestResource properties + public RestoreRequestResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), RestoreRequest properties = default(RestoreRequest)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets restoreRequestResource properties + /// + [JsonProperty(PropertyName = "properties")] + public RestoreRequest Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequestType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequestType.cs new file mode 100644 index 000000000000..e14ffbe19f5e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RestoreRequestType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for RestoreRequestType. + /// + public static class RestoreRequestType + { + public const string Invalid = "Invalid"; + public const string FullShareRestore = "FullShareRestore"; + public const string ItemLevelRestore = "ItemLevelRestore"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionDuration.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionDuration.cs new file mode 100644 index 000000000000..1d17732ec74f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionDuration.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Retention duration. + /// + public partial class RetentionDuration + { + /// + /// Initializes a new instance of the RetentionDuration class. + /// + public RetentionDuration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RetentionDuration class. + /// + /// Count of duration types. Retention duration is + /// obtained by the counting the duration type Count times. + /// For example, when Count = 3 and DurationType = Weeks, retention + /// duration will be three weeks. + /// Retention duration type of retention + /// policy. Possible values include: 'Invalid', 'Days', 'Weeks', + /// 'Months', 'Years' + public RetentionDuration(int? count = default(int?), string durationType = default(string)) + { + Count = count; + DurationType = durationType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets count of duration types. Retention duration is + /// obtained by the counting the duration type Count times. + /// For example, when Count = 3 and DurationType = Weeks, retention + /// duration will be three weeks. + /// + [JsonProperty(PropertyName = "count")] + public int? Count { get; set; } + + /// + /// Gets or sets retention duration type of retention policy. Possible + /// values include: 'Invalid', 'Days', 'Weeks', 'Months', 'Years' + /// + [JsonProperty(PropertyName = "durationType")] + public string DurationType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionDurationType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionDurationType.cs new file mode 100644 index 000000000000..632c6881fbe9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionDurationType.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for RetentionDurationType. + /// + public static class RetentionDurationType + { + public const string Invalid = "Invalid"; + public const string Days = "Days"; + public const string Weeks = "Weeks"; + public const string Months = "Months"; + public const string Years = "Years"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionPolicy.cs new file mode 100644 index 000000000000..99c2c0d0cbe4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionPolicy.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Base class for retention policy. + /// + public partial class RetentionPolicy + { + /// + /// Initializes a new instance of the RetentionPolicy class. + /// + public RetentionPolicy() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionScheduleFormat.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionScheduleFormat.cs new file mode 100644 index 000000000000..e61a2e019699 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RetentionScheduleFormat.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for RetentionScheduleFormat. + /// + public static class RetentionScheduleFormat + { + public const string Invalid = "Invalid"; + public const string Daily = "Daily"; + public const string Weekly = "Weekly"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectory.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectory.cs new file mode 100644 index 000000000000..b161a8939887 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectory.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// SQLDataDirectory info + /// + public partial class SQLDataDirectory + { + /// + /// Initializes a new instance of the SQLDataDirectory class. + /// + public SQLDataDirectory() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SQLDataDirectory class. + /// + /// Type of data directory mapping. Possible values + /// include: 'Invalid', 'Data', 'Log' + /// File path + /// Logical name of the file + public SQLDataDirectory(string type = default(string), string path = default(string), string logicalName = default(string)) + { + Type = type; + Path = path; + LogicalName = logicalName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of data directory mapping. Possible values + /// include: 'Invalid', 'Data', 'Log' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets file path + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + + /// + /// Gets or sets logical name of the file + /// + [JsonProperty(PropertyName = "logicalName")] + public string LogicalName { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectoryMapping.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectoryMapping.cs new file mode 100644 index 000000000000..69053c0d3b73 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectoryMapping.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Encapsulates information regarding data directory + /// + public partial class SQLDataDirectoryMapping + { + /// + /// Initializes a new instance of the SQLDataDirectoryMapping class. + /// + public SQLDataDirectoryMapping() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SQLDataDirectoryMapping class. + /// + /// Type of data directory mapping. Possible + /// values include: 'Invalid', 'Data', 'Log' + /// Restore source logical name + /// path + /// Restore source path + /// Target path + public SQLDataDirectoryMapping(string mappingType = default(string), string sourceLogicalName = default(string), string sourcePath = default(string), string targetPath = default(string)) + { + MappingType = mappingType; + SourceLogicalName = sourceLogicalName; + SourcePath = sourcePath; + TargetPath = targetPath; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of data directory mapping. Possible values + /// include: 'Invalid', 'Data', 'Log' + /// + [JsonProperty(PropertyName = "mappingType")] + public string MappingType { get; set; } + + /// + /// Gets or sets restore source logical name path + /// + [JsonProperty(PropertyName = "sourceLogicalName")] + public string SourceLogicalName { get; set; } + + /// + /// Gets or sets restore source path + /// + [JsonProperty(PropertyName = "sourcePath")] + public string SourcePath { get; set; } + + /// + /// Gets or sets target path + /// + [JsonProperty(PropertyName = "targetPath")] + public string TargetPath { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectoryType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectoryType.cs new file mode 100644 index 000000000000..d1ca0439af69 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SQLDataDirectoryType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for SQLDataDirectoryType. + /// + public static class SQLDataDirectoryType + { + public const string Invalid = "Invalid"; + public const string Data = "Data"; + public const string Log = "Log"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SchedulePolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SchedulePolicy.cs new file mode 100644 index 000000000000..72b9266436ea --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SchedulePolicy.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Base class for backup schedule. + /// + public partial class SchedulePolicy + { + /// + /// Initializes a new instance of the SchedulePolicy class. + /// + public SchedulePolicy() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ScheduleRunType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ScheduleRunType.cs new file mode 100644 index 000000000000..14ff24041a5c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ScheduleRunType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for ScheduleRunType. + /// + public static class ScheduleRunType + { + public const string Invalid = "Invalid"; + public const string Daily = "Daily"; + public const string Weekly = "Weekly"; + public const string Hourly = "Hourly"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SecurityPinBase.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SecurityPinBase.cs new file mode 100644 index 000000000000..9c878f898694 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SecurityPinBase.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for get security pin request body + /// + public partial class SecurityPinBase + { + /// + /// Initializes a new instance of the SecurityPinBase class. + /// + public SecurityPinBase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityPinBase class. + /// + /// ResourceGuard + /// Operation Requests + public SecurityPinBase(IList resourceGuardOperationRequests = default(IList)) + { + ResourceGuardOperationRequests = resourceGuardOperationRequests; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resourceGuard Operation Requests + /// + [JsonProperty(PropertyName = "resourceGuardOperationRequests")] + public IList ResourceGuardOperationRequests { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Settings.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Settings.cs new file mode 100644 index 000000000000..a59fed460b3c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Settings.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Common settings field for backup management + /// + public partial class Settings + { + /// + /// Initializes a new instance of the Settings class. + /// + public Settings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Settings class. + /// + /// TimeZone optional input as string. For + /// example: TimeZone = "Pacific Standard Time". + /// SQL compression flag + /// Workload compression flag. This has + /// been added so that 'isSqlCompression' + /// will be deprecated once clients upgrade to consider this + /// flag. + public Settings(string timeZone = default(string), bool? issqlcompression = default(bool?), bool? isCompression = default(bool?)) + { + TimeZone = timeZone; + Issqlcompression = issqlcompression; + IsCompression = isCompression; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets timeZone optional input as string. For example: + /// TimeZone = "Pacific Standard Time". + /// + [JsonProperty(PropertyName = "timeZone")] + public string TimeZone { get; set; } + + /// + /// Gets or sets SQL compression flag + /// + [JsonProperty(PropertyName = "issqlcompression")] + public bool? Issqlcompression { get; set; } + + /// + /// Gets or sets workload compression flag. This has been added so that + /// 'isSqlCompression' + /// will be deprecated once clients upgrade to consider this flag. + /// + [JsonProperty(PropertyName = "isCompression")] + public bool? IsCompression { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleRetentionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleRetentionPolicy.cs new file mode 100644 index 000000000000..ef53af923ea6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleRetentionPolicy.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Simple policy retention. + /// + public partial class SimpleRetentionPolicy : RetentionPolicy + { + /// + /// Initializes a new instance of the SimpleRetentionPolicy class. + /// + public SimpleRetentionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SimpleRetentionPolicy class. + /// + /// Retention duration of the + /// protection policy. + public SimpleRetentionPolicy(RetentionDuration retentionDuration = default(RetentionDuration)) + { + RetentionDuration = retentionDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets retention duration of the protection policy. + /// + [JsonProperty(PropertyName = "retentionDuration")] + public RetentionDuration RetentionDuration { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicy.cs new file mode 100644 index 000000000000..24fa6f868808 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicy.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Simple policy schedule. + /// + public partial class SimpleSchedulePolicy : SchedulePolicy + { + /// + /// Initializes a new instance of the SimpleSchedulePolicy class. + /// + public SimpleSchedulePolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SimpleSchedulePolicy class. + /// + /// Frequency of the schedule + /// operation of this policy. Possible values include: 'Invalid', + /// 'Daily', 'Weekly', 'Hourly' + /// List of days of week this schedule + /// has to be run. + /// List of times of day this schedule + /// has to be run. + /// Hourly Schedule of this Policy + /// At every number weeks this + /// schedule has to be run. + public SimpleSchedulePolicy(string scheduleRunFrequency = default(string), IList scheduleRunDays = default(IList), IList scheduleRunTimes = default(IList), HourlySchedule hourlySchedule = default(HourlySchedule), int? scheduleWeeklyFrequency = default(int?)) + { + ScheduleRunFrequency = scheduleRunFrequency; + ScheduleRunDays = scheduleRunDays; + ScheduleRunTimes = scheduleRunTimes; + HourlySchedule = hourlySchedule; + ScheduleWeeklyFrequency = scheduleWeeklyFrequency; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets frequency of the schedule operation of this policy. + /// Possible values include: 'Invalid', 'Daily', 'Weekly', 'Hourly' + /// + [JsonProperty(PropertyName = "scheduleRunFrequency")] + public string ScheduleRunFrequency { get; set; } + + /// + /// Gets or sets list of days of week this schedule has to be run. + /// + [JsonProperty(PropertyName = "scheduleRunDays")] + public IList ScheduleRunDays { get; set; } + + /// + /// Gets or sets list of times of day this schedule has to be run. + /// + [JsonProperty(PropertyName = "scheduleRunTimes")] + public IList ScheduleRunTimes { get; set; } + + /// + /// Gets or sets hourly Schedule of this Policy + /// + [JsonProperty(PropertyName = "hourlySchedule")] + public HourlySchedule HourlySchedule { get; set; } + + /// + /// Gets or sets at every number weeks this schedule has to be run. + /// + [JsonProperty(PropertyName = "scheduleWeeklyFrequency")] + public int? ScheduleWeeklyFrequency { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicyV2.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicyV2.cs new file mode 100644 index 000000000000..13ef04550397 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicyV2.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The V2 policy schedule for IaaS that supports hourly backups. + /// + public partial class SimpleSchedulePolicyV2 : SchedulePolicy + { + /// + /// Initializes a new instance of the SimpleSchedulePolicyV2 class. + /// + public SimpleSchedulePolicyV2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SimpleSchedulePolicyV2 class. + /// + /// Frequency of the schedule + /// operation of this policy. Possible values include: 'Invalid', + /// 'Daily', 'Weekly', 'Hourly' + /// hourly schedule of this policy + /// Daily schedule of this policy + /// Weekly schedule of this policy + public SimpleSchedulePolicyV2(string scheduleRunFrequency = default(string), HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule)) + { + ScheduleRunFrequency = scheduleRunFrequency; + HourlySchedule = hourlySchedule; + DailySchedule = dailySchedule; + WeeklySchedule = weeklySchedule; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets frequency of the schedule operation of this policy. + /// Possible values include: 'Invalid', 'Daily', 'Weekly', 'Hourly' + /// + [JsonProperty(PropertyName = "scheduleRunFrequency")] + public string ScheduleRunFrequency { get; set; } + + /// + /// Gets or sets hourly schedule of this policy + /// + [JsonProperty(PropertyName = "hourlySchedule")] + public HourlySchedule HourlySchedule { get; set; } + + /// + /// Gets or sets daily schedule of this policy + /// + [JsonProperty(PropertyName = "dailySchedule")] + public DailySchedule DailySchedule { get; set; } + + /// + /// Gets or sets weekly schedule of this policy + /// + [JsonProperty(PropertyName = "weeklySchedule")] + public WeeklySchedule WeeklySchedule { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SoftDeleteFeatureState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SoftDeleteFeatureState.cs new file mode 100644 index 000000000000..a5ca830adfb9 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SoftDeleteFeatureState.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for SoftDeleteFeatureState. + /// + public static class SoftDeleteFeatureState + { + public const string Invalid = "Invalid"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/StorageType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/StorageType.cs new file mode 100644 index 000000000000..683d69095d54 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/StorageType.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for StorageType. + /// + public static class StorageType + { + public const string Invalid = "Invalid"; + public const string GeoRedundant = "GeoRedundant"; + public const string LocallyRedundant = "LocallyRedundant"; + public const string ZoneRedundant = "ZoneRedundant"; + public const string ReadAccessGeoZoneRedundant = "ReadAccessGeoZoneRedundant"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/StorageTypeState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/StorageTypeState.cs new file mode 100644 index 000000000000..395e023dc188 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/StorageTypeState.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for StorageTypeState. + /// + public static class StorageTypeState + { + public const string Invalid = "Invalid"; + public const string Locked = "Locked"; + public const string Unlocked = "Unlocked"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SubProtectionPolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SubProtectionPolicy.cs new file mode 100644 index 000000000000..e36626009932 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SubProtectionPolicy.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Sub-protection policy which includes schedule and retention + /// + public partial class SubProtectionPolicy + { + /// + /// Initializes a new instance of the SubProtectionPolicy class. + /// + public SubProtectionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubProtectionPolicy class. + /// + /// Type of backup policy type. Possible + /// values include: 'Invalid', 'Full', 'Differential', 'Log', + /// 'CopyOnlyFull', 'Incremental' + /// Backup schedule specified as part of + /// backup policy. + /// Retention policy with the details on + /// backup copy retention ranges. + public SubProtectionPolicy(string policyType = default(string), SchedulePolicy schedulePolicy = default(SchedulePolicy), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + { + PolicyType = policyType; + SchedulePolicy = schedulePolicy; + RetentionPolicy = retentionPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of backup policy type. Possible values include: + /// 'Invalid', 'Full', 'Differential', 'Log', 'CopyOnlyFull', + /// 'Incremental' + /// + [JsonProperty(PropertyName = "policyType")] + public string PolicyType { get; set; } + + /// + /// Gets or sets backup schedule specified as part of backup policy. + /// + [JsonProperty(PropertyName = "schedulePolicy")] + public SchedulePolicy SchedulePolicy { get; set; } + + /// + /// Gets or sets retention policy with the details on backup copy + /// retention ranges. + /// + [JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SupportStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SupportStatus.cs new file mode 100644 index 000000000000..ff1f47f4a3fa --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SupportStatus.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for SupportStatus. + /// + public static class SupportStatus + { + public const string Invalid = "Invalid"; + public const string Supported = "Supported"; + public const string DefaultOFF = "DefaultOFF"; + public const string DefaultON = "DefaultON"; + public const string NotSupported = "NotSupported"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TargetAFSRestoreInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TargetAFSRestoreInfo.cs new file mode 100644 index 000000000000..09856dd55f26 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TargetAFSRestoreInfo.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Target Azure File Share Info. + /// + public partial class TargetAFSRestoreInfo + { + /// + /// Initializes a new instance of the TargetAFSRestoreInfo class. + /// + public TargetAFSRestoreInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TargetAFSRestoreInfo class. + /// + /// File share name + /// Target file share resource ARM + /// ID + public TargetAFSRestoreInfo(string name = default(string), string targetResourceId = default(string)) + { + Name = name; + TargetResourceId = targetResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets file share name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets target file share resource ARM ID + /// + [JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TargetRestoreInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TargetRestoreInfo.cs new file mode 100644 index 000000000000..579e093b0b60 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TargetRestoreInfo.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details about target workload during restore operation. + /// + public partial class TargetRestoreInfo + { + /// + /// Initializes a new instance of the TargetRestoreInfo class. + /// + public TargetRestoreInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TargetRestoreInfo class. + /// + /// Can Overwrite if Target DataBase + /// already exists. Possible values include: 'Invalid', + /// 'FailOnConflict', 'Overwrite' + /// Resource Id name of the container in + /// which Target DataBase resides + /// Database name InstanceName/DataBaseName + /// for SQL or System/DbName for SAP Hana + /// Target directory + /// location for restore as files. + public TargetRestoreInfo(string overwriteOption = default(string), string containerId = default(string), string databaseName = default(string), string targetDirectoryForFileRestore = default(string)) + { + OverwriteOption = overwriteOption; + ContainerId = containerId; + DatabaseName = databaseName; + TargetDirectoryForFileRestore = targetDirectoryForFileRestore; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets can Overwrite if Target DataBase already exists. + /// Possible values include: 'Invalid', 'FailOnConflict', 'Overwrite' + /// + [JsonProperty(PropertyName = "overwriteOption")] + public string OverwriteOption { get; set; } + + /// + /// Gets or sets resource Id name of the container in which Target + /// DataBase resides + /// + [JsonProperty(PropertyName = "containerId")] + public string ContainerId { get; set; } + + /// + /// Gets or sets database name InstanceName/DataBaseName for SQL or + /// System/DbName for SAP Hana + /// + [JsonProperty(PropertyName = "databaseName")] + public string DatabaseName { get; set; } + + /// + /// Gets or sets target directory location for restore as files. + /// + [JsonProperty(PropertyName = "targetDirectoryForFileRestore")] + public string TargetDirectoryForFileRestore { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TokenInformation.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TokenInformation.cs new file mode 100644 index 000000000000..948722fe7b46 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TokenInformation.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The token information details. + /// + public partial class TokenInformation + { + /// + /// Initializes a new instance of the TokenInformation class. + /// + public TokenInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TokenInformation class. + /// + /// Token value. + /// Expiry time of token. + /// Security PIN + public TokenInformation(string token = default(string), long? expiryTimeInUtcTicks = default(long?), string securityPIN = default(string)) + { + Token = token; + ExpiryTimeInUtcTicks = expiryTimeInUtcTicks; + SecurityPIN = securityPIN; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets token value. + /// + [JsonProperty(PropertyName = "token")] + public string Token { get; set; } + + /// + /// Gets or sets expiry time of token. + /// + [JsonProperty(PropertyName = "expiryTimeInUtcTicks")] + public long? ExpiryTimeInUtcTicks { get; set; } + + /// + /// Gets or sets security PIN + /// + [JsonProperty(PropertyName = "securityPIN")] + public string SecurityPIN { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TriggerDataMoveRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TriggerDataMoveRequest.cs new file mode 100644 index 000000000000..00e7dc56891d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/TriggerDataMoveRequest.cs @@ -0,0 +1,121 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Trigger DataMove Request + /// + public partial class TriggerDataMoveRequest + { + /// + /// Initializes a new instance of the TriggerDataMoveRequest class. + /// + public TriggerDataMoveRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TriggerDataMoveRequest class. + /// + /// ARM Id of source vault + /// Source Region + /// DataMove Level. Possible values + /// include: 'Invalid', 'Vault', 'Container' + /// Correlation Id + /// Source Container ArmIds + /// Pause GC + public TriggerDataMoveRequest(string sourceResourceId, string sourceRegion, string dataMoveLevel, string correlationId, IList sourceContainerArmIds = default(IList), bool? pauseGC = default(bool?)) + { + SourceResourceId = sourceResourceId; + SourceRegion = sourceRegion; + DataMoveLevel = dataMoveLevel; + CorrelationId = correlationId; + SourceContainerArmIds = sourceContainerArmIds; + PauseGC = pauseGC; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ARM Id of source vault + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + /// + /// Gets or sets source Region + /// + [JsonProperty(PropertyName = "sourceRegion")] + public string SourceRegion { get; set; } + + /// + /// Gets or sets dataMove Level. Possible values include: 'Invalid', + /// 'Vault', 'Container' + /// + [JsonProperty(PropertyName = "dataMoveLevel")] + public string DataMoveLevel { get; set; } + + /// + /// Gets or sets correlation Id + /// + [JsonProperty(PropertyName = "correlationId")] + public string CorrelationId { get; set; } + + /// + /// Gets or sets source Container ArmIds + /// + [JsonProperty(PropertyName = "sourceContainerArmIds")] + public IList SourceContainerArmIds { get; set; } + + /// + /// Gets or sets pause GC + /// + [JsonProperty(PropertyName = "pauseGC")] + public bool? PauseGC { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SourceResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SourceResourceId"); + } + if (SourceRegion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SourceRegion"); + } + if (DataMoveLevel == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DataMoveLevel"); + } + if (CorrelationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "CorrelationId"); + } + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Type.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Type.cs new file mode 100644 index 000000000000..7101dd71f497 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/Type.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for Type. + /// + public static class Type + { + public const string Invalid = "Invalid"; + public const string BackupProtectedItemCountSummary = "BackupProtectedItemCountSummary"; + public const string BackupProtectionContainerCountSummary = "BackupProtectionContainerCountSummary"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UnlockDeleteRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UnlockDeleteRequest.cs new file mode 100644 index 000000000000..6d2ba6ffe666 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UnlockDeleteRequest.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Request body of unlock delete API. + /// + public partial class UnlockDeleteRequest + { + /// + /// Initializes a new instance of the UnlockDeleteRequest class. + /// + public UnlockDeleteRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UnlockDeleteRequest class. + /// + public UnlockDeleteRequest(IList resourceGuardOperationRequests = default(IList), string resourceToBeDeleted = default(string)) + { + ResourceGuardOperationRequests = resourceGuardOperationRequests; + ResourceToBeDeleted = resourceToBeDeleted; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "resourceGuardOperationRequests")] + public IList ResourceGuardOperationRequests { get; set; } + + /// + /// + [JsonProperty(PropertyName = "resourceToBeDeleted")] + public string ResourceToBeDeleted { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UnlockDeleteResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UnlockDeleteResponse.cs new file mode 100644 index 000000000000..f24dd0464944 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UnlockDeleteResponse.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response of Unlock Delete API. + /// + public partial class UnlockDeleteResponse + { + /// + /// Initializes a new instance of the UnlockDeleteResponse class. + /// + public UnlockDeleteResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UnlockDeleteResponse class. + /// + /// This is the time when unlock + /// delete privileges will get expired. + public UnlockDeleteResponse(string unlockDeleteExpiryTime = default(string)) + { + UnlockDeleteExpiryTime = unlockDeleteExpiryTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets this is the time when unlock delete privileges will + /// get expired. + /// + [JsonProperty(PropertyName = "unlockDeleteExpiryTime")] + public string UnlockDeleteExpiryTime { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UsagesUnit.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UsagesUnit.cs new file mode 100644 index 000000000000..c4e811af798c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/UsagesUnit.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for UsagesUnit. + /// + public static class UsagesUnit + { + public const string Count = "Count"; + public const string Bytes = "Bytes"; + public const string Seconds = "Seconds"; + public const string Percent = "Percent"; + public const string CountPerSecond = "CountPerSecond"; + public const string BytesPerSecond = "BytesPerSecond"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateIaasVMRestoreOperationRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateIaasVMRestoreOperationRequest.cs new file mode 100644 index 000000000000..2c1908a0f2b8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateIaasVMRestoreOperationRequest.cs @@ -0,0 +1,47 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// AzureRestoreValidation request. + /// + public partial class ValidateIaasVMRestoreOperationRequest : ValidateRestoreOperationRequest + { + /// + /// Initializes a new instance of the + /// ValidateIaasVMRestoreOperationRequest class. + /// + public ValidateIaasVMRestoreOperationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateIaasVMRestoreOperationRequest class. + /// + /// Sets restore request to be + /// validated + public ValidateIaasVMRestoreOperationRequest(RestoreRequest restoreRequest = default(RestoreRequest)) + : base(restoreRequest) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationRequest.cs new file mode 100644 index 000000000000..17ec06d0a7a1 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationRequest.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Base class for validate operation request. + /// + public partial class ValidateOperationRequest + { + /// + /// Initializes a new instance of the ValidateOperationRequest class. + /// + public ValidateOperationRequest() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationResponse.cs new file mode 100644 index 000000000000..31b5a85d5963 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationResponse.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for validate operation response. + /// + public partial class ValidateOperationResponse + { + /// + /// Initializes a new instance of the ValidateOperationResponse class. + /// + public ValidateOperationResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidateOperationResponse class. + /// + /// Gets the validation result + public ValidateOperationResponse(IList validationResults = default(IList)) + { + ValidationResults = validationResults; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the validation result + /// + [JsonProperty(PropertyName = "validationResults")] + public IList ValidationResults { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationsResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationsResponse.cs new file mode 100644 index 000000000000..01ab2dc3109f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateOperationsResponse.cs @@ -0,0 +1,46 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ValidateOperationsResponse + { + /// + /// Initializes a new instance of the ValidateOperationsResponse class. + /// + public ValidateOperationsResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidateOperationsResponse class. + /// + public ValidateOperationsResponse(ValidateOperationResponse validateOperationResponse = default(ValidateOperationResponse)) + { + ValidateOperationResponse = validateOperationResponse; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "validateOperationResponse")] + public ValidateOperationResponse ValidateOperationResponse { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateRestoreOperationRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateRestoreOperationRequest.cs new file mode 100644 index 000000000000..34fa1163e48a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidateRestoreOperationRequest.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// AzureRestoreValidation request. + /// + public partial class ValidateRestoreOperationRequest : ValidateOperationRequest + { + /// + /// Initializes a new instance of the ValidateRestoreOperationRequest + /// class. + /// + public ValidateRestoreOperationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidateRestoreOperationRequest + /// class. + /// + /// Sets restore request to be + /// validated + public ValidateRestoreOperationRequest(RestoreRequest restoreRequest = default(RestoreRequest)) + { + RestoreRequest = restoreRequest; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets sets restore request to be validated + /// + [JsonProperty(PropertyName = "restoreRequest")] + public RestoreRequest RestoreRequest { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidationStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidationStatus.cs new file mode 100644 index 000000000000..fe8953b1117f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ValidationStatus.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for ValidationStatus. + /// + public static class ValidationStatus + { + public const string Invalid = "Invalid"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJob.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJob.cs new file mode 100644 index 000000000000..c88db6f4e5d3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJob.cs @@ -0,0 +1,94 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Vault level Job + /// + public partial class VaultJob : Job + { + /// + /// Initializes a new instance of the VaultJob class. + /// + public VaultJob() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VaultJob class. + /// + /// Friendly name of the entity on + /// which the current job is executing. + /// Backup management type to + /// execute the current job. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// The operation name. + /// Job status. + /// The start time. + /// The end time. + /// ActivityId of job. + /// Time elapsed during the execution of this + /// job. + /// Gets or sets the state/actions applicable + /// on this job like cancel/retry. + /// Error details on execution of this + /// job. + /// Additional information about the + /// job. + public VaultJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList actionsInfo = default(IList), IList errorDetails = default(IList), VaultJobExtendedInfo extendedInfo = default(VaultJobExtendedInfo)) + : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) + { + Duration = duration; + ActionsInfo = actionsInfo; + ErrorDetails = errorDetails; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets time elapsed during the execution of this job. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets the state/actions applicable on this job like + /// cancel/retry. + /// + [JsonProperty(PropertyName = "actionsInfo")] + public IList ActionsInfo { get; set; } + + /// + /// Gets or sets error details on execution of this job. + /// + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; set; } + + /// + /// Gets or sets additional information about the job. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public VaultJobExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJobErrorInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJobErrorInfo.cs new file mode 100644 index 000000000000..07e5c8a0f16f --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJobErrorInfo.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Vault Job specific error information + /// + public partial class VaultJobErrorInfo + { + /// + /// Initializes a new instance of the VaultJobErrorInfo class. + /// + public VaultJobErrorInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VaultJobErrorInfo class. + /// + /// Error code. + /// Localized error string. + /// List of localized recommendations for + /// above error code. + public VaultJobErrorInfo(int? errorCode = default(int?), string errorString = default(string), IList recommendations = default(IList)) + { + ErrorCode = errorCode; + ErrorString = errorString; + Recommendations = recommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code. + /// + [JsonProperty(PropertyName = "errorCode")] + public int? ErrorCode { get; set; } + + /// + /// Gets or sets localized error string. + /// + [JsonProperty(PropertyName = "errorString")] + public string ErrorString { get; set; } + + /// + /// Gets or sets list of localized recommendations for above error + /// code. + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJobExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJobExtendedInfo.cs new file mode 100644 index 000000000000..12a3c06154d3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultJobExtendedInfo.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Vault Job for CMK - has CMK specific info. + /// + public partial class VaultJobExtendedInfo + { + /// + /// Initializes a new instance of the VaultJobExtendedInfo class. + /// + public VaultJobExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VaultJobExtendedInfo class. + /// + /// Job properties. + public VaultJobExtendedInfo(IDictionary propertyBag = default(IDictionary)) + { + PropertyBag = propertyBag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets job properties. + /// + [JsonProperty(PropertyName = "propertyBag")] + public IDictionary PropertyBag { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultStorageConfigOperationResultResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultStorageConfigOperationResultResponse.cs new file mode 100644 index 000000000000..33d5948a0c8c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/VaultStorageConfigOperationResultResponse.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Operation result response for Vault Storage Config + /// + public partial class VaultStorageConfigOperationResultResponse + { + /// + /// Initializes a new instance of the + /// VaultStorageConfigOperationResultResponse class. + /// + public VaultStorageConfigOperationResultResponse() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeekOfMonth.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeekOfMonth.cs new file mode 100644 index 000000000000..7da2d759c2d1 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeekOfMonth.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for WeekOfMonth. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum WeekOfMonth + { + [EnumMember(Value = "First")] + First, + [EnumMember(Value = "Second")] + Second, + [EnumMember(Value = "Third")] + Third, + [EnumMember(Value = "Fourth")] + Fourth, + [EnumMember(Value = "Last")] + Last, + [EnumMember(Value = "Invalid")] + Invalid + } + internal static class WeekOfMonthEnumExtension + { + internal static string ToSerializedValue(this WeekOfMonth? value) + { + return value == null ? null : ((WeekOfMonth)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this WeekOfMonth value) + { + switch( value ) + { + case WeekOfMonth.First: + return "First"; + case WeekOfMonth.Second: + return "Second"; + case WeekOfMonth.Third: + return "Third"; + case WeekOfMonth.Fourth: + return "Fourth"; + case WeekOfMonth.Last: + return "Last"; + case WeekOfMonth.Invalid: + return "Invalid"; + } + return null; + } + + internal static WeekOfMonth? ParseWeekOfMonth(this string value) + { + switch( value ) + { + case "First": + return WeekOfMonth.First; + case "Second": + return WeekOfMonth.Second; + case "Third": + return WeekOfMonth.Third; + case "Fourth": + return WeekOfMonth.Fourth; + case "Last": + return WeekOfMonth.Last; + case "Invalid": + return WeekOfMonth.Invalid; + } + return null; + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklyRetentionFormat.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklyRetentionFormat.cs new file mode 100644 index 000000000000..97aa49b76fc7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklyRetentionFormat.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Weekly retention format. + /// + public partial class WeeklyRetentionFormat + { + /// + /// Initializes a new instance of the WeeklyRetentionFormat class. + /// + public WeeklyRetentionFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeeklyRetentionFormat class. + /// + /// List of days of the week. + /// List of weeks of month. + public WeeklyRetentionFormat(IList daysOfTheWeek = default(IList), IList weeksOfTheMonth = default(IList)) + { + DaysOfTheWeek = daysOfTheWeek; + WeeksOfTheMonth = weeksOfTheMonth; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of days of the week. + /// + [JsonProperty(PropertyName = "daysOfTheWeek")] + public IList DaysOfTheWeek { get; set; } + + /// + /// Gets or sets list of weeks of month. + /// + [JsonProperty(PropertyName = "weeksOfTheMonth")] + public IList WeeksOfTheMonth { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklyRetentionSchedule.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklyRetentionSchedule.cs new file mode 100644 index 000000000000..2f1f7d573958 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklyRetentionSchedule.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Weekly retention schedule. + /// + public partial class WeeklyRetentionSchedule + { + /// + /// Initializes a new instance of the WeeklyRetentionSchedule class. + /// + public WeeklyRetentionSchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeeklyRetentionSchedule class. + /// + /// List of days of week for weekly + /// retention policy. + /// Retention times of retention + /// policy. + /// Retention duration of retention + /// Policy. + public WeeklyRetentionSchedule(IList daysOfTheWeek = default(IList), IList retentionTimes = default(IList), RetentionDuration retentionDuration = default(RetentionDuration)) + { + DaysOfTheWeek = daysOfTheWeek; + RetentionTimes = retentionTimes; + RetentionDuration = retentionDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of days of week for weekly retention policy. + /// + [JsonProperty(PropertyName = "daysOfTheWeek")] + public IList DaysOfTheWeek { get; set; } + + /// + /// Gets or sets retention times of retention policy. + /// + [JsonProperty(PropertyName = "retentionTimes")] + public IList RetentionTimes { get; set; } + + /// + /// Gets or sets retention duration of retention Policy. + /// + [JsonProperty(PropertyName = "retentionDuration")] + public RetentionDuration RetentionDuration { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklySchedule.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklySchedule.cs new file mode 100644 index 000000000000..23297eb9d625 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WeeklySchedule.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class WeeklySchedule + { + /// + /// Initializes a new instance of the WeeklySchedule class. + /// + public WeeklySchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeeklySchedule class. + /// + /// List of times of day this schedule + /// has to be run. + public WeeklySchedule(IList scheduleRunDays = default(IList), IList scheduleRunTimes = default(IList)) + { + ScheduleRunDays = scheduleRunDays; + ScheduleRunTimes = scheduleRunTimes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "scheduleRunDays")] + public IList ScheduleRunDays { get; set; } + + /// + /// Gets or sets list of times of day this schedule has to be run. + /// + [JsonProperty(PropertyName = "scheduleRunTimes")] + public IList ScheduleRunTimes { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadInquiryDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadInquiryDetails.cs new file mode 100644 index 000000000000..5565de8033ce --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadInquiryDetails.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details of an inquired protectable item. + /// + public partial class WorkloadInquiryDetails + { + /// + /// Initializes a new instance of the WorkloadInquiryDetails class. + /// + public WorkloadInquiryDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadInquiryDetails class. + /// + /// Type of the Workload such as SQL, Oracle + /// etc. + /// Contains the protectable item Count inside + /// this Container. + /// Inquiry validation such as + /// permissions and other backup validations. + public WorkloadInquiryDetails(string type = default(string), long? itemCount = default(long?), InquiryValidation inquiryValidation = default(InquiryValidation)) + { + Type = type; + ItemCount = itemCount; + InquiryValidation = inquiryValidation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of the Workload such as SQL, Oracle etc. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets contains the protectable item Count inside this + /// Container. + /// + [JsonProperty(PropertyName = "itemCount")] + public long? ItemCount { get; set; } + + /// + /// Gets or sets inquiry validation such as permissions and other + /// backup validations. + /// + [JsonProperty(PropertyName = "inquiryValidation")] + public InquiryValidation InquiryValidation { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItem.cs new file mode 100644 index 000000000000..cc4c1d81d7cc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItem.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Base class for backup item. Workload-specific backup items are derived + /// from this class. + /// + public partial class WorkloadItem + { + /// + /// Initializes a new instance of the WorkloadItem class. + /// + public WorkloadItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + public WorkloadItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string)) + { + BackupManagementType = backupManagementType; + WorkloadType = workloadType; + FriendlyName = friendlyName; + ProtectionState = protectionState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of backup management to backup an item. + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets type of workload for the backup management + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + /// + /// Gets or sets friendly name of the backup item. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets state of the back up item. Possible values include: + /// 'Invalid', 'NotProtected', 'Protecting', 'Protected', + /// 'ProtectionFailed' + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItemResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItemResource.cs new file mode 100644 index 000000000000..8e8beebf8ea3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItemResource.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup item. Workload-specific backup items are derived + /// from this class. + /// + public partial class WorkloadItemResource : Resource + { + /// + /// Initializes a new instance of the WorkloadItemResource class. + /// + public WorkloadItemResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadItemResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// WorkloadItemResource properties + public WorkloadItemResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), WorkloadItem properties = default(WorkloadItem)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets workloadItemResource properties + /// + [JsonProperty(PropertyName = "properties")] + public WorkloadItem Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItemType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItemType.cs new file mode 100644 index 000000000000..4abc640e6037 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadItemType.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for WorkloadItemType. + /// + public static class WorkloadItemType + { + public const string Invalid = "Invalid"; + public const string SQLInstance = "SQLInstance"; + public const string SQLDataBase = "SQLDataBase"; + public const string SAPHanaSystem = "SAPHanaSystem"; + public const string SAPHanaDatabase = "SAPHanaDatabase"; + public const string SAPAseSystem = "SAPAseSystem"; + public const string SAPAseDatabase = "SAPAseDatabase"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadProtectableItem.cs new file mode 100644 index 000000000000..3c491cdb4e0b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadProtectableItem.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Base class for backup item. Workload-specific backup items are derived + /// from this class. + /// + public partial class WorkloadProtectableItem + { + /// + /// Initializes a new instance of the WorkloadProtectableItem class. + /// + public WorkloadProtectableItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadProtectableItem class. + /// + /// Type of backup management to + /// backup an item. + /// Type of workload for the backup + /// management + /// Friendly name of the backup + /// item. + /// State of the back up item. Possible + /// values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + public WorkloadProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string)) + { + BackupManagementType = backupManagementType; + WorkloadType = workloadType; + FriendlyName = friendlyName; + ProtectionState = protectionState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of backup management to backup an item. + /// + [JsonProperty(PropertyName = "backupManagementType")] + public string BackupManagementType { get; set; } + + /// + /// Gets or sets type of workload for the backup management + /// + [JsonProperty(PropertyName = "workloadType")] + public string WorkloadType { get; set; } + + /// + /// Gets or sets friendly name of the backup item. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets state of the back up item. Possible values include: + /// 'Invalid', 'NotProtected', 'Protecting', 'Protected', + /// 'ProtectionFailed' + /// + [JsonProperty(PropertyName = "protectionState")] + public string ProtectionState { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadProtectableItemResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadProtectableItemResource.cs new file mode 100644 index 000000000000..ee5d9e90c4f7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadProtectableItemResource.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for backup item. Workload-specific backup items are derived + /// from this class. + /// + public partial class WorkloadProtectableItemResource : Resource + { + /// + /// Initializes a new instance of the WorkloadProtectableItemResource + /// class. + /// + public WorkloadProtectableItemResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadProtectableItemResource + /// class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Resource location. + /// Resource tags. + /// Optional ETag. + /// WorkloadProtectableItemResource + /// properties + public WorkloadProtectableItemResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), WorkloadProtectableItem properties = default(WorkloadProtectableItem)) + : base(id, name, type, location, tags, eTag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets workloadProtectableItemResource properties + /// + [JsonProperty(PropertyName = "properties")] + public WorkloadProtectableItem Properties { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadType.cs new file mode 100644 index 000000000000..2865294a819a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadType.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for WorkloadType. + /// + public static class WorkloadType + { + public const string Invalid = "Invalid"; + public const string VM = "VM"; + public const string FileFolder = "FileFolder"; + public const string AzureSqlDb = "AzureSqlDb"; + public const string SQLDB = "SQLDB"; + public const string Exchange = "Exchange"; + public const string Sharepoint = "Sharepoint"; + public const string VMwareVM = "VMwareVM"; + public const string SystemState = "SystemState"; + public const string Client = "Client"; + public const string GenericDataSource = "GenericDataSource"; + public const string SQLDataBase = "SQLDataBase"; + public const string AzureFileShare = "AzureFileShare"; + public const string SAPHanaDatabase = "SAPHanaDatabase"; + public const string SAPAseDatabase = "SAPAseDatabase"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/XcoolState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/XcoolState.cs new file mode 100644 index 000000000000..ad291f75db70 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/XcoolState.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for XcoolState. + /// + public static class XcoolState + { + public const string Invalid = "Invalid"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/YearlyRetentionSchedule.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/YearlyRetentionSchedule.cs new file mode 100644 index 000000000000..8a25b6169246 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/YearlyRetentionSchedule.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Yearly retention schedule. + /// + public partial class YearlyRetentionSchedule + { + /// + /// Initializes a new instance of the YearlyRetentionSchedule class. + /// + public YearlyRetentionSchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the YearlyRetentionSchedule class. + /// + /// Retention schedule format + /// for yearly retention policy. Possible values include: 'Invalid', + /// 'Daily', 'Weekly' + /// List of months of year of yearly + /// retention policy. + /// Daily retention format for + /// yearly retention policy. + /// Weekly retention format for + /// yearly retention policy. + /// Retention times of retention + /// policy. + /// Retention duration of retention + /// Policy. + public YearlyRetentionSchedule(string retentionScheduleFormatType = default(string), IList monthsOfYear = default(IList), DailyRetentionFormat retentionScheduleDaily = default(DailyRetentionFormat), WeeklyRetentionFormat retentionScheduleWeekly = default(WeeklyRetentionFormat), IList retentionTimes = default(IList), RetentionDuration retentionDuration = default(RetentionDuration)) + { + RetentionScheduleFormatType = retentionScheduleFormatType; + MonthsOfYear = monthsOfYear; + RetentionScheduleDaily = retentionScheduleDaily; + RetentionScheduleWeekly = retentionScheduleWeekly; + RetentionTimes = retentionTimes; + RetentionDuration = retentionDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets retention schedule format for yearly retention policy. + /// Possible values include: 'Invalid', 'Daily', 'Weekly' + /// + [JsonProperty(PropertyName = "retentionScheduleFormatType")] + public string RetentionScheduleFormatType { get; set; } + + /// + /// Gets or sets list of months of year of yearly retention policy. + /// + [JsonProperty(PropertyName = "monthsOfYear")] + public IList MonthsOfYear { get; set; } + + /// + /// Gets or sets daily retention format for yearly retention policy. + /// + [JsonProperty(PropertyName = "retentionScheduleDaily")] + public DailyRetentionFormat RetentionScheduleDaily { get; set; } + + /// + /// Gets or sets weekly retention format for yearly retention policy. + /// + [JsonProperty(PropertyName = "retentionScheduleWeekly")] + public WeeklyRetentionFormat RetentionScheduleWeekly { get; set; } + + /// + /// Gets or sets retention times of retention policy. + /// + [JsonProperty(PropertyName = "retentionTimes")] + public IList RetentionTimes { get; set; } + + /// + /// Gets or sets retention duration of retention Policy. + /// + [JsonProperty(PropertyName = "retentionDuration")] + public RetentionDuration RetentionDuration { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperations.cs new file mode 100644 index 000000000000..bdd0d7478de2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperations.cs @@ -0,0 +1,266 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationOperations operations. + /// + internal partial class OperationOperations : IServiceOperations, IOperationOperations + { + /// + /// Initializes a new instance of the OperationOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OperationOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Validate operation for specified backed up item. This is a synchronous + /// operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ValidateWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Validate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperation").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperationsExtensions.cs new file mode 100644 index 000000000000..089b59a0cd67 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperationsExtensions.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationOperations. + /// + public static partial class OperationOperationsExtensions + { + /// + /// Validate operation for specified backed up item. This is a synchronous + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + public static ValidateOperationsResponse Validate(this IOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters) + { + return operations.ValidateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validate operation for specified backed up item. This is a synchronous + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// The cancellation token. + /// + public static async Task ValidateAsync(this IOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Operations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Operations.cs new file mode 100644 index 000000000000..8fcf9ee3a356 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Operations.cs @@ -0,0 +1,400 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Returns the list of available operations. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.RecoveryServices/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns the list of available operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..f9c88a1ae24b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Returns the list of available operations. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Returns the list of available operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns the list of available operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of available operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs new file mode 100644 index 000000000000..ddfee88600a1 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs @@ -0,0 +1,735 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionOperations operations. + /// + internal partial class PrivateEndpointConnectionOperations : IServiceOperations, IPrivateEndpointConnectionOperations + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Get Private Endpoint Connection. This call is made by Backup Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Approve or Reject Private Endpoint requests. This call is made by Backup + /// Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Request body for operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginPutWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete Private Endpoint requests. This call is made by Backup Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Approve or Reject Private Endpoint requests. This call is made by Backup + /// Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Request body for operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginPutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginPut", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete Private Endpoint requests. This call is made by Backup Admin. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperationsExtensions.cs new file mode 100644 index 000000000000..be7842580498 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperationsExtensions.cs @@ -0,0 +1,275 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateEndpointConnectionOperations. + /// + public static partial class PrivateEndpointConnectionOperationsExtensions + { + /// + /// Get Private Endpoint Connection. This call is made by Backup Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + public static PrivateEndpointConnectionResource Get(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName) + { + return operations.GetAsync(vaultName, resourceGroupName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Get Private Endpoint Connection. This call is made by Backup Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Approve or Reject Private Endpoint requests. This call is made by Backup + /// Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Request body for operation + /// + public static PrivateEndpointConnectionResource Put(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters) + { + return operations.PutAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Approve or Reject Private Endpoint requests. This call is made by Backup + /// Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Request body for operation + /// + /// + /// The cancellation token. + /// + public static async Task PutAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete Private Endpoint requests. This call is made by Backup Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + public static void Delete(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName) + { + operations.DeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete Private Endpoint requests. This call is made by Backup Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Approve or Reject Private Endpoint requests. This call is made by Backup + /// Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Request body for operation + /// + public static PrivateEndpointConnectionResource BeginPut(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters) + { + return operations.BeginPutAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Approve or Reject Private Endpoint requests. This call is made by Backup + /// Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Request body for operation + /// + /// + /// The cancellation token. + /// + public static async Task BeginPutAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginPutWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete Private Endpoint requests. This call is made by Backup Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + public static void BeginDelete(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName) + { + operations.BeginDeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete Private Endpoint requests. This call is made by Backup Admin. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperations.cs new file mode 100644 index 000000000000..3693642013b0 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperations.cs @@ -0,0 +1,264 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointOperations operations. + /// + internal partial class PrivateEndpointOperations : IServiceOperations, IPrivateEndpointOperations + { + /// + /// Initializes a new instance of the PrivateEndpointOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateEndpointOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Gets the operation status for a private endpoint connection. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Operation id + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetOperationStatusWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetOperationStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperationsExtensions.cs new file mode 100644 index 000000000000..42f4bfcfd9bc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperationsExtensions.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateEndpointOperations. + /// + public static partial class PrivateEndpointOperationsExtensions + { + /// + /// Gets the operation status for a private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Operation id + /// + public static OperationStatus GetOperationStatus(this IPrivateEndpointOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, string operationId) + { + return operations.GetOperationStatusAsync(vaultName, resourceGroupName, privateEndpointConnectionName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets the operation status for a private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// Operation id + /// + /// + /// The cancellation token. + /// + public static async Task GetOperationStatusAsync(this IPrivateEndpointOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperations.cs new file mode 100644 index 000000000000..182d62bc66e5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperations.cs @@ -0,0 +1,445 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectableContainersOperations operations. + /// + internal partial class ProtectableContainersOperations : IServiceOperations, IProtectableContainersOperations + { + /// + /// Initializes a new instance of the ProtectableContainersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectableContainersOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Lists the containers that can be registered to Recovery Services Vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the containers that can be registered to Recovery Services Vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperationsExtensions.cs new file mode 100644 index 000000000000..0d8c4e0d984c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperationsExtensions.cs @@ -0,0 +1,112 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectableContainersOperations. + /// + public static partial class ProtectableContainersOperationsExtensions + { + /// + /// Lists the containers that can be registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this IProtectableContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(vaultName, resourceGroupName, fabricName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Lists the containers that can be registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IProtectableContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the containers that can be registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IProtectableContainersOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the containers that can be registered to Recovery Services Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IProtectableContainersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs new file mode 100644 index 000000000000..2b55708dd71e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs @@ -0,0 +1,288 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectedItemOperationResultsOperations operations. + /// + internal partial class ProtectedItemOperationResultsOperations : IServiceOperations, IProtectedItemOperationResultsOperations + { + /// + /// Initializes a new instance of the ProtectedItemOperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches the result of any operation on the backup item. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item name whose details are to be fetched. + /// + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..0f571a4271b2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperationsExtensions.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectedItemOperationResultsOperations. + /// + public static partial class ProtectedItemOperationResultsOperationsExtensions + { + /// + /// Fetches the result of any operation on the backup item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item name whose details are to be fetched. + /// + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. + /// + public static ProtectedItemResource Get(this IProtectedItemOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches the result of any operation on the backup item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item name whose details are to be fetched. + /// + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectedItemOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs new file mode 100644 index 000000000000..70ad6042349b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs @@ -0,0 +1,292 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectedItemOperationStatusesOperations operations. + /// + internal partial class ProtectedItemOperationStatusesOperations : IServiceOperations, IProtectedItemOperationStatusesOperations + { + /// + /// Initializes a new instance of the ProtectedItemOperationStatusesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches the status of an operation such as triggering a backup, restore. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. Some operations + /// create jobs. This method returns the list of jobs associated with the + /// operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item name whose details are to be fetched. + /// + /// + /// OperationID represents the operation whose status needs to be fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperationsExtensions.cs new file mode 100644 index 000000000000..bbf23d1cbb2e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperationsExtensions.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectedItemOperationStatusesOperations. + /// + public static partial class ProtectedItemOperationStatusesOperationsExtensions + { + /// + /// Fetches the status of an operation such as triggering a backup, restore. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. Some operations + /// create jobs. This method returns the list of jobs associated with the + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item name whose details are to be fetched. + /// + /// + /// OperationID represents the operation whose status needs to be fetched. + /// + public static OperationStatus Get(this IProtectedItemOperationStatusesOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches the status of an operation such as triggering a backup, restore. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. Some operations + /// create jobs. This method returns the list of jobs associated with the + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Backup item name whose details are to be fetched. + /// + /// + /// OperationID represents the operation whose status needs to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectedItemOperationStatusesOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs new file mode 100644 index 000000000000..12e1054f69cd --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs @@ -0,0 +1,739 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectedItemsOperations operations. + /// + internal partial class ProtectedItemsOperations : IServiceOperations, IProtectedItemsOperations + { + /// + /// Initializes a new instance of the ProtectedItemsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectedItemsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides the details of the backed up item. This is an asynchronous + /// operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Enables backup of an item or to modifies the backup policy information of + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Item name to be backed up. + /// + /// + /// resource backed up item + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Used to disable backup of an item within a container. This is an + /// asynchronous operation. To know the status of the + /// request, call the GetItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item to be deleted. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperationsExtensions.cs new file mode 100644 index 000000000000..1ac6b7fff393 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperationsExtensions.cs @@ -0,0 +1,229 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectedItemsOperations. + /// + public static partial class ProtectedItemsOperationsExtensions + { + /// + /// Provides the details of the backed up item. This is an asynchronous + /// operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// OData parameters to apply to the operation. + /// + public static ProtectedItemResource Get(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.GetAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Provides the details of the backed up item. This is an asynchronous + /// operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Enables backup of an item or to modifies the backup policy information of + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Item name to be backed up. + /// + /// + /// resource backed up item + /// + public static ProtectedItemResource CreateOrUpdate(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters) + { + return operations.CreateOrUpdateAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Enables backup of an item or to modifies the backup policy information of + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Container name associated with the backup item. + /// + /// + /// Item name to be backed up. + /// + /// + /// resource backed up item + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Used to disable backup of an item within a container. This is an + /// asynchronous operation. To know the status of the + /// request, call the GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item to be deleted. + /// + public static void Delete(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName) + { + operations.DeleteAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).GetAwaiter().GetResult(); + } + + /// + /// Used to disable backup of an item within a container. This is an + /// asynchronous operation. To know the status of the + /// request, call the GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs new file mode 100644 index 000000000000..bd46e2530e0d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs @@ -0,0 +1,279 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionContainerOperationResultsOperations operations. + /// + internal partial class ProtectionContainerOperationResultsOperations : IServiceOperations, IProtectionContainerOperationResultsOperations + { + /// + /// Initializes a new instance of the ProtectionContainerOperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches the result of any operation on the container. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Container name whose information should be fetched. + /// + /// + /// Operation ID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..11fb97b0716c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectionContainerOperationResultsOperations. + /// + public static partial class ProtectionContainerOperationResultsOperationsExtensions + { + /// + /// Fetches the result of any operation on the container. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Container name whose information should be fetched. + /// + /// + /// Operation ID which represents the operation whose result needs to be + /// fetched. + /// + public static ProtectionContainerResource Get(this IProtectionContainerOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, fabricName, containerName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches the result of any operation on the container. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Container name whose information should be fetched. + /// + /// + /// Operation ID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectionContainerOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs new file mode 100644 index 000000000000..88c4a58053da --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs @@ -0,0 +1,250 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionContainerRefreshOperationResultsOperations operations. + /// + internal partial class ProtectionContainerRefreshOperationResultsOperations : IServiceOperations, IProtectionContainerRefreshOperationResultsOperations + { + /// + /// Initializes a new instance of the ProtectionContainerRefreshOperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides the result of the refresh operation triggered by the BeginRefresh + /// operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Operation ID associated with the operation whose result needs to be + /// fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..bc77e5181c92 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperationsExtensions.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectionContainerRefreshOperationResultsOperations. + /// + public static partial class ProtectionContainerRefreshOperationResultsOperationsExtensions + { + /// + /// Provides the result of the refresh operation triggered by the BeginRefresh + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Operation ID associated with the operation whose result needs to be + /// fetched. + /// + public static void Get(this IProtectionContainerRefreshOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string operationId) + { + operations.GetAsync(vaultName, resourceGroupName, fabricName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Provides the result of the refresh operation triggered by the BeginRefresh + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Operation ID associated with the operation whose result needs to be + /// fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectionContainerRefreshOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs new file mode 100644 index 000000000000..bb00cd47dbcd --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs @@ -0,0 +1,1111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionContainersOperations operations. + /// + internal partial class ProtectionContainersOperations : IServiceOperations, IProtectionContainersOperations + { + /// + /// Initializes a new instance of the ProtectionContainersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectionContainersOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Gets details of the specific container registered to your Recovery Services + /// Vault. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the fabric where the container belongs. + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Name of the container to be registered. + /// + /// + /// Request body for operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> RegisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Register", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Unregisters the given container from your Recovery Services Vault. This is + /// an asynchronous operation. To determine + /// whether the backend service has finished processing the request, call Get + /// Container Operation Result API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the fabric where the container belongs. + /// + /// + /// Name of the container which needs to be unregistered from the Recovery + /// Services Vault. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task UnregisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Unregister", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Inquires all the protectable items under the given container. + /// + /// + /// This is an async operation and the results should be tracked using location + /// header or Azure-async-url. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric Name associated with the container. + /// + /// + /// Name of the container in which inquiry needs to be triggered. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task InquireWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Inquire", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Discovers all the containers in the subscription that can be backed up to + /// Recovery Services Vault. This is an + /// asynchronous operation. To know the status of the operation, call + /// GetRefreshOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated the container. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task RefreshWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Refresh", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperationsExtensions.cs new file mode 100644 index 000000000000..483d4ce0ba1b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperationsExtensions.cs @@ -0,0 +1,329 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectionContainersOperations. + /// + public static partial class ProtectionContainersOperationsExtensions + { + /// + /// Gets details of the specific container registered to your Recovery Services + /// Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the fabric where the container belongs. + /// + /// + /// Name of the container whose details need to be fetched. + /// + public static ProtectionContainerResource Get(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName) + { + return operations.GetAsync(vaultName, resourceGroupName, fabricName, containerName).GetAwaiter().GetResult(); + } + + /// + /// Gets details of the specific container registered to your Recovery Services + /// Vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the fabric where the container belongs. + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Name of the container to be registered. + /// + /// + /// Request body for operation + /// + public static ProtectionContainerResource Register(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters) + { + return operations.RegisterAsync(vaultName, resourceGroupName, fabricName, containerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the container. + /// + /// + /// Name of the container to be registered. + /// + /// + /// Request body for operation + /// + /// + /// The cancellation token. + /// + public static async Task RegisterAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RegisterWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Unregisters the given container from your Recovery Services Vault. This is + /// an asynchronous operation. To determine + /// whether the backend service has finished processing the request, call Get + /// Container Operation Result API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the fabric where the container belongs. + /// + /// + /// Name of the container which needs to be unregistered from the Recovery + /// Services Vault. + /// + public static void Unregister(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName) + { + operations.UnregisterAsync(vaultName, resourceGroupName, fabricName, containerName).GetAwaiter().GetResult(); + } + + /// + /// Unregisters the given container from your Recovery Services Vault. This is + /// an asynchronous operation. To determine + /// whether the backend service has finished processing the request, call Get + /// Container Operation Result API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Name of the fabric where the container belongs. + /// + /// + /// Name of the container which needs to be unregistered from the Recovery + /// Services Vault. + /// + /// + /// The cancellation token. + /// + public static async Task UnregisterAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.UnregisterWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Inquires all the protectable items under the given container. + /// + /// + /// This is an async operation and the results should be tracked using location + /// header or Azure-async-url. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric Name associated with the container. + /// + /// + /// Name of the container in which inquiry needs to be triggered. + /// + /// + /// OData parameters to apply to the operation. + /// + public static void Inquire(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery)) + { + operations.InquireAsync(vaultName, resourceGroupName, fabricName, containerName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Inquires all the protectable items under the given container. + /// + /// + /// This is an async operation and the results should be tracked using location + /// header or Azure-async-url. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric Name associated with the container. + /// + /// + /// Name of the container in which inquiry needs to be triggered. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task InquireAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.InquireWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, odataQuery, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Discovers all the containers in the subscription that can be backed up to + /// Recovery Services Vault. This is an + /// asynchronous operation. To know the status of the operation, call + /// GetRefreshOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated the container. + /// + /// + /// OData parameters to apply to the operation. + /// + public static void Refresh(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery)) + { + operations.RefreshAsync(vaultName, resourceGroupName, fabricName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Discovers all the containers in the subscription that can be backed up to + /// Recovery Services Vault. This is an + /// asynchronous operation. To know the status of the operation, call + /// GetRefreshOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated the container. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task RefreshAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RefreshWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, odataQuery, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperations.cs new file mode 100644 index 000000000000..6bf6f535276e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperations.cs @@ -0,0 +1,899 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionIntentOperations operations. + /// + internal partial class ProtectionIntentOperations : IServiceOperations, IProtectionIntentOperations + { + /// + /// Initializes a new instance of the ProtectionIntentOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectionIntentOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// It will validate followings + /// 1. Vault capacity + /// 2. VM is already protected + /// 3. Any VM related configuration passed in properties. + /// + /// + /// Azure region to hit Api + /// + /// + /// Enable backup validation request on Virtual Machine + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ValidateWithHttpMessagesAsync(string azureRegion, PreValidateEnableBackupRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (azureRegion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("azureRegion", azureRegion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Validate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection").ToString(); + _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provides the details of the protection intent up item. This is an + /// asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (intentObjectName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "intentObjectName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("intentObjectName", intentObjectName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{intentObjectName}", System.Uri.EscapeDataString(intentObjectName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create Intent for Enabling backup of an item. This is a synchronous + /// operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Intent object name. + /// + /// + /// resource backed up item + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (intentObjectName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "intentObjectName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("intentObjectName", intentObjectName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{intentObjectName}", System.Uri.EscapeDataString(intentObjectName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Used to remove intent from an item + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the intent. + /// + /// + /// Intent to be deleted. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (intentObjectName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "intentObjectName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("intentObjectName", intentObjectName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{intentObjectName}", System.Uri.EscapeDataString(intentObjectName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperationsExtensions.cs new file mode 100644 index 000000000000..d9ca4cee41fd --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperationsExtensions.cs @@ -0,0 +1,242 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectionIntentOperations. + /// + public static partial class ProtectionIntentOperationsExtensions + { + /// + /// It will validate followings + /// 1. Vault capacity + /// 2. VM is already protected + /// 3. Any VM related configuration passed in properties. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure region to hit Api + /// + /// + /// Enable backup validation request on Virtual Machine + /// + public static PreValidateEnableBackupResponse Validate(this IProtectionIntentOperations operations, string azureRegion, PreValidateEnableBackupRequest parameters) + { + return operations.ValidateAsync(azureRegion, parameters).GetAwaiter().GetResult(); + } + + /// + /// It will validate followings + /// 1. Vault capacity + /// 2. VM is already protected + /// 3. Any VM related configuration passed in properties. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure region to hit Api + /// + /// + /// Enable backup validation request on Virtual Machine + /// + /// + /// The cancellation token. + /// + public static async Task ValidateAsync(this IProtectionIntentOperations operations, string azureRegion, PreValidateEnableBackupRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(azureRegion, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provides the details of the protection intent up item. This is an + /// asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + public static ProtectionIntentResource Get(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName) + { + return operations.GetAsync(vaultName, resourceGroupName, fabricName, intentObjectName).GetAwaiter().GetResult(); + } + + /// + /// Provides the details of the protection intent up item. This is an + /// asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, intentObjectName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create Intent for Enabling backup of an item. This is a synchronous + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Intent object name. + /// + /// + /// resource backed up item + /// + public static ProtectionIntentResource CreateOrUpdate(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName, ProtectionIntentResource parameters) + { + return operations.CreateOrUpdateAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create Intent for Enabling backup of an item. This is a synchronous + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backup item. + /// + /// + /// Intent object name. + /// + /// + /// resource backed up item + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Used to remove intent from an item + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the intent. + /// + /// + /// Intent to be deleted. + /// + public static void Delete(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName) + { + operations.DeleteAsync(vaultName, resourceGroupName, fabricName, intentObjectName).GetAwaiter().GetResult(); + } + + /// + /// Used to remove intent from an item + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the intent. + /// + /// + /// Intent to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, intentObjectName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs new file mode 100644 index 000000000000..7748c907902a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs @@ -0,0 +1,700 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionPoliciesOperations operations. + /// + internal partial class ProtectionPoliciesOperations : IServiceOperations, IProtectionPoliciesOperations + { + /// + /// Initializes a new instance of the ProtectionPoliciesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides the details of the backup policies associated to Recovery Services + /// Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using + /// GetPolicyOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy information to be fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (policyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("policyName", policyName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or modifies a backup policy. This is an asynchronous operation. + /// Status of the operation can be fetched + /// using GetPolicyOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be created. + /// + /// + /// resource backup policy + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (policyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("policyName", policyName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes specified backup policy from your Recovery Services Vault. This is + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes specified backup policy from your Recovery Services Vault. This is + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be deleted. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (policyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("policyName", policyName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperationsExtensions.cs new file mode 100644 index 000000000000..4f5a9387d7b3 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperationsExtensions.cs @@ -0,0 +1,235 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectionPoliciesOperations. + /// + public static partial class ProtectionPoliciesOperationsExtensions + { + /// + /// Provides the details of the backup policies associated to Recovery Services + /// Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using + /// GetPolicyOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy information to be fetched. + /// + public static ProtectionPolicyResource Get(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName) + { + return operations.GetAsync(vaultName, resourceGroupName, policyName).GetAwaiter().GetResult(); + } + + /// + /// Provides the details of the backup policies associated to Recovery Services + /// Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using + /// GetPolicyOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy information to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or modifies a backup policy. This is an asynchronous operation. + /// Status of the operation can be fetched + /// using GetPolicyOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be created. + /// + /// + /// resource backup policy + /// + public static ProtectionPolicyResource CreateOrUpdate(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters) + { + return operations.CreateOrUpdateAsync(vaultName, resourceGroupName, policyName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or modifies a backup policy. This is an asynchronous operation. + /// Status of the operation can be fetched + /// using GetPolicyOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be created. + /// + /// + /// resource backup policy + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes specified backup policy from your Recovery Services Vault. This is + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be deleted. + /// + public static void Delete(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName) + { + operations.DeleteAsync(vaultName, resourceGroupName, policyName).GetAwaiter().GetResult(); + } + + /// + /// Deletes specified backup policy from your Recovery Services Vault. This is + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes specified backup policy from your Recovery Services Vault. This is + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be deleted. + /// + public static void BeginDelete(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName) + { + operations.BeginDeleteAsync(vaultName, resourceGroupName, policyName).GetAwaiter().GetResult(); + } + + /// + /// Deletes specified backup policy from your Recovery Services Vault. This is + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs new file mode 100644 index 000000000000..18438d7f80e8 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs @@ -0,0 +1,270 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionPolicyOperationResultsOperations operations. + /// + internal partial class ProtectionPolicyOperationResultsOperations : IServiceOperations, IProtectionPolicyOperationResultsOperations + { + /// + /// Initializes a new instance of the ProtectionPolicyOperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides the result of an operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy name whose operation's result needs to be fetched. + /// + /// + /// Operation ID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (policyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("policyName", policyName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..6f3741c1b787 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperationsExtensions.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectionPolicyOperationResultsOperations. + /// + public static partial class ProtectionPolicyOperationResultsOperationsExtensions + { + /// + /// Provides the result of an operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy name whose operation's result needs to be fetched. + /// + /// + /// Operation ID which represents the operation whose result needs to be + /// fetched. + /// + public static ProtectionPolicyResource Get(this IProtectionPolicyOperationResultsOperations operations, string vaultName, string resourceGroupName, string policyName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, policyName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Provides the result of an operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy name whose operation's result needs to be fetched. + /// + /// + /// Operation ID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectionPolicyOperationResultsOperations operations, string vaultName, string resourceGroupName, string policyName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs new file mode 100644 index 000000000000..fc7276a29f7b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs @@ -0,0 +1,275 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProtectionPolicyOperationStatusesOperations operations. + /// + internal partial class ProtectionPolicyOperationStatusesOperations : IServiceOperations, IProtectionPolicyOperationStatusesOperations + { + /// + /// Initializes a new instance of the ProtectionPolicyOperationStatusesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Provides the status of the asynchronous operations like backup, restore. + /// The status can be in progress, completed + /// or failed. You can refer to the Operation Status enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy name whose operation's status needs to be fetched. + /// + /// + /// Operation ID which represents an operation whose status needs to be + /// fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (policyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("policyName", policyName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperationsExtensions.cs new file mode 100644 index 000000000000..f61cecb94bd4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperationsExtensions.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProtectionPolicyOperationStatusesOperations. + /// + public static partial class ProtectionPolicyOperationStatusesOperationsExtensions + { + /// + /// Provides the status of the asynchronous operations like backup, restore. + /// The status can be in progress, completed + /// or failed. You can refer to the Operation Status enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy name whose operation's status needs to be fetched. + /// + /// + /// Operation ID which represents an operation whose status needs to be + /// fetched. + /// + public static OperationStatus Get(this IProtectionPolicyOperationStatusesOperations operations, string vaultName, string resourceGroupName, string policyName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, policyName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Provides the status of the asynchronous operations like backup, restore. + /// The status can be in progress, completed + /// or failed. You can refer to the Operation Status enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Backup policy name whose operation's status needs to be fetched. + /// + /// + /// Operation ID which represents an operation whose status needs to be + /// fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProtectionPolicyOperationStatusesOperations operations, string vaultName, string resourceGroupName, string policyName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs new file mode 100644 index 000000000000..e8296da72d87 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs @@ -0,0 +1,700 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RecoveryPointsOperations operations. + /// + internal partial class RecoveryPointsOperations : IServiceOperations, IRecoveryPointsOperations + { + /// + /// Initializes a new instance of the RecoveryPointsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RecoveryPointsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Lists the backup copies for the backed up item. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item whose backup copies are to be fetched. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provides the information of the backed up data identified using + /// RecoveryPointID. This is an asynchronous operation. + /// To know the status of the operation, call the + /// GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with backed up item. + /// + /// + /// Container name associated with backed up item. + /// + /// + /// Backed up item name whose backup data needs to be fetched. + /// + /// + /// RecoveryPointID represents the backed up data to be fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (recoveryPointId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("recoveryPointId", recoveryPointId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the backup copies for the backed up item. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperationsExtensions.cs new file mode 100644 index 000000000000..e6ecbe1a9930 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperationsExtensions.cs @@ -0,0 +1,198 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RecoveryPointsOperations. + /// + public static partial class RecoveryPointsOperationsExtensions + { + /// + /// Lists the backup copies for the backed up item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item whose backup copies are to be fetched. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage List(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Lists the backup copies for the backed up item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up item. + /// + /// + /// Container name associated with the backed up item. + /// + /// + /// Backed up item whose backup copies are to be fetched. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provides the information of the backed up data identified using + /// RecoveryPointID. This is an asynchronous operation. + /// To know the status of the operation, call the + /// GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with backed up item. + /// + /// + /// Container name associated with backed up item. + /// + /// + /// Backed up item name whose backup data needs to be fetched. + /// + /// + /// RecoveryPointID represents the backed up data to be fetched. + /// + public static RecoveryPointResource Get(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId) + { + return operations.GetAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).GetAwaiter().GetResult(); + } + + /// + /// Provides the information of the backed up data identified using + /// RecoveryPointID. This is an asynchronous operation. + /// To know the status of the operation, call the + /// GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with backed up item. + /// + /// + /// Container name associated with backed up item. + /// + /// + /// Backed up item name whose backup data needs to be fetched. + /// + /// + /// RecoveryPointID represents the backed up data to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the backup copies for the backed up item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IRecoveryPointsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the backup copies for the backed up item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IRecoveryPointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs new file mode 100644 index 000000000000..1874446773da --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs @@ -0,0 +1,462 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RecoveryPointsRecommendedForMoveOperations operations. + /// + internal partial class RecoveryPointsRecommendedForMoveOperations : IServiceOperations, IRecoveryPointsRecommendedForMoveOperations + { + /// + /// Initializes a new instance of the RecoveryPointsRecommendedForMoveOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RecoveryPointsRecommendedForMoveOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// List Recovery points Recommended for Move Request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPointsRecommendedForMove").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs new file mode 100644 index 000000000000..ca53509a3ebc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs @@ -0,0 +1,119 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RecoveryPointsRecommendedForMoveOperations. + /// + public static partial class RecoveryPointsRecommendedForMoveOperationsExtensions + { + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// List Recovery points Recommended for Move Request + /// + public static IPage List(this IRecoveryPointsRecommendedForMoveOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters) + { + return operations.ListAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// List Recovery points Recommended for Move Request + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IRecoveryPointsRecommendedForMoveOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IRecoveryPointsRecommendedForMoveOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IRecoveryPointsRecommendedForMoveOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClient.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClient.cs new file mode 100644 index 000000000000..f54c38a3d667 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClient.cs @@ -0,0 +1,1568 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Open API 2.0 Specs for Azure RecoveryServices Backup service + /// + public partial class RecoveryServicesBackupClient : ServiceClient, IRecoveryServicesBackupClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// The subscription Id. + /// + public string SubscriptionId { get; set; } + + /// + /// Client Api Version. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IBackupResourceStorageConfigsNonCRROperations. + /// + public virtual IBackupResourceStorageConfigsNonCRROperations BackupResourceStorageConfigsNonCRR { get; private set; } + + /// + /// Gets the IProtectionIntentOperations. + /// + public virtual IProtectionIntentOperations ProtectionIntent { get; private set; } + + /// + /// Gets the IBackupStatusOperations. + /// + public virtual IBackupStatusOperations BackupStatus { get; private set; } + + /// + /// Gets the IFeatureSupportOperations. + /// + public virtual IFeatureSupportOperations FeatureSupport { get; private set; } + + /// + /// Gets the IBackupProtectionIntentOperations. + /// + public virtual IBackupProtectionIntentOperations BackupProtectionIntent { get; private set; } + + /// + /// Gets the IBackupUsageSummariesOperations. + /// + public virtual IBackupUsageSummariesOperations BackupUsageSummaries { get; private set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IBackupResourceVaultConfigsOperations. + /// + public virtual IBackupResourceVaultConfigsOperations BackupResourceVaultConfigs { get; private set; } + + /// + /// Gets the IBackupResourceEncryptionConfigsOperations. + /// + public virtual IBackupResourceEncryptionConfigsOperations BackupResourceEncryptionConfigs { get; private set; } + + /// + /// Gets the IPrivateEndpointConnectionOperations. + /// + public virtual IPrivateEndpointConnectionOperations PrivateEndpointConnection { get; private set; } + + /// + /// Gets the IPrivateEndpointOperations. + /// + public virtual IPrivateEndpointOperations PrivateEndpoint { get; private set; } + + /// + /// Gets the IBMSPrepareDataMoveOperationResultOperations. + /// + public virtual IBMSPrepareDataMoveOperationResultOperations BMSPrepareDataMoveOperationResult { get; private set; } + + /// + /// Gets the IProtectedItemsOperations. + /// + public virtual IProtectedItemsOperations ProtectedItems { get; private set; } + + /// + /// Gets the IProtectedItemOperationResultsOperations. + /// + public virtual IProtectedItemOperationResultsOperations ProtectedItemOperationResults { get; private set; } + + /// + /// Gets the IRecoveryPointsOperations. + /// + public virtual IRecoveryPointsOperations RecoveryPoints { get; private set; } + + /// + /// Gets the IRestoresOperations. + /// + public virtual IRestoresOperations Restores { get; private set; } + + /// + /// Gets the IBackupPoliciesOperations. + /// + public virtual IBackupPoliciesOperations BackupPolicies { get; private set; } + + /// + /// Gets the IProtectionPoliciesOperations. + /// + public virtual IProtectionPoliciesOperations ProtectionPolicies { get; private set; } + + /// + /// Gets the IProtectionPolicyOperationResultsOperations. + /// + public virtual IProtectionPolicyOperationResultsOperations ProtectionPolicyOperationResults { get; private set; } + + /// + /// Gets the IBackupJobsOperations. + /// + public virtual IBackupJobsOperations BackupJobs { get; private set; } + + /// + /// Gets the IJobDetailsOperations. + /// + public virtual IJobDetailsOperations JobDetails { get; private set; } + + /// + /// Gets the IJobCancellationsOperations. + /// + public virtual IJobCancellationsOperations JobCancellations { get; private set; } + + /// + /// Gets the IJobOperationResultsOperations. + /// + public virtual IJobOperationResultsOperations JobOperationResults { get; private set; } + + /// + /// Gets the IExportJobsOperationResultsOperations. + /// + public virtual IExportJobsOperationResultsOperations ExportJobsOperationResults { get; private set; } + + /// + /// Gets the IJobsOperations. + /// + public virtual IJobsOperations Jobs { get; private set; } + + /// + /// Gets the IBackupProtectedItemsOperations. + /// + public virtual IBackupProtectedItemsOperations BackupProtectedItems { get; private set; } + + /// + /// Gets the IOperationOperations. + /// + public virtual IOperationOperations Operation { get; private set; } + + /// + /// Gets the IValidateOperationOperations. + /// + public virtual IValidateOperationOperations ValidateOperation { get; private set; } + + /// + /// Gets the IValidateOperationResultsOperations. + /// + public virtual IValidateOperationResultsOperations ValidateOperationResults { get; private set; } + + /// + /// Gets the IValidateOperationStatusesOperations. + /// + public virtual IValidateOperationStatusesOperations ValidateOperationStatuses { get; private set; } + + /// + /// Gets the IBackupEnginesOperations. + /// + public virtual IBackupEnginesOperations BackupEngines { get; private set; } + + /// + /// Gets the IProtectionContainerRefreshOperationResultsOperations. + /// + public virtual IProtectionContainerRefreshOperationResultsOperations ProtectionContainerRefreshOperationResults { get; private set; } + + /// + /// Gets the IProtectableContainersOperations. + /// + public virtual IProtectableContainersOperations ProtectableContainers { get; private set; } + + /// + /// Gets the IProtectionContainersOperations. + /// + public virtual IProtectionContainersOperations ProtectionContainers { get; private set; } + + /// + /// Gets the IBackupWorkloadItemsOperations. + /// + public virtual IBackupWorkloadItemsOperations BackupWorkloadItems { get; private set; } + + /// + /// Gets the IProtectionContainerOperationResultsOperations. + /// + public virtual IProtectionContainerOperationResultsOperations ProtectionContainerOperationResults { get; private set; } + + /// + /// Gets the IBackupsOperations. + /// + public virtual IBackupsOperations Backups { get; private set; } + + /// + /// Gets the IProtectedItemOperationStatusesOperations. + /// + public virtual IProtectedItemOperationStatusesOperations ProtectedItemOperationStatuses { get; private set; } + + /// + /// Gets the IItemLevelRecoveryConnectionsOperations. + /// + public virtual IItemLevelRecoveryConnectionsOperations ItemLevelRecoveryConnections { get; private set; } + + /// + /// Gets the IBackupOperationResultsOperations. + /// + public virtual IBackupOperationResultsOperations BackupOperationResults { get; private set; } + + /// + /// Gets the IBackupOperationStatusesOperations. + /// + public virtual IBackupOperationStatusesOperations BackupOperationStatuses { get; private set; } + + /// + /// Gets the IProtectionPolicyOperationStatusesOperations. + /// + public virtual IProtectionPolicyOperationStatusesOperations ProtectionPolicyOperationStatuses { get; private set; } + + /// + /// Gets the IBackupProtectableItemsOperations. + /// + public virtual IBackupProtectableItemsOperations BackupProtectableItems { get; private set; } + + /// + /// Gets the IBackupProtectionContainersOperations. + /// + public virtual IBackupProtectionContainersOperations BackupProtectionContainers { get; private set; } + + /// + /// Gets the ISecurityPINsOperations. + /// + public virtual ISecurityPINsOperations SecurityPINs { get; private set; } + + /// + /// Gets the IRecoveryPointsRecommendedForMoveOperations. + /// + public virtual IRecoveryPointsRecommendedForMoveOperations RecoveryPointsRecommendedForMove { get; private set; } + + /// + /// Gets the IResourceGuardProxiesOperations. + /// + public virtual IResourceGuardProxiesOperations ResourceGuardProxies { get; private set; } + + /// + /// Gets the IResourceGuardProxyOperations. + /// + public virtual IResourceGuardProxyOperations ResourceGuardProxy { get; private set; } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling RecoveryServicesBackupClient.Dispose(). False: will not dispose provided httpClient + protected RecoveryServicesBackupClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected RecoveryServicesBackupClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected RecoveryServicesBackupClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected RecoveryServicesBackupClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected RecoveryServicesBackupClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public RecoveryServicesBackupClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling RecoveryServicesBackupClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public RecoveryServicesBackupClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public RecoveryServicesBackupClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public RecoveryServicesBackupClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the RecoveryServicesBackupClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public RecoveryServicesBackupClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + BackupResourceStorageConfigsNonCRR = new BackupResourceStorageConfigsNonCRROperations(this); + ProtectionIntent = new ProtectionIntentOperations(this); + BackupStatus = new BackupStatusOperations(this); + FeatureSupport = new FeatureSupportOperations(this); + BackupProtectionIntent = new BackupProtectionIntentOperations(this); + BackupUsageSummaries = new BackupUsageSummariesOperations(this); + Operations = new Operations(this); + BackupResourceVaultConfigs = new BackupResourceVaultConfigsOperations(this); + BackupResourceEncryptionConfigs = new BackupResourceEncryptionConfigsOperations(this); + PrivateEndpointConnection = new PrivateEndpointConnectionOperations(this); + PrivateEndpoint = new PrivateEndpointOperations(this); + BMSPrepareDataMoveOperationResult = new BMSPrepareDataMoveOperationResultOperations(this); + ProtectedItems = new ProtectedItemsOperations(this); + ProtectedItemOperationResults = new ProtectedItemOperationResultsOperations(this); + RecoveryPoints = new RecoveryPointsOperations(this); + Restores = new RestoresOperations(this); + BackupPolicies = new BackupPoliciesOperations(this); + ProtectionPolicies = new ProtectionPoliciesOperations(this); + ProtectionPolicyOperationResults = new ProtectionPolicyOperationResultsOperations(this); + BackupJobs = new BackupJobsOperations(this); + JobDetails = new JobDetailsOperations(this); + JobCancellations = new JobCancellationsOperations(this); + JobOperationResults = new JobOperationResultsOperations(this); + ExportJobsOperationResults = new ExportJobsOperationResultsOperations(this); + Jobs = new JobsOperations(this); + BackupProtectedItems = new BackupProtectedItemsOperations(this); + Operation = new OperationOperations(this); + ValidateOperation = new ValidateOperationOperations(this); + ValidateOperationResults = new ValidateOperationResultsOperations(this); + ValidateOperationStatuses = new ValidateOperationStatusesOperations(this); + BackupEngines = new BackupEnginesOperations(this); + ProtectionContainerRefreshOperationResults = new ProtectionContainerRefreshOperationResultsOperations(this); + ProtectableContainers = new ProtectableContainersOperations(this); + ProtectionContainers = new ProtectionContainersOperations(this); + BackupWorkloadItems = new BackupWorkloadItemsOperations(this); + ProtectionContainerOperationResults = new ProtectionContainerOperationResultsOperations(this); + Backups = new BackupsOperations(this); + ProtectedItemOperationStatuses = new ProtectedItemOperationStatusesOperations(this); + ItemLevelRecoveryConnections = new ItemLevelRecoveryConnectionsOperations(this); + BackupOperationResults = new BackupOperationResultsOperations(this); + BackupOperationStatuses = new BackupOperationStatusesOperations(this); + ProtectionPolicyOperationStatuses = new ProtectionPolicyOperationStatusesOperations(this); + BackupProtectableItems = new BackupProtectableItemsOperations(this); + BackupProtectionContainers = new BackupProtectionContainersOperations(this); + SecurityPINs = new SecurityPINsOperations(this); + RecoveryPointsRecommendedForMove = new RecoveryPointsRecommendedForMoveOperations(this); + ResourceGuardProxies = new ResourceGuardProxiesOperations(this); + ResourceGuardProxy = new ResourceGuardProxyOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2021-12-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("schedulePolicyType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("schedulePolicyType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("retentionPolicyType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("retentionPolicyType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("jobType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("jobType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("protectedItemType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("protectedItemType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("backupManagementType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("backupManagementType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("featureType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("featureType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("protectionIntentItemType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("protectionIntentItemType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("backupEngineType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("backupEngineType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("protectableContainerType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("protectableContainerType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("containerType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("containerType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("workloadItemType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("workloadItemType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("protectableItemType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("protectableItemType")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + /// + /// Fetches operation status for data move operation on vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetOperationStatusWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetOperationStatus", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task BMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginBMSPrepareDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Triggers Data Move Operation on target vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Trigger data move request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task BMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginBMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task MoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginMoveRecoveryPointWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginBMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginBMSPrepareDataMove", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Triggers Data Move Operation on target vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Trigger data move request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginBMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginBMSTriggerDataMove", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + NewErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginMoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (recoveryPointId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("recoveryPointId", recoveryPointId); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginMoveRecoveryPoint", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClientExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClientExtensions.cs new file mode 100644 index 000000000000..c6bbee1b4b0a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClientExtensions.cs @@ -0,0 +1,373 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RecoveryServicesBackupClient. + /// + public static partial class RecoveryServicesBackupClientExtensions + { + /// + /// Fetches operation status for data move operation on vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + public static OperationStatus GetOperationStatus(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string operationId) + { + return operations.GetOperationStatusAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches operation status for data move operation on vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetOperationStatusAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + public static void BMSPrepareDataMove(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters) + { + operations.BMSPrepareDataMoveAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + /// + /// The cancellation token. + /// + public static async Task BMSPrepareDataMoveAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BMSPrepareDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Triggers Data Move Operation on target vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Trigger data move request + /// + public static void BMSTriggerDataMove(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters) + { + operations.BMSTriggerDataMoveAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Triggers Data Move Operation on target vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Trigger data move request + /// + /// + /// The cancellation token. + /// + public static async Task BMSTriggerDataMoveAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + public static void MoveRecoveryPoint(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters) + { + operations.MoveRecoveryPointAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The cancellation token. + /// + public static async Task MoveRecoveryPointAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.MoveRecoveryPointWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + public static void BeginBMSPrepareDataMove(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters) + { + operations.BeginBMSPrepareDataMoveAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + /// + /// The cancellation token. + /// + public static async Task BeginBMSPrepareDataMoveAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginBMSPrepareDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Triggers Data Move Operation on target vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Trigger data move request + /// + public static void BeginBMSTriggerDataMove(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters) + { + operations.BeginBMSTriggerDataMoveAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Triggers Data Move Operation on target vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Trigger data move request + /// + /// + /// The cancellation token. + /// + public static async Task BeginBMSTriggerDataMoveAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginBMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + public static void BeginMoveRecoveryPoint(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters) + { + operations.BeginMoveRecoveryPointAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The cancellation token. + /// + public static async Task BeginMoveRecoveryPointAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginMoveRecoveryPointWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperations.cs new file mode 100644 index 000000000000..8bb17fd88505 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperations.cs @@ -0,0 +1,424 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ResourceGuardProxiesOperations operations. + /// + internal partial class ResourceGuardProxiesOperations : IServiceOperations, IResourceGuardProxiesOperations + { + /// + /// Initializes a new instance of the ResourceGuardProxiesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ResourceGuardProxiesOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// List the ResourceGuardProxies under vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List the ResourceGuardProxies under vault + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperationsExtensions.cs new file mode 100644 index 000000000000..e33c2d6caa5c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperationsExtensions.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ResourceGuardProxiesOperations. + /// + public static partial class ResourceGuardProxiesOperationsExtensions + { + /// + /// List the ResourceGuardProxies under vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + public static IPage Get(this IResourceGuardProxiesOperations operations, string vaultName, string resourceGroupName) + { + return operations.GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// List the ResourceGuardProxies under vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The cancellation token. + /// + public static async Task> GetAsync(this IResourceGuardProxiesOperations operations, string vaultName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List the ResourceGuardProxies under vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetNext(this IResourceGuardProxiesOperations operations, string nextPageLink) + { + return operations.GetNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List the ResourceGuardProxies under vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetNextAsync(this IResourceGuardProxiesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperations.cs new file mode 100644 index 000000000000..bf785a122791 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperations.cs @@ -0,0 +1,869 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ResourceGuardProxyOperations operations. + /// + internal partial class ResourceGuardProxyOperations : IServiceOperations, IResourceGuardProxyOperations + { + /// + /// Initializes a new instance of the ResourceGuardProxyOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Returns ResourceGuardProxy under vault and with the name referenced in + /// request + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardProxyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardProxyName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardProxyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardProxyName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete ResourceGuardProxy under vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardProxyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardProxyName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Secures delete ResourceGuardProxy operations. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// Request body for operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UnlockDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, UnlockDeleteRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardProxyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardProxyName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UnlockDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperationsExtensions.cs new file mode 100644 index 000000000000..7bb8adf98f04 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperationsExtensions.cs @@ -0,0 +1,216 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ResourceGuardProxyOperations. + /// + public static partial class ResourceGuardProxyOperationsExtensions + { + /// + /// Returns ResourceGuardProxy under vault and with the name referenced in + /// request + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + public static ResourceGuardProxyBaseResource Get(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName) + { + return operations.GetAsync(vaultName, resourceGroupName, resourceGuardProxyName).GetAwaiter().GetResult(); + } + + /// + /// Returns ResourceGuardProxy under vault and with the name referenced in + /// request + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, resourceGuardProxyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + public static ResourceGuardProxyBaseResource Put(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName) + { + return operations.PutAsync(vaultName, resourceGroupName, resourceGuardProxyName).GetAwaiter().GetResult(); + } + + /// + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task PutAsync(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(vaultName, resourceGroupName, resourceGuardProxyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete ResourceGuardProxy under vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + public static void Delete(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName) + { + operations.DeleteAsync(vaultName, resourceGroupName, resourceGuardProxyName).GetAwaiter().GetResult(); + } + + /// + /// Delete ResourceGuardProxy under vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, resourceGuardProxyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Secures delete ResourceGuardProxy operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// Request body for operation + /// + public static UnlockDeleteResponse UnlockDelete(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, UnlockDeleteRequest parameters) + { + return operations.UnlockDeleteAsync(vaultName, resourceGroupName, resourceGuardProxyName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Secures delete ResourceGuardProxy operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// Request body for operation + /// + /// + /// The cancellation token. + /// + public static async Task UnlockDeleteAsync(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, UnlockDeleteRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UnlockDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, resourceGuardProxyName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperations.cs new file mode 100644 index 000000000000..58cede79686d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperations.cs @@ -0,0 +1,322 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RestoresOperations operations. + /// + internal partial class RestoresOperations : IServiceOperations, IRestoresOperations + { + /// + /// Initializes a new instance of the RestoresOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RestoresOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Restores the specified backed up data. This is an asynchronous operation. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be restored. + /// + /// + /// resource restore request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores the specified backed up data. This is an asynchronous operation. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be restored. + /// + /// + /// resource restore request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (fabricName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); + } + if (recoveryPointId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("recoveryPointId", recoveryPointId); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginTrigger", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperationsExtensions.cs new file mode 100644 index 000000000000..92aa7b04f5c6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperationsExtensions.cs @@ -0,0 +1,171 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RestoresOperations. + /// + public static partial class RestoresOperationsExtensions + { + /// + /// Restores the specified backed up data. This is an asynchronous operation. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be restored. + /// + /// + /// resource restore request + /// + public static void Trigger(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters) + { + operations.TriggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Restores the specified backed up data. This is an asynchronous operation. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be restored. + /// + /// + /// resource restore request + /// + /// + /// The cancellation token. + /// + public static async Task TriggerAsync(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Restores the specified backed up data. This is an asynchronous operation. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be restored. + /// + /// + /// resource restore request + /// + public static void BeginTrigger(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters) + { + operations.BeginTriggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Restores the specified backed up data. This is an asynchronous operation. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be restored. + /// + /// + /// resource restore request + /// + /// + /// The cancellation token. + /// + public static async Task BeginTriggerAsync(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs new file mode 100644 index 000000000000..e7b750a28a92 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs @@ -0,0 +1,78 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_RecoveryServicesBackupClient + { + get + { + return new Tuple[] + { + new Tuple("RecoveryServices", "BMSPrepareDataMove", "2021-12-01"), + new Tuple("RecoveryServices", "BMSPrepareDataMoveOperationResult", "2021-12-01"), + new Tuple("RecoveryServices", "BMSTriggerDataMove", "2021-12-01"), + new Tuple("RecoveryServices", "BackupEngines", "2021-12-01"), + new Tuple("RecoveryServices", "BackupJobs", "2021-12-01"), + new Tuple("RecoveryServices", "BackupOperationResults", "2021-12-01"), + new Tuple("RecoveryServices", "BackupOperationStatuses", "2021-12-01"), + new Tuple("RecoveryServices", "BackupPolicies", "2021-12-01"), + new Tuple("RecoveryServices", "BackupProtectableItems", "2021-12-01"), + new Tuple("RecoveryServices", "BackupProtectedItems", "2021-12-01"), + new Tuple("RecoveryServices", "BackupProtectionContainers", "2021-12-01"), + new Tuple("RecoveryServices", "BackupProtectionIntent", "2021-12-01"), + new Tuple("RecoveryServices", "BackupResourceEncryptionConfigs", "2021-12-01"), + new Tuple("RecoveryServices", "BackupResourceStorageConfigsNonCRR", "2021-12-01"), + new Tuple("RecoveryServices", "BackupResourceVaultConfigs", "2021-12-01"), + new Tuple("RecoveryServices", "BackupStatus", "2021-12-01"), + new Tuple("RecoveryServices", "BackupUsageSummaries", "2021-12-01"), + new Tuple("RecoveryServices", "BackupWorkloadItems", "2021-12-01"), + new Tuple("RecoveryServices", "Backups", "2021-12-01"), + new Tuple("RecoveryServices", "ExportJobsOperationResults", "2021-12-01"), + new Tuple("RecoveryServices", "FeatureSupport", "2021-12-01"), + new Tuple("RecoveryServices", "GetOperationStatus", "2021-12-01"), + new Tuple("RecoveryServices", "ItemLevelRecoveryConnections", "2021-12-01"), + new Tuple("RecoveryServices", "JobCancellations", "2021-12-01"), + new Tuple("RecoveryServices", "JobDetails", "2021-12-01"), + new Tuple("RecoveryServices", "JobOperationResults", "2021-12-01"), + new Tuple("RecoveryServices", "Jobs", "2021-12-01"), + new Tuple("RecoveryServices", "MoveRecoveryPoint", "2021-12-01"), + new Tuple("RecoveryServices", "Operation", "2021-12-01"), + new Tuple("RecoveryServices", "Operations", "2021-12-01"), + new Tuple("RecoveryServices", "PrivateEndpoint", "2021-12-01"), + new Tuple("RecoveryServices", "PrivateEndpointConnection", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectableContainers", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectedItemOperationResults", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectedItemOperationStatuses", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectedItems", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectionContainerOperationResults", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectionContainerRefreshOperationResults", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectionContainers", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectionIntent", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectionPolicies", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectionPolicyOperationResults", "2021-12-01"), + new Tuple("RecoveryServices", "ProtectionPolicyOperationStatuses", "2021-12-01"), + new Tuple("RecoveryServices", "RecoveryPoints", "2021-12-01"), + new Tuple("RecoveryServices", "RecoveryPointsRecommendedForMove", "2021-12-01"), + new Tuple("RecoveryServices", "ResourceGuardProxies", "2021-12-01"), + new Tuple("RecoveryServices", "ResourceGuardProxy", "2021-12-01"), + new Tuple("RecoveryServices", "Restores", "2021-12-01"), + new Tuple("RecoveryServices", "SecurityPINs", "2021-12-01"), + new Tuple("RecoveryServices", "ValidateOperation", "2021-12-01"), + new Tuple("RecoveryServices", "ValidateOperationResults", "2021-12-01"), + new Tuple("RecoveryServices", "ValidateOperationStatuses", "2021-12-01"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperations.cs new file mode 100644 index 000000000000..c582fd1219e2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperations.cs @@ -0,0 +1,267 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SecurityPINsOperations operations. + /// + internal partial class SecurityPINsOperations : IServiceOperations, ISecurityPINsOperations + { + /// + /// Initializes a new instance of the SecurityPINsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SecurityPINsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Get the security PIN. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// ResourceGuard Operation Requests + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, IList resourceGuardOperationRequests = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + SecurityPinBase parameters = default(SecurityPinBase); + if (resourceGuardOperationRequests != null) + { + parameters = new SecurityPinBase(); + parameters.ResourceGuardOperationRequests = resourceGuardOperationRequests; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperationsExtensions.cs new file mode 100644 index 000000000000..edc950ce58ae --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperationsExtensions.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SecurityPINsOperations. + /// + public static partial class SecurityPINsOperationsExtensions + { + /// + /// Get the security PIN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// ResourceGuard Operation Requests + /// + public static TokenInformation Get(this ISecurityPINsOperations operations, string vaultName, string resourceGroupName, IList resourceGuardOperationRequests = default(IList)) + { + return operations.GetAsync(vaultName, resourceGroupName, resourceGuardOperationRequests).GetAwaiter().GetResult(); + } + + /// + /// Get the security PIN. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// ResourceGuard Operation Requests + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISecurityPINsOperations operations, string vaultName, string resourceGroupName, IList resourceGuardOperationRequests = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, resourceGuardOperationRequests, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperations.cs new file mode 100644 index 000000000000..3e0eac628c61 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperations.cs @@ -0,0 +1,274 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ValidateOperationOperations operations. + /// + internal partial class ValidateOperationOperations : IServiceOperations, IValidateOperationOperations + { + /// + /// Initializes a new instance of the ValidateOperationOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ValidateOperationOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginTrigger", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTriggerValidateOperation").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperationsExtensions.cs new file mode 100644 index 000000000000..5e856dfdc011 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperationsExtensions.cs @@ -0,0 +1,123 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ValidateOperationOperations. + /// + public static partial class ValidateOperationOperationsExtensions + { + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + public static void Trigger(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters) + { + operations.TriggerAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// The cancellation token. + /// + public static async Task TriggerAsync(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + public static void BeginTrigger(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters) + { + operations.BeginTriggerAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// The cancellation token. + /// + public static async Task BeginTriggerAsync(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperations.cs new file mode 100644 index 000000000000..afe3c735c98a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperations.cs @@ -0,0 +1,261 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ValidateOperationResultsOperations operations. + /// + internal partial class ValidateOperationResultsOperations : IServiceOperations, IValidateOperationResultsOperations + { + /// + /// Initializes a new instance of the ValidateOperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ValidateOperationResultsOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches the result of a triggered validate operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationResults/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperationsExtensions.cs new file mode 100644 index 000000000000..68101acce37b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperationsExtensions.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ValidateOperationResultsOperations. + /// + public static partial class ValidateOperationResultsOperationsExtensions + { + /// + /// Fetches the result of a triggered validate operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. + /// + public static ValidateOperationsResponse Get(this IValidateOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches the result of a triggered validate operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IValidateOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperations.cs new file mode 100644 index 000000000000..2266d550b4a1 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperations.cs @@ -0,0 +1,265 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ValidateOperationStatusesOperations operations. + /// + internal partial class ValidateOperationStatusesOperations : IServiceOperations, IValidateOperationStatusesOperations + { + /// + /// Initializes a new instance of the ValidateOperationStatusesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ValidateOperationStatusesOperations(RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Fetches the status of a triggered validate operation. The status can be in + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID represents the operation whose status needs to be fetched. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationsStatuses/{operationId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperationsExtensions.cs new file mode 100644 index 000000000000..0b87a6dc00e6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperationsExtensions.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ValidateOperationStatusesOperations. + /// + public static partial class ValidateOperationStatusesOperationsExtensions + { + /// + /// Fetches the status of a triggered validate operation. The status can be in + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID represents the operation whose status needs to be fetched. + /// + public static OperationStatus Get(this IValidateOperationStatusesOperations operations, string vaultName, string resourceGroupName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches the status of a triggered validate operation. The status can be in + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID represents the operation whose status needs to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IValidateOperationStatusesOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}